ledger_sync-quickbooks_online 0.4.0 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b4c74f346bfa37b73076cd0063d9d54fc72079df70fd5ea513edd043f60ddba
4
- data.tar.gz: 847975f5b2229b34712e03707baa874513e6aa168e47821aa352486f188c5b70
3
+ metadata.gz: a9b599dc734390d6a29043628f3e46bf270213f6e8533ed1584b7967825d0add
4
+ data.tar.gz: 89976aa7ea8821cad8fe9ed6ab7b2b5412b5f115ea8289357b2dc0cd466d1dc9
5
5
  SHA512:
6
- metadata.gz: 6d633f14fe6b9613ea3caa49ec6e5a6a5b6916c05d7dff7fd1a68aa53685f5016d2a0fa68e6d9ea113b7fed8c402dd41ee25c810f557d39c0ce142bdc08d85f8
7
- data.tar.gz: e5f9d7899ff6ce87f53a0f3500392a235bd250a38676878ebb9a61d01474dffe9d6b6e60b2115d1cc2c6df72be45db00ff48ba1610f0ad1ffc763a6ac2eb4dee
6
+ metadata.gz: 506776555cf51c8a418512cf2f8196aa341c9d9bc01c602eefc8e52e56ddc0b6c5c931c0b037c5a8d6705b5be5132e75221e822de0dd671aa1c7a23cc474c3d4
7
+ data.tar.gz: 34afe760f42943c2c7f6e7b345f20b2c014772e609741422e557781d8b908608b50356fa79d162cce7649624b8fa9087e99f315348e974f0ea44d2ec590b5892
@@ -1,13 +1,18 @@
1
1
  name: Test and Deploy
2
- on: [push, pull_request]
2
+ on:
3
+ push:
4
+ pull_request:
5
+ release:
6
+ types: [created]
3
7
  jobs:
4
8
  rubocop:
5
9
  strategy:
6
10
  matrix:
7
- ruby-version: [2.6.3, 2.6.6, 2.7.1]
8
- runs-on: [ubuntu-latest]
11
+ os: [ubuntu-latest]
12
+ ruby-version: ['2.7', '3.0']
13
+ runs-on: ${{ matrix.os }}
9
14
  steps:
10
- - uses: actions/checkout@v2
15
+ - uses: actions/checkout@v3
11
16
  with:
12
17
  persist-credentials: false
13
18
  fetch-depth: 0
@@ -16,14 +21,19 @@ jobs:
16
21
  with:
17
22
  ruby-version: ${{ matrix.ruby-version }}
18
23
  bundler-cache: true
24
+ run: |
25
+ gem install bundler
26
+ bundle update
27
+ bundle install
19
28
  - run: bundle exec rubocop
20
29
  rspec:
21
30
  strategy:
22
31
  matrix:
23
- ruby-version: [2.6.3, 2.6.6, 2.7.1]
24
- runs-on: [ubuntu-latest]
32
+ os: [ubuntu-latest]
33
+ ruby-version: ['2.7', '3.0']
34
+ runs-on: ${{ matrix.os }}
25
35
  steps:
26
- - uses: actions/checkout@v2
36
+ - uses: actions/checkout@v3
27
37
  with:
28
38
  persist-credentials: false
29
39
  fetch-depth: 0
@@ -32,24 +42,32 @@ jobs:
32
42
  with:
33
43
  ruby-version: ${{ matrix.ruby-version }}
34
44
  bundler-cache: true
45
+ run: |
46
+ gem install bundler
47
+ bundle update
48
+ bundle install
35
49
  - name: rspec and report to coveralls
36
- env:
37
- COVERALLS_REPO_TOKEN: ${{ github.event_name == 'push' && secrets.COVERALLS_REPO_TOKEN }}
38
50
  run: bundle exec rspec --order rand
51
+ - name: Coveralls
52
+ uses: coverallsapp/github-action@master
53
+ with:
54
+ github-token: ${{ secrets.GITHUB_TOKEN }}
55
+ parallel: true
56
+ flag-name: run-${{ matrix.ruby-version }}
39
57
  publish:
