acumatica 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c603f7771ef7434e291c90565af66da2d1496f034b5d5066a2365159f08231b2
4
- data.tar.gz: 59132e4f6f745be823303ef2b62ca62675c3fc8861c134d7a8c1063e6fa52a74
3
+ metadata.gz: 0de9c9c0dd91365116c52a3d0045e2ebc28979c0824ca52f398e6be3f6d70d37
4
+ data.tar.gz: 5e70f9c0d8d9858d1efbba84ce607abd04713ced9c2fc50b97e64c47e094f78d
5
5
  SHA512:
6
- metadata.gz: 798eac48a99d6555da819fc135fcd18dd0f409a844365dbccd4bace7cd6a73783bf01b405b6cc649357a4240aa503c3b8a84ce03660a27927fe5a946f9e3574e
7
- data.tar.gz: e6b26581895b425761bb60711ac4890161f71ec937d5b5a868196b1d252c76d5d0518491c0c6855aa84d2d42509ecf4db4b35e258e766299e9d520671111af79
6
+ metadata.gz: fdfe5bea683dccb841c8d55a62bc1b727640d72385cf3ba0aed2e8ef37ef9d1878f7dd1d4595a1e4c052e4109c01ffb891eee1ff7db0d9a0b145de7b466040c5
7
+ data.tar.gz: f8c0e784db569541ce759bbad3b56f6df10736a6bb7065a3fda2bc7c3413f334618551dc69e2d4d5d970430ee8c213a9ba2e97ec48c386861b202e34e8c64a6d
@@ -20,7 +20,7 @@ jobs:
20
20
  runs-on: ubuntu-latest
21
21
  strategy:
22
22
  matrix:
23
- ruby-version: ['2.7', '3.0', '3.1']
23
+ ruby-version: ['3.0', '3.1', '3.2']
24
24
 
25
25
  steps:
26
26
  - uses: actions/checkout@v3
data/.rubocop.yml CHANGED
@@ -6,14 +6,14 @@ require:
6
6
 
7
7
  AllCops:
8
8
  NewCops: enable
9
- TargetRubyVersion: 2.7
9
+ TargetRubyVersion: 3.0
10
10
 
11
11
  Metrics/BlockLength:
12
12
  Exclude:
13
13
  - acumatica.gemspec
14
14
  - spec/**/*.rb
15
15
 
16
- Metrics/LineLength:
16
+ Layout/LineLength:
17
17
  Max: 100
18
18
 
19
19
  Metrics/MethodLength:
data/Gemfile CHANGED
@@ -6,3 +6,17 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
6
 
7
7
  # Specify your gem's dependencies in acumatica.gemspec
8
8
  gemspec
9
+
10
+ gem 'bundler'
11
+ gem 'byebug'
12
+ gem 'dotenv'
13
+ gem 'guard-rspec'
14
+ gem 'guard-rubocop'
15
+ gem 'rake', '~> 13.0'
16
+ gem 'rspec', '~> 3.12'
17
+ gem 'rubocop', '~> 1.59.0'
18
+ gem 'rubocop-performance', '~> 1.19.0'
19
+ gem 'rubocop-rake', "~> 0.6.0"
20
+ gem 'rubocop-rspec', "~> 2.25.0"
21
+ gem 'vcr'
22
+ gem 'webmock'
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Acumatica
2
2
 
