veryfi 2.0.0 → 4.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.
data/lib/veryfi.rb CHANGED
@@ -4,14 +4,78 @@ module Veryfi
4
4
  autoload :VERSION, "veryfi/version"
5
5
  autoload :Signature, "veryfi/signature"
6
6
  autoload :Request, "veryfi/request"
7
+ autoload :Resource, "veryfi/resource"
7
8
  autoload :Error, "veryfi/error"
9
+ autoload :Configuration, "veryfi/configuration"
8
10
 
9
11
  module Api
12
+ autoload :FilePayload, "veryfi/api/file_payload"
13
+ autoload :TagOperations, "veryfi/api/tag_operations"
14
+
10
15
  autoload :Document, "veryfi/api/document"
11
16
  autoload :LineItem, "veryfi/api/line_item"
17
+ autoload :TaxLine, "veryfi/api/tax_line"
12
18
  autoload :Tag, "veryfi/api/tag"
13
19
  autoload :DocumentTag, "veryfi/api/document_tag"
20
+
21
+ autoload :AnyDocument, "veryfi/api/any_document"
22
+ autoload :BankStatement, "veryfi/api/bank_statement"
23
+ autoload :BankStatementSplit, "veryfi/api/bank_statement_split"
24
+ autoload :BusinessCard, "veryfi/api/business_card"
25
+ autoload :Check, "veryfi/api/check"
26
+ autoload :Classify, "veryfi/api/classify"
27
+ autoload :PdfSplit, "veryfi/api/pdf_split"
28
+ autoload :W2, "veryfi/api/w2"
29
+ autoload :W2Split, "veryfi/api/w2_split"
30
+ autoload :W8, "veryfi/api/w8"
31
+ autoload :W9, "veryfi/api/w9"
14
32
  end
15
33
 
16
34
  autoload :Client, "veryfi/client"
35
+
36
+ class << self
37
+ # Process-wide configuration, used by {Veryfi.client} as defaults when
38
+ # constructing the shared client. You can still call
39
+ # `Veryfi::Client.new(...)` directly to bypass this entirely.
40
+ #
41
+ # @example
42
+ # Veryfi.configure do |c|
43
+ # c.client_id = ENV.fetch("VERYFI_CLIENT_ID")
44
+ # c.client_secret = ENV.fetch("VERYFI_CLIENT_SECRET")
45
+ # c.username = ENV.fetch("VERYFI_USERNAME")
46
+ # c.api_key = ENV.fetch("VERYFI_API_KEY")
47
+ # end
48
+ #
49
+ # Veryfi.client.document.process(file_path: "./receipt.jpg")
50
+ #
51
+ # @yieldparam config [Veryfi::Configuration]
52
+ # @return [Veryfi::Configuration]
53
+ def configure
54
+ yield(configuration) if block_given?
55
+ configuration
56
+ end
57
+
58
+ # @return [Veryfi::Configuration] the global configuration object.
59
+ def configuration
60
+ @_configuration ||= Veryfi::Configuration.new
61
+ end
62
+
63
+ # Process-wide memoized {Veryfi::Client} built from {.configuration}.
64
+ # Resets if you re-{.configure} the SDK after first use.
65
+ #
66
+ # @return [Veryfi::Client]
67
+ def client
68
+ @_client = nil if @_last_configuration_hash && @_last_configuration_hash != configuration.to_h
69
+ @_last_configuration_hash = configuration.to_h
70
+ @_client ||= Veryfi::Client.new(**configuration.to_h.compact)
71
+ end
72
+
73
+ # Drop the memoized {.client} and {.configuration}. Mostly useful in tests.
74
+ # @return [void]
75
+ def reset!
76
+ @_configuration = nil
77
+ @_client = nil
78
+ @_last_configuration_hash = nil
79
+ end
80
+ end
17
81
  end
data/veryfi.gemspec CHANGED
@@ -27,9 +27,11 @@ Gem::Specification.new do |spec|
27
27
  ".rubocop.yml",
28
28
  ".ruby-version",
29
29
  ".semaphore/semaphore.yml",
30
+ ".yardopts",
30
31
  "Gemfile",
31
32
  "Gemfile.lock",
32
33
  "README.md",
34
+ "Rakefile",
33
35
  "bin/autospec",
34
36
  "bin/bundle-audit",
35
37
  "bin/ci",
@@ -48,13 +50,29 @@ Gem::Specification.new do |spec|
48
50
  "docs/index.markdown",
49
51
  "lib/.keep",
50
52
  "lib/veryfi.rb",
53
+ "lib/veryfi/api/any_document.rb",
54
+ "lib/veryfi/api/bank_statement.rb",
55
+ "lib/veryfi/api/bank_statement_split.rb",
56
+ "lib/veryfi/api/business_card.rb",
57
+ "lib/veryfi/api/check.rb",
58
+ "lib/veryfi/api/classify.rb",
51
59
  "lib/veryfi/api/document.rb",