40
58
  runs-on: ubuntu-latest
41
- needs: ['rubocop', 'rspec']
42
- if: startsWith(github.ref, 'refs/tags/')
59
+ needs: ["rubocop", "rspec"]
60
+ if: github.event_name == 'release' && github.event.action == 'created'
43
61
  steps:
44
62
  - name: Checkout
45
- uses: actions/checkout@v2
63
+ uses: actions/checkout@v3
46
64
  with:
47
65
  persist-credentials: false
48
66
  fetch-depth: 0
49
67
  - name: Ruby Setup and Bundle
50
68
  uses: ruby/setup-ruby@v1
51
69
  with:
52
- ruby-version: 2.6.6
70
+ ruby-version: 2.7.5
53
71
  bundler-cache: true
54
72
  - name: Publish to RubyGems
55
73
  run: |
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ledger_sync-quickbooks_online (0.4.0)
4
+ ledger_sync-quickbooks_online (1.0.0)
5
5
  dotenv
6
6
  ledger_sync (>= 2.0.2)
7
7
  oauth2
@@ -9,108 +9,109 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activemodel (6.1.3.2)
13
- activesupport (= 6.1.3.2)
14
- activesupport (6.1.3.2)
12
+ activemodel (7.0.4.3)
13
+ activesupport (= 7.0.4.3)
14
+ activesupport (7.0.4.3)
15
15
  concurrent-ruby (~> 1.0, >= 1.0.2)
16
16
  i18n (>= 1.6, < 2)
17
17
  minitest (>= 5.1)
18
18
  tzinfo (~> 2.0)
19
- zeitwerk (~> 2.3)
20
- addressable (2.7.0)
21
- public_suffix (>= 2.0.2, < 5.0)
19
+ addressable (2.8.3)
20
+ public_suffix (>= 2.0.2, < 6.0)
22
21
  ast (2.4.2)
23
22
  awesome_print (1.9.2)
24
23
  bump (0.9.0)
25
24
  byebug (11.1.3)
26
- childprocess (4.0.0)
27
- climate_control (1.0.1)
25
+ childprocess (4.1.0)
26
+ climate_control (1.2.0)
28
27
  colorize (0.8.1)
29
- concurrent-ruby (1.1.8)
30
- coveralls (0.8.23)
31
- json (>= 1.8, < 3)
32
- simplecov (~> 0.16.1)
33
- term-ansicolor (~> 1.3)
34
- thor (>= 0.19.4, < 2.0)
35
- tins (~> 1.6)
28
+ concurrent-ruby (1.2.2)
29
+ coveralls_reborn (0.27.0)
30
+ simplecov (~> 0.22.0)
31
+ term-ansicolor (~> 1.7)
32
+ thor (~> 1.2)
33
+ tins (~> 1.32)
36
34
  crack (0.4.5)
37
35
  rexml
38
- diff-lcs (1.4.4)
36
+ diff-lcs (1.5.0)
39
37
  docile (1.4.0)
40
- dotenv (2.7.6)
41
- dry-configurable (0.13.0)
38
+ dotenv (2.8.1)
39
+ dry-configurable (1.0.1)
40
+ dry-core (~> 1.0, < 2)
41
+ zeitwerk (~> 2.6)
42
+ dry-core (1.0.0)
42
43
  concurrent-ruby (~> 1.0)
43
- dry-core (~> 0.6)
44
- dry-container (0.9.0)
44
+ zeitwerk (~> 2.6)
45
+ dry-inflector (1.0.0)
46
+ dry-initializer (3.1.1)
47
+ dry-logic (1.5.0)
45
48
  concurrent-ruby (~> 1.0)
46
- dry-configurable (~> 0.13, >= 0.13.0)
47
- dry-core (0.7.1)
49
+ dry-core (~> 1.0, < 2)
50
+ zeitwerk (~> 2.6)
51
+ dry-schema (1.13.1)
48
52
  concurrent-ruby (~> 1.0)
