avatax 22.8.0 → 23.8.1

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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/gem-push.yml +3 -3
  3. data/.gitignore +2 -0
  4. data/README.md +1 -1
  5. data/avatax.gemspec +3 -3
  6. data/lib/avatax/api.rb +14 -0
  7. data/lib/avatax/client/accounts.rb +17 -17
  8. data/lib/avatax/client/addresses.rb +2 -2
  9. data/lib/avatax/client/advancedrules.rb +5 -5
  10. data/lib/avatax/client/ageverification.rb +60 -1
  11. data/lib/avatax/client/avafileforms.rb +5 -5
  12. data/lib/avatax/client/batches.rb +8 -8
  13. data/lib/avatax/client/certexpressinvites.rb +3 -3
  14. data/lib/avatax/client/certificates.rb +15 -15
  15. data/lib/avatax/client/companies.rb +36 -36
  16. data/lib/avatax/client/compliance.rb +1 -1
  17. data/lib/avatax/client/contacts.rb +6 -6
  18. data/lib/avatax/client/customers.rb +13 -13
  19. data/lib/avatax/client/datasources.rb +9 -9
  20. data/lib/avatax/client/definitions.rb +112 -78
  21. data/lib/avatax/client/distancethresholds.rb +6 -6
  22. data/lib/avatax/client/ecommercetoken.rb +4 -4
  23. data/lib/avatax/client/firmclientlinkages.rb +11 -11
  24. data/lib/avatax/client/free.rb +1 -1
  25. data/lib/avatax/client/fundingrequests.rb +3 -3
  26. data/lib/avatax/client/items.rb +52 -49
  27. data/lib/avatax/client/jurisdictionoverrides.rb +6 -6
  28. data/lib/avatax/client/locations.rb +18 -18
  29. data/lib/avatax/client/multidocument.rb +10 -10
  30. data/lib/avatax/client/nexus.rb +15 -15
  31. data/lib/avatax/client/notices.rb +4 -4
  32. data/lib/avatax/client/notifications.rb +6 -6
  33. data/lib/avatax/client/provisioning.rb +2 -2
  34. data/lib/avatax/client/registrar.rb +32 -10
  35. data/lib/avatax/client/reports.rb +4 -4
  36. data/lib/avatax/client/settings.rb +9 -9
  37. data/lib/avatax/client/shippingverification.rb +4 -4
  38. data/lib/avatax/client/subscriptions.rb +3 -3
  39. data/lib/avatax/client/taxcodes.rb +9 -9
  40. data/lib/avatax/client/taxcontent.rb +16 -12
  41. data/lib/avatax/client/taxrules.rb +42 -6
  42. data/lib/avatax/client/transactions.rb +81 -22
  43. data/lib/avatax/client/upcs.rb +6 -6
  44. data/lib/avatax/client/userdefinedfields.rb +4 -4
  45. data/lib/avatax/client/users.rb +12 -12
  46. data/lib/avatax/client/utilities.rb +3 -3
  47. data/lib/avatax/client.rb +1 -0
  48. data/lib/avatax/configuration.rb +4 -1
  49. data/lib/avatax/connection.rb +17 -12
  50. data/lib/avatax/version.rb +1 -1
  51. data/spec/spec_helper.rb +2 -1
  52. metadata +10 -10
@@ -1,11 +1,11 @@
1
- require 'faraday_middleware'
1
+ require 'faraday'
2
2
 
3
3
  module AvaTax
4
4
 
5
5
  module Connection
6
6
  private
7
- AUTHORIZATION_FILTER_REGEX = /(Authorization\:\ \"Basic\ )(\w+)\=/
8
- REMOVED_LABEL = '\1[REMOVED]'
7
+ AUTHORIZATION_FILTER_REGEX = /(Authorization)([^&]+)/
8
+ REMOVED_LABEL = '\1 [REMOVED]'
9
9
 
10
10
  def connection
11
11
  client_id = "#{app_name};#{app_version};RubySdk;API_VERSION;#{machine_name}"
@@ -26,27 +26,32 @@ module AvaTax
26
26
  bigdecimal_load: :bigdecimal
27
27
  }