52
60
  "lib/veryfi/api/document_tag.rb",
61
+ "lib/veryfi/api/file_payload.rb",
53
62
  "lib/veryfi/api/line_item.rb",
63
+ "lib/veryfi/api/pdf_split.rb",
54
64
  "lib/veryfi/api/tag.rb",
65
+ "lib/veryfi/api/tag_operations.rb",
66
+ "lib/veryfi/api/tax_line.rb",
67
+ "lib/veryfi/api/w2.rb",
68
+ "lib/veryfi/api/w2_split.rb",
69
+ "lib/veryfi/api/w8.rb",
70
+ "lib/veryfi/api/w9.rb",
55
71
  "lib/veryfi/client.rb",
72
+ "lib/veryfi/configuration.rb",
56
73
  "lib/veryfi/error.rb",
57
74
  "lib/veryfi/request.rb",
75
+ "lib/veryfi/resource.rb",
58
76
  "lib/veryfi/signature.rb",
59
77
  "lib/veryfi/version.rb",
60
78
  "veryfi.gemspec"
@@ -65,23 +83,27 @@ Gem::Specification.new do |spec|
65
83
  spec.require_paths = ["lib"]
66
84
  spec.license = "MIT"
67
85
 
86
+ spec.required_ruby_version = ">= 3.0"
87
+
68
88
  spec.add_dependency "base64", "~> 0.1"
69
- spec.add_dependency "openssl", ">= 2.2", "< 3.1"
89
+ spec.add_dependency "openssl", ">= 2.2", "< 4.1"
70
90
 
71
- spec.add_dependency "faraday", ">= 1.7", "< 3.0"
91
+ # Faraday 2.14.1 is the floor of the CVE-2026-25765-fixed 2.x line.
92
+ spec.add_dependency "faraday", ">= 2.14.1", "< 3.0"
72
93
 
73
- spec.add_development_dependency "bundler", "~> 2.2"
94
+ spec.add_development_dependency "bundler", "~> 2.4"
74
95
  spec.add_development_dependency "bundler-audit", "~> 0.9"
75
96
  spec.add_development_dependency "pry", "~> 0.14"
76
97
  spec.add_development_dependency "rake", "~> 13.0"
77
98
  spec.add_development_dependency "rspec", "~> 3.9"
78
99
  spec.add_development_dependency "rspec-its", "~> 1.3"
79
- spec.add_development_dependency "rubocop", "~> 0.82"
80
- spec.add_development_dependency "rubocop-rspec", "~> 1.38"
100
+ spec.add_development_dependency "rubocop", "~> 1.65"
101
+ spec.add_development_dependency "rubocop-rake", "~> 0.6"
102
+ spec.add_development_dependency "rubocop-rspec", "~> 3.0"
81
103
  spec.add_development_dependency "simplecov", "~> 0.21"
82
104
  spec.add_development_dependency "simplecov-badge", "~> 2.0"
83
105
  spec.add_development_dependency "vcr", "~> 6.0"
84
106
  spec.add_development_dependency "webmock", "~> 3.14"
85
- spec.add_development_dependency "rexml", "~> 3.2.7"
86
- spec.add_development_dependency "activesupport", "~> 6.0"
107
+ spec.add_development_dependency "rexml", "~> 3.4.4"
108
+ spec.add_development_dependency "yard", "~> 0.9"
87
109
  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: 2.0.0
4
+ version: 4.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: 2024-06-11 00:00:00.000000000 Z
11
+ date: 2026-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '2.2'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '3.1'
36
+ version: '4.1'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,14 +43,14 @@ dependencies:
43
43
  version: '2.2'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: '3.1'
46
+ version: '4.1'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: faraday
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: '1.7'
53
+ version: 2.14.1
54
54
  - - "<"
55
55
  - !ruby/object:Gem::Version
56
56
  version: '3.0'
@@ -60,7 +60,7 @@ dependencies:
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: '1.7'
63
+ version: 2.14.1
64
64
  - - "<"
65
65
  - !ruby/object:Gem::Version
66
66
  version: '3.0'
@@ -70,14 +70,14 @@ dependencies:
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: '2.2'
73
+ version: '2.4'
74
74
  type: :development
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: '2.2'
80
+ version: '2.4'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: bundler-audit
83
83
  requirement: !ruby/object:Gem::Requirement
@@ -154,28 +154,42 @@ dependencies:
154
154
  requirements:
155
155
  - - "~>"
156
156
  - !ruby/object:Gem::Version