49
- dry-equalizer (0.3.0)
50
- dry-inflector (0.2.1)
51
- dry-initializer (3.0.4)
52
- dry-logic (1.2.0)
53
- concurrent-ruby (~> 1.0)
54
- dry-core (~> 0.5, >= 0.5)
55
- dry-schema (1.5.6)
56
- concurrent-ruby (~> 1.0)
57
- dry-configurable (~> 0.8, >= 0.8.3)
58
- dry-core (~> 0.4)
59
- dry-equalizer (~> 0.2)
53
+ dry-configurable (~> 1.0, >= 1.0.1)
54
+ dry-core (~> 1.0, < 2)
60
55
  dry-initializer (~> 3.0)
61
- dry-logic (~> 1.0)
62
- dry-types (~> 1.4)
63
- dry-types (1.5.1)
56
+ dry-logic (>= 1.4, < 2)
57
+ dry-types (>= 1.7, < 2)
58
+ zeitwerk (~> 2.6)
59
+ dry-types (1.7.1)
64
60
  concurrent-ruby (~> 1.0)
65
- dry-container (~> 0.3)
66
- dry-core (~> 0.5, >= 0.5)
67
- dry-inflector (~> 0.1, >= 0.1.2)
68
- dry-logic (~> 1.0, >= 1.0.2)
69
- dry-validation (1.5.6)
61
+ dry-core (~> 1.0)
62
+ dry-inflector (~> 1.0)
63
+ dry-logic (~> 1.4)
64
+ zeitwerk (~> 2.6)
65
+ dry-validation (1.10.0)
70
66
  concurrent-ruby (~> 1.0)
71
- dry-container (~> 0.7, >= 0.7.1)
72
- dry-core (~> 0.4)
73
- dry-equalizer (~> 0.2)
67
+ dry-core (~> 1.0, < 2)
74
68
  dry-initializer (~> 3.0)
75
- dry-schema (~> 1.5, >= 1.5.2)
69
+ dry-schema (>= 1.12, < 2)
70
+ zeitwerk (~> 2.6)
76
71
  factory_bot (6.1.0)
77
72
  activesupport (>= 5.0.0)
78
- faraday (1.8.0)
73
+ faraday (1.10.3)
79
74
  faraday-em_http (~> 1.0)
80
75
  faraday-em_synchrony (~> 1.0)
81
76
  faraday-excon (~> 1.1)
82
- faraday-httpclient (~> 1.0.1)
77
+ faraday-httpclient (~> 1.0)
78
+ faraday-multipart (~> 1.0)
83
79
  faraday-net_http (~> 1.0)
84
- faraday-net_http_persistent (~> 1.1)
80
+ faraday-net_http_persistent (~> 1.0)
85
81
  faraday-patron (~> 1.0)
86
82
  faraday-rack (~> 1.0)
87
- multipart-post (>= 1.2, < 3)
83
+ faraday-retry (~> 1.0)
88
84
  ruby2_keywords (>= 0.0.4)
89
- faraday-detailed_logger (2.3.0)
90
- faraday (>= 0.8, < 2)
85
+ faraday-detailed_logger (2.5.0)
86
+ faraday (>= 0.16, < 3)
91
87
  faraday-em_http (1.0.0)
92
88
  faraday-em_synchrony (1.0.0)
93
89
  faraday-excon (1.1.0)
94
90
  faraday-httpclient (1.0.1)
91
+ faraday-multipart (1.0.4)
92
+ multipart-post (~> 2)
95
93
  faraday-net_http (1.0.1)
96
94
  faraday-net_http_persistent (1.2.0)
97
95
  faraday-patron (1.0.0)
98
96
  faraday-rack (1.0.0)
99
- faraday_middleware (1.1.0)
97
+ faraday-retry (1.0.3)
98
+ faraday_middleware (1.2.0)
100
99
  faraday (~> 1.0)
101
100
  fingerprintable (1.2.1)
102
101
  colorize
103
102
  hashdiff (1.0.1)
104
- i18n (1.8.10)
103
+ hashie (5.0.0)
104
+ i18n (1.12.0)
105
105
  concurrent-ruby (~> 1.0)
106
106
  iniparse (1.5.0)