28
28
  end
29
+ faraday.request :instrumentation
30
+ if Gem::Version.new(Faraday::VERSION) >= Gem::Version.new('2.0.0')
31
+ # Use the following after upgrading to faraday 2.0
32
+ # see https://github.com/lostisland/faraday/blob/main/docs/middleware/request/authentication.md
33
+ faraday.request :authorization, :basic, username, password
34
+ else
35
+ faraday.request :basic_auth, username, password
36
+ end
29
37
 
30
- faraday.response :json, content_type: /\bjson$/
31
- faraday.request :basic_auth, username, password
32
-
33
- # TODO: use the following after upgrading to faraday 2.0
34
- # see https://github.com/lostisland/faraday/blob/main/docs/middleware/request/authentication.md
35
- # faraday.request :authorization, :basic, username, password
36
-
38
+ default_logger_options = { headers: true, bodies: log_request_and_response_info }
37
39
  if logger
38
- faraday.response :logger do |logger|
40
+ faraday.response :logger, nil, default_logger_options do |logger|
39
41
  logger.filter(AUTHORIZATION_FILTER_REGEX, REMOVED_LABEL)
40
42
  end
41
43
  end
42
44
 
43
45
  if custom_logger
44
- faraday.response :logger, custom_logger, custom_logger_options do |logger|
46
+ faraday.response :logger, custom_logger, default_logger_options.merge(custom_logger_options) do |logger|
45
47
  logger.filter(AUTHORIZATION_FILTER_REGEX, REMOVED_LABEL)
46
48
  end
47
49
  end
48
50
 
49
51
  faraday.adapter Faraday.default_adapter
52
+
53
+ # Use Faraday's built-in response parser
54
+ faraday.response :json, parser_options: { symbolize_names: false }
50
55
  end
51
56
  end
52
57
  end
@@ -1,3 +1,3 @@
1
1
  module AvaTax
2
- VERSION = '22.8.0'.freeze unless defined?(::AvaTax::VERSION)
2
+ VERSION = '23.8.1'.freeze unless defined?(::AvaTax::VERSION)
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require File.expand_path('../../lib/avatax', __FILE__)
2
2
  require 'rspec'
3
+ require 'active_support'
3
4
  require 'yaml'
4
5
 
5
6
 
@@ -16,7 +17,7 @@ AvaTax.configure do |config|
16
17
  end
17
18
  end
18
19
 
19
- client = AvaTax::Client.new()
20
+ client = AvaTax::Client.new({ :logger => true, :log_request_and_response_info => true })
20
21
  companies = client.query_companies
21
22
 
22
23
  RSpec.configure do |config|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avatax
3
3
  version: !ruby/object:Gem::Version
4
- version: 22.8.0
4
+ version: 23.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcus Vorwaller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-30 00:00:00.000000000 Z
11
+ date: 2023-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -67,33 +67,33 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.10'
69
69
  - !ruby/object:Gem::Dependency
70
- name: faraday_middleware
70
+ name: multi_json
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '0.10'
75
+ version: 1.0.3
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '0.10'
82
+ version: 1.0.3
83
83
  - !ruby/object:Gem::Dependency
84
- name: multi_json
84
+ name: activesupport
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 1.0.3
89
+ version: 6.1.7
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 1.0.3
96
+ version: 6.1.7
97
97
  description: A Ruby wrapper for the AvaTax REST and Search APIs
98
98
  email:
99
99
  - marcus.vorwaller@avalara.com
@@ -187,12 +187,12 @@ post_install_message: |
187
187
  AvaTax REST API
188
188
  ------------------------------
189
189
  Our developer site documents the AvaTax REST API.
190
- (http://developer.avatax.com).
190
+ (https://developer.avalara.com).
191
191
  Blog
192
192
  ----------------------------
193
193
  The Developer Blog is a great place to learn more about the API and AvaTax integrations
194
194
  Subscribe to the RSS feed be notified of new posts:
195
- (http://developer.avatax.com/blog).
195
+ (https://developer.avalara.com/blogs).
196
196
 
197
197
  ********************************************************************************
198
198
  rdoc_options: []