157
- version: '0.82'
157
+ version: '1.65'
158
+ type: :development
159
+ prerelease: false
160
+ version_requirements: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - "~>"
163
+ - !ruby/object:Gem::Version
164
+ version: '1.65'
165
+ - !ruby/object:Gem::Dependency
166
+ name: rubocop-rake
167
+ requirement: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - "~>"
170
+ - !ruby/object:Gem::Version
171
+ version: '0.6'
158
172
  type: :development
159
173
  prerelease: false
160
174
  version_requirements: !ruby/object:Gem::Requirement
161
175
  requirements:
162
176
  - - "~>"
163
177
  - !ruby/object:Gem::Version
164
- version: '0.82'
178
+ version: '0.6'
165
179
  - !ruby/object:Gem::Dependency
166
180
  name: rubocop-rspec
167
181
  requirement: !ruby/object:Gem::Requirement
168
182
  requirements:
169
183
  - - "~>"
170
184
  - !ruby/object:Gem::Version
171
- version: '1.38'
185
+ version: '3.0'
172
186
  type: :development
173
187
  prerelease: false
174
188
  version_requirements: !ruby/object:Gem::Requirement
175
189
  requirements:
176
190
  - - "~>"
177
191
  - !ruby/object:Gem::Version
178
- version: '1.38'
192
+ version: '3.0'
179
193
  - !ruby/object:Gem::Dependency
180
194
  name: simplecov
181
195
  requirement: !ruby/object:Gem::Requirement
@@ -238,28 +252,28 @@ dependencies:
238
252
  requirements:
239
253
  - - "~>"
240
254
  - !ruby/object:Gem::Version
241
- version: 3.2.7
255
+ version: 3.4.4
242
256
  type: :development
243
257
  prerelease: false
244
258
  version_requirements: !ruby/object:Gem::Requirement
245
259
  requirements:
246
260
  - - "~>"
247
261
  - !ruby/object:Gem::Version
248
- version: 3.2.7
262
+ version: 3.4.4
249
263
  - !ruby/object:Gem::Dependency
250
- name: activesupport
264
+ name: yard
251
265
  requirement: !ruby/object:Gem::Requirement
252
266
  requirements:
253
267
  - - "~>"
254
268
  - !ruby/object:Gem::Version
255
- version: '6.0'
269
+ version: '0.9'
256
270
  type: :development
257
271
  prerelease: false
258
272
  version_requirements: !ruby/object:Gem::Requirement
259
273
  requirements:
260
274
  - - "~>"
261
275
  - !ruby/object:Gem::Version
262
- version: '6.0'
276
+ version: '0.9'
263
277
  description:
264
278
  email:
265
279
  - support@veryfi.com
@@ -274,9 +288,11 @@ files:
274
288
  - ".rubocop.yml"
275
289
  - ".ruby-version"
276
290
  - ".semaphore/semaphore.yml"
291
+ - ".yardopts"
277
292
  - Gemfile
278
293
  - Gemfile.lock
279
294
  - README.md
295
+ - Rakefile
280
296
  - bin/autospec
281
297
  - bin/bundle-audit
282
298
  - bin/ci
@@ -295,13 +311,29 @@ files:
295
311
  - docs/index.markdown
296
312
  - lib/.keep
297
313
  - lib/veryfi.rb
314
+ - lib/veryfi/api/any_document.rb
315
+ - lib/veryfi/api/bank_statement.rb
316
+ - lib/veryfi/api/bank_statement_split.rb
317
+ - lib/veryfi/api/business_card.rb
318
+ - lib/veryfi/api/check.rb
319
+ - lib/veryfi/api/classify.rb
298
320
  - lib/veryfi/api/document.rb
299
321
  - lib/veryfi/api/document_tag.rb
322
+ - lib/veryfi/api/file_payload.rb
300
323
  - lib/veryfi/api/line_item.rb
324
+ - lib/veryfi/api/pdf_split.rb
301
325
  - lib/veryfi/api/tag.rb
326
+ - lib/veryfi/api/tag_operations.rb
327
+ - lib/veryfi/api/tax_line.rb
328
+ - lib/veryfi/api/w2.rb
329
+ - lib/veryfi/api/w2_split.rb
330
+ - lib/veryfi/api/w8.rb
331
+ - lib/veryfi/api/w9.rb
302
332
  - lib/veryfi/client.rb
333
+ - lib/veryfi/configuration.rb
303
334
  - lib/veryfi/error.rb
304
335
  - lib/veryfi/request.rb
336
+ - lib/veryfi/resource.rb
305
337
  - lib/veryfi/signature.rb
306
338
  - lib/veryfi/version.rb
307
339
  - veryfi.gemspec
@@ -317,7 +349,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
317
349
  requirements:
318
350
  - - ">="
319
351
  - !ruby/object:Gem::Version
320
- version: '0'
352
+ version: '3.0'
321
353
  required_rubygems_version: !ruby/object:Gem::Requirement
322
354
  requirements:
323
355
  - - ">="