107
- json (2.5.1)
108
- jwt (2.2.3)
109
- ledger_sync (2.2.0)
107
+ ipaddr (1.2.5)
108
+ json (2.6.3)
109
+ jwt (2.7.0)
110
+ ledger_sync (2.5.0)
110
111
  activemodel
111
- colorize
112
- dry-schema (~> 1.5.4)
113
- dry-validation (~> 1.5.6)
112
+ dotenv
113
+ dry-schema
114
+ dry-validation
114
115
  faraday
115
116
  faraday-detailed_logger
116
117
  faraday_middleware
@@ -118,89 +119,97 @@ GEM
118
119
  nokogiri
119
120
  openssl (~> 2.2.0)
120
121
  pd_ruby
121
- rack (~> 2.2.3)
122
+ rack (>= 2.2.3)
123
+ rainbow (~> 3.0)
122
124
  resonad
123
125
  simply_serializable (>= 1.5.1)
124
- mini_portile2 (2.6.1)
125
- minitest (5.14.4)
126
- multi_json (1.15.0)
126
+ mini_portile2 (2.8.1)
127
+ minitest (5.18.0)
127
128
  multi_xml (0.6.0)
128
- multipart-post (2.1.1)
129
- nokogiri (1.12.5)
130
- mini_portile2 (~> 2.6.1)
129
+ multipart-post (2.3.0)
130
+ nokogiri (1.14.3)
131
+ mini_portile2 (~> 2.8.0)
131
132
  racc (~> 1.4)
132
- oauth2 (1.4.7)
133
- faraday (>= 0.8, < 2.0)
133
+ oauth2 (2.0.9)
134
+ faraday (>= 0.17.3, < 3.0)
134
135
  jwt (>= 1.0, < 3.0)
135
- multi_json (~> 1.3)
136
136
  multi_xml (~> 0.5)
137
- rack (>= 1.2, < 3)
138
- openssl (2.2.0)
137
+ rack (>= 1.2, < 4)
138
+ snaky_hash (~> 2.0)
139
+ version_gem (~> 1.1)
140
+ openssl (2.2.3)
141
+ ipaddr
139
142
  overcommit (0.57.0)
140
143
  childprocess (>= 0.6.3, < 5)
141
144
  iniparse (~> 1.4)
142
- parallel (1.20.1)
143
- parser (3.0.1.1)
145
+ parallel (1.22.1)
146
+ parser (3.2.2.0)
144
147
  ast (~> 2.4.1)
145
148
  pd_ruby (0.2.3)
146
149
  colorize
147
- public_suffix (4.0.6)
148
- racc (1.5.2)
149
- rack (2.2.3)
150
- rainbow (3.0.0)
151
- rake (13.0.3)
152
- regexp_parser (2.1.1)
150
+ public_suffix (5.0.1)
151
+ racc (1.6.2)
152
+ rack (3.0.7)
153
+ rainbow (3.1.1)
154
+ rake (13.0.6)
155
+ regexp_parser (2.7.0)
153
156
  resonad (1.4.0)
154
157
  rexml (3.2.5)
155
- rspec (3.10.0)
156
- rspec-core (~> 3.10.0)
157
- rspec-expectations (~> 3.10.0)
158
- rspec-mocks (~> 3.10.0)
159
- rspec-core (3.10.1)
160
- rspec-support (~> 3.10.0)
161
- rspec-expectations (3.10.1)
158
+ rspec (3.12.0)
159
+ rspec-core (~> 3.12.0)
160
+ rspec-expectations (~> 3.12.0)
161
+ rspec-mocks (~> 3.12.0)
162
+ rspec-core (3.12.1)
163
+ rspec-support (~> 3.12.0)
164
+ rspec-expectations (3.12.2)
162
165
  diff-lcs (>= 1.2.0, < 2.0)
163
- rspec-support (~> 3.10.0)
164
- rspec-mocks (3.10.2)
166
+ rspec-support (~> 3.12.0)
167
+ rspec-mocks (3.12.5)
165
168
  diff-lcs (>= 1.2.0, < 2.0)