3
- This gem provides a wrapper for the [Acumatica REST API](https://help.acumatica.com/Main?ScreenId=ShowWiki&pageid=ca2716f1-025a-4a6e-9090-797cf32b0459).
3
+ This gem provides a wrapper for the [Acumatica REST API](https://help.acumatica.com/Help?ScreenId=ShowWiki&pageid=ff22837c-cd3a-410e-b768-88ca6e53b165),
4
+ currently targeting API version *20.200.001*
4
5
 
5
6
  ![Gem](https://img.shields.io/gem/v/acumatica.svg)
6
7
  ![Travis](https://img.shields.io/travis/Jetbuilt/acumatica.svg)
@@ -47,7 +48,7 @@ acumatica.session do
47
48
  expand: 'Attributes'
48
49
  )
49
50
  end
50
- ```
51
+ ```
51
52
 
52
53
  ### StockItem
53
54
 
data/acumatica.gemspec CHANGED
@@ -23,21 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ["lib"]
25
25
 
26
- spec.required_ruby_version = '>= 2.7.0'
27
-
28
- spec.add_development_dependency "bundler"
29
- spec.add_development_dependency "byebug"
30
- spec.add_development_dependency "dotenv"
31
- spec.add_development_dependency "guard-rspec"
32
- spec.add_development_dependency "guard-rubocop"
33
- spec.add_development_dependency "rake", "~> 13.0"
34
- spec.add_development_dependency "rspec", "~> 3.12"
35
- spec.add_development_dependency "rubocop", "~> 1.40"
36
- spec.add_development_dependency "rubocop-performance", "~> 1.15.0"
37
- spec.add_development_dependency "rubocop-rake", "~> 0.6.0"
38
- spec.add_development_dependency "rubocop-rspec", "~> 2.15.0"
39
- spec.add_development_dependency "vcr"
40
- spec.add_development_dependency "webmock"
26
+ spec.required_ruby_version = '>= 3.0.0'
41
27
 
42
28
  spec.add_dependency "activesupport"
43
29
  spec.add_dependency "faraday"
@@ -8,7 +8,7 @@ module Acumatica
8
8
  class Client
9
9
  include Singleton
10
10
 
11
- API_VERSION = "6.00.001"
11
+ API_VERSION = "20.200.001"
12
12
 
13
13
  attr_accessor :url, :name, :password, :token, :debug
14
14
 
@@ -5,17 +5,19 @@ require 'faraday'
5
5
  module Acumatica
6
6
  class ErrorHandler < Faraday::Middleware
7
7
  def initialize(app)
8
- super app
8
+ super(app)
9
9
  @parser = nil
10
10
  end
11
11
 
12
12
  def call(request_env)
13
13
  @app.call(request_env).on_complete do |env|
14
14
  case env[:status]
15
- when 400
15
+ when 400, 412, 422
16
16
  raise Acumatica::BadRequest, env
17
- when 401
17
+ when 401, 403
18
18
  raise Acumatica::Unauthorized, env
19
+ when 429
20
+ raise Acumatica::TooManyRequests, env
19
21
  when 500
20
22
  raise Acumatica::InternalServerError, env
21
23
  end
@@ -25,23 +27,23 @@ module Acumatica
25
27
 
26
28
  class Error < StandardError
27
29
  def initialize(env = {})
28
- super error_message(env)
30
+ super(error_message(env))
29
31
  end
30
32
 
31
33
  def error_message(env)
32
- env[:body]["message"]
34
+ env[:body]["error"]
33
35
  end
34
36
  end
35
37
 
36
38
  class BadRequest < Error
37
- def error_message(env)
38
- "#{super(env)}: #{env[:body]['modelState'].values.join(',')}"
39
- end
40
39
  end
41
40
 
42
41
  class Unauthorized < Error
43
42
  end
44
43
 
44
+ class TooManyRequests < Error
45
+ end
46
+
45
47
  class InternalServerError < Error
46
48
  def error_message(env)
47
49
  env[:body]["exceptionMessage"]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Acumatica
4
- VERSION = "0.6.0"
4
+ VERSION = "0.7.0"
5
5
  end
metadata CHANGED
@@ -1,197 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acumatica
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared Moody
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-03 00:00:00.000000000 Z
11
+ date: 2023-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: byebug
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: dotenv
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: guard-rspec
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: guard-rubocop
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: rake
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '13.0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '13.0'
97
- - !ruby/object:Gem::Dependency
98
- name: rspec
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '3.12'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '3.12'
111
- - !ruby/object:Gem::Dependency
112
- name: rubocop
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '1.40'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '1.40'
125
- - !ruby/object:Gem::Dependency
126
- name: rubocop-performance
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: 1.15.0
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: 1.15.0
139
- - !ruby/object:Gem::Dependency
140
- name: rubocop-rake
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: 0.6.0
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: 0.6.0
153
- - !ruby/object:Gem::Dependency
154
- name: rubocop-rspec
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: 2.15.0
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: 2.15.0
167
- - !ruby/object:Gem::Dependency
168
- name: vcr
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- version: '0'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
- - !ruby/object:Gem::Dependency
182
- name: webmock
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - ">="
186
- - !ruby/object:Gem::Version
187
- version: '0'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: '0'
195
13
  - !ruby/object:Gem::Dependency
196
14
  name: activesupport
197
15
  requirement: !ruby/object:Gem::Requirement
@@ -280,14 +98,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
280
98
  requirements:
281
99
  - - ">="
282
100
  - !ruby/object:Gem::Version
283
- version: 2.7.0
101
+ version: 3.0.0
284
102
  required_rubygems_version: !ruby/object:Gem::Requirement
285
103
  requirements:
286
104
  - - ">="
287
105
  - !ruby/object:Gem::Version
288
106
  version: '0'
289
107
  requirements: []
290
- rubygems_version: 3.3.26
108
+ rubygems_version: 3.4.10
291
109
  signing_key:
292
110
  specification_version: 4
293
111
  summary: A wrapper for the acumatica API