166
- rspec-support (~> 3.10.0)
167
- rspec-support (3.10.2)
168
- rubocop (1.15.0)
169
+ rspec-support (~> 3.12.0)
170
+ rspec-support (3.12.0)
171
+ rubocop (1.49.0)
172
+ json (~> 2.3)
169
173
  parallel (~> 1.10)
170
- parser (>= 3.0.0.0)
174
+ parser (>= 3.2.0.0)
171
175
  rainbow (>= 2.2.2, < 4.0)
172
176
  regexp_parser (>= 1.8, < 3.0)
173
- rexml
174
- rubocop-ast (>= 1.5.0, < 2.0)
177
+ rexml (>= 3.2.5, < 4.0)
178
+ rubocop-ast (>= 1.28.0, < 2.0)
175
179
  ruby-progressbar (~> 1.7)
176
- unicode-display_width (>= 1.4.0, < 3.0)
177
- rubocop-ast (1.6.0)
178
- parser (>= 3.0.1.1)
179
- ruby-progressbar (1.11.0)
180
+ unicode-display_width (>= 2.4.0, < 3.0)
181
+ rubocop-ast (1.28.0)
182
+ parser (>= 3.2.1.0)
183
+ ruby-progressbar (1.13.0)
180
184
  ruby2_keywords (0.0.5)
181
- simplecov (0.16.1)
185
+ simplecov (0.22.0)
182
186
  docile (~> 1.1)
183
- json (>= 1.8, < 3)
184
- simplecov-html (~> 0.10.0)
185
- simplecov-html (0.10.2)
187
+ simplecov-html (~> 0.11)
188
+ simplecov_json_formatter (~> 0.1)
189
+ simplecov-html (0.12.3)
186
190
  simplecov-lcov (0.8.0)
191
+ simplecov_json_formatter (0.1.4)
187
192
  simply_serializable (1.5.1)
188
193
  fingerprintable (>= 1.2.1)
194
+ snaky_hash (2.0.1)
195
+ hashie
196
+ version_gem (~> 1.1, >= 1.1.1)
189
197
  sync (0.5.0)
190
198
  term-ansicolor (1.7.1)
191
199
  tins (~> 1.0)
192
- thor (1.1.0)
193
- tins (1.29.1)
200
+ thor (1.2.1)
201
+ tins (1.32.1)
194
202
  sync
195
- tzinfo (2.0.4)
203
+ tzinfo (2.0.6)
196
204
  concurrent-ruby (~> 1.0)
197
- unicode-display_width (2.0.0)
198
- vcr (6.0.0)
199
- webmock (3.13.0)
200
- addressable (>= 2.3.6)
205
+ unicode-display_width (2.4.2)
206
+ vcr (6.1.0)
207
+ version_gem (1.1.2)
208
+ webmock (3.18.1)
209
+ addressable (>= 2.8.0)
201
210
  crack (>= 0.3.2)
202
211
  hashdiff (>= 0.4.0, < 2.0.0)
203
- zeitwerk (2.4.2)
212
+ zeitwerk (2.6.7)
204
213
 
205
214
  PLATFORMS
206
215
  ruby
@@ -211,7 +220,7 @@ DEPENDENCIES
211
220
  bundler (~> 2.1)
212
221
  byebug
213
222
  climate_control
214
- coveralls
223
+ coveralls_reborn
215
224
  factory_bot (~> 6.1.0)
216
225
  ledger_sync-quickbooks_online!
217
226
  overcommit (~> 0.57.0)
@@ -223,4 +232,4 @@ DEPENDENCIES
223
232
  webmock
224
233
 
225
234
  BUNDLED WITH
226
- 2.1.4
235
+ 2.3.26
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.required_ruby_version = '>= 2.5.8'
14
14
 
15
15
  spec.summary = 'Sync common objects to accounting software.'
16
- spec.description = 'LedgerSync is a simple library that allows you to sync common objects to popular accounting '\
16
+ spec.description = 'LedgerSync is a simple library that allows you to sync common objects to popular accounting ' \
17
17
  'software like QuickBooks Online, QuickBooksOnline, NetSuite, etc.'
18
18
  spec.homepage = 'https://www.ledgersync.dev'
19
19
 
@@ -29,19 +29,20 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency('awesome_print', '>= 0')
30
30
  spec.add_development_dependency('bump', '~> 0.9.0')
31
31
  spec.add_development_dependency('bundler', '~> 2.1')
32
- spec.add_development_dependency('byebug')
33
- spec.add_development_dependency('climate_control')
34
- spec.add_development_dependency('coveralls')
32
+ spec.add_development_dependency('byebug', '>= 0')
33
+ spec.add_development_dependency('climate_control', '>= 0')
34
+ spec.add_development_dependency('coveralls_reborn', '>= 0')
35
35
  spec.add_development_dependency('factory_bot', '~> 6.1.0')
36
36
  spec.add_development_dependency('overcommit', '~> 0.57.0')
37
37
  spec.add_development_dependency('rake', '~> 13.0')
38
38
  spec.add_development_dependency('rspec', '~> 3.2')
39
39
  spec.add_development_dependency('rubocop', '>= 0')
40
- spec.add_development_dependency('simplecov-lcov')
40
+ spec.add_development_dependency('simplecov-lcov', '>= 0')
41
41
  spec.add_development_dependency('vcr', '>= 0')
42
42
  spec.add_development_dependency('webmock', '>= 0')
43
43
  spec.add_runtime_dependency('dotenv')
44
44
  spec.add_runtime_dependency('ledger_sync', '>= 2.0.2')
45
45
  # spec.add_runtime_dependency('nokogiri', '>= 0')
46
46
  spec.add_runtime_dependency('oauth2', '>= 0')
47
+ spec.metadata['rubygems_mfa_required'] = 'true'
47
48
  end
@@ -28,26 +28,16 @@ module LedgerSync
28
28
  :test,
29
29
  :update_dotenv
30
30
 
31
- def initialize(
32
- access_token:,
33
- client_id:,
34
- client_secret:,
35
- realm_id:,
36
- refresh_token:,
37
- expires_at: nil,
38
- refresh_token_expires_at: nil,
39
- test: false,
40
- update_dotenv: true
41
- )
42
- @access_token = access_token
43
- @client_id = client_id
44
- @client_secret = client_secret
45
- @realm_id = realm_id
46
- @refresh_token = refresh_token
47
- @expires_at = expires_at
48
- @refresh_token_expires_at = refresh_token_expires_at
49
- @test = test
50
- @update_dotenv = update_dotenv
31
+ def initialize(args = {})
32
+ @access_token = args.fetch(:access_token)
33
+ @client_id = args.fetch(:client_id)
34
+ @client_secret = args.fetch(:client_secret)
35
+ @realm_id = args.fetch(:realm_id)
36
+ @refresh_token = args.fetch(:refresh_token)
37
+ @expires_at = args.fetch(:expires_at, nil)
38
+ @refresh_token_expires_at = args.fetch(:refresh_token_expires_at, nil)
39
+ @test = args.fetch(:test, false)
40
+ @update_dotenv = args.fetch(:update_dotenv, true)
51
41
 
52
42
  @previous_access_tokens = []
53
43
  @previous_refresh_tokens = []
@@ -59,8 +49,8 @@ module LedgerSync
59
49
  super()
60
50
  end
61
51
 
62
- def authorization_url(redirect_uri:)
63
- oauth_client.authorization_url(redirect_uri: redirect_uri)
52
+ def authorization_url(redirect_uri:, state: SecureRandom.hex(12))
53
+ oauth_client.authorization_url(redirect_uri: redirect_uri, state: state)
64
54
  end
65
55
 
66
56
  def find(path:)
@@ -103,7 +93,7 @@ module LedgerSync
103
93
  ledger_resource_type = self.class.ledger_resource_type_for(
104
94
  resource_class: resource_class
105
95
  ).classify
106
- full_query = "SELECT * FROM #{ledger_resource_type} WHERE #{query} STARTPOSITION #{offset} MAXRESULTS "\
96
+ full_query = "SELECT * FROM #{ledger_resource_type} WHERE #{query} STARTPOSITION #{offset} MAXRESULTS " \
107
97
  "#{limit}"
108
98
  url = "#{oauth_base_uri}/query?query=#{CGI.escape(full_query)}"
109
99
 
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative '../reference/deserializer'
4
+
3
5
  module LedgerSync
4
6
  module QuickBooksOnline
5
7
  class Department
@@ -50,11 +50,11 @@ module LedgerSync
50
50
  @client_secret = client_secret
51
51
  end
52
52
 
53
- def authorization_url(redirect_uri:)
53
+ def authorization_url(redirect_uri:, state: SecureRandom.hex(12))
54
54
  client.auth_code.authorize_url(
55
55
  redirect_uri: redirect_uri,
56
56
  response_type: 'code',
57
- state: SecureRandom.hex(12),
57
+ state: state,
58
58
  scope: 'com.intuit.quickbooks.accounting'
59
59
  )
60
60
  end
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'department'
4
-
5
3
  module LedgerSync
6
4
  module QuickBooksOnline
7
5
  class Department < QuickBooksOnline::Resource
@@ -5,7 +5,8 @@ module LedgerSync
5
5
  module Serialization
6
6
  module Type
7
7
  class DeserializeTransactionReferenceType < LedgerSync::Type::Value
8
- def cast_value(value:)
8
+ def cast_value(args = {})
9
+ value = args.fetch(:value)
9
10
  return if value.nil?
10
11
 
11
12
  raise "Unknown value type. Array expected. Given: #{value.class.name}" unless value.is_a?(Array)
@@ -5,9 +5,12 @@ module LedgerSync
5
5
  module Serialization
6
6
  module Type
7
7
  class SerializeTransactionReferenceType < LedgerSync::Type::Value
8
- def cast_value(value:)
8
+ def cast_value(args = {})
9
+ value = args.fetch(:value)
9
10
  return if value.nil?
11
+
10
12
  raise "List expected. Given: #{value.class.name}" unless value.is_a?(Array)
13
+
11
14
  unless value.all?(LedgerSync::Resource)
12
15
  raise "Resources expected. Given: #{value.map { |i| i.class.name }.join(', ')}"
13
16
  end
@@ -3,7 +3,7 @@
3
3
  # :nocov:
4
4
  module LedgerSync
5
5
  module QuickBooksOnline
6
- VERSION = '0.4.0'
6
+ VERSION = '1.0.0'
7
7
 
8
8
  def self.version(args = {})
9
9
  pre = args.fetch(:pre, false)
@@ -11,7 +11,7 @@ module LedgerSync
11
11
  if !pre && (!ENV['TRAVIS'] || ENV.fetch('TRAVIS_TAG', '') != '')
12
12
  VERSION
13
13
  else
14
- "#{VERSION}.pre.#{ENV['TRAVIS_BUILD_NUMBER']}"
14
+ "#{VERSION}.pre.#{ENV.fetch('TRAVIS_BUILD_NUMBER', nil)}"
15
15
  end
16
16
  end
17
17
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ledger_sync-quickbooks_online
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Modern Treasury
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-30 00:00:00.000000000 Z
11
+ date: 2023-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: coveralls
84
+ name: coveralls_reborn
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -447,8 +447,9 @@ files:
447
447
  - license.txt
448
448
  homepage: https://www.ledgersync.dev
449
449
  licenses: []
450
- metadata: {}
451
- post_install_message:
450
+ metadata:
451
+ rubygems_mfa_required: 'true'
452
+ post_install_message:
452
453
  rdoc_options: []
453
454
  require_paths:
454
455
  - lib
@@ -463,8 +464,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
463
464
  - !ruby/object:Gem::Version
464
465
  version: '0'
465
466
  requirements: []
466
- rubygems_version: 3.0.3
467
- signing_key:
467
+ rubygems_version: 3.1.6
468
+ signing_key:
468
469
  specification_version: 4
469
470
  summary: Sync common objects to accounting software.
470
471
  test_files: []