ledger_sync-quickbooks_online 1.0.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/gem-workflow.yml +3 -3
- data/.rubocop.yml +7 -1
- data/Gemfile.lock +100 -77
- data/bin/quickbooks_online_oauth_server.rb +1 -1
- data/ledger_sync-quickbooks_online.gemspec +4 -4
- data/lib/ledger_sync/quickbooks_online/client.rb +4 -4
- data/lib/ledger_sync/quickbooks_online/deserializer.rb +2 -2
- data/lib/ledger_sync/quickbooks_online/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c22111ca6de99e11d6a8da8f642701b28e671a3ab182b67130fed7c7112a45f5
|
4
|
+
data.tar.gz: cad024962a864609ec6012ac37aef5f163fe133b1bba9e9fb081ebfd27ba9299
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 814c2c440e61c2dc42f123682c502c7970f0fe313ed74669d73222c9e875c5db95f0192243b8e787df2686718bf12538128d1eecd77240306536664897a317f7
|
7
|
+
data.tar.gz: 5c997be7f135f690222d1254e1f44e5884412dddad469a285a6de6fa9e24267208a10f558f1505037b415ae186dd7c464ae95fab8059257689f7cc3e11d1a526
|
@@ -9,7 +9,7 @@ jobs:
|
|
9
9
|
strategy:
|
10
10
|
matrix:
|
11
11
|
os: [ubuntu-latest]
|
12
|
-
ruby-version: ['2.
|
12
|
+
ruby-version: ['3.1.6', '3.2.6', '3.3.6']
|
13
13
|
runs-on: ${{ matrix.os }}
|
14
14
|
steps:
|
15
15
|
- uses: actions/checkout@v3
|
@@ -30,7 +30,7 @@ jobs:
|
|
30
30
|
strategy:
|
31
31
|
matrix:
|
32
32
|
os: [ubuntu-latest]
|
33
|
-
ruby-version: ['2.
|
33
|
+
ruby-version: ['3.1.6', '3.2.6', '3.3.6']
|
34
34
|
runs-on: ${{ matrix.os }}
|
35
35
|
steps:
|
36
36
|
- uses: actions/checkout@v3
|
@@ -67,7 +67,7 @@ jobs:
|
|
67
67
|
- name: Ruby Setup and Bundle
|
68
68
|
uses: ruby/setup-ruby@v1
|
69
69
|
with:
|
70
|
-
ruby-version:
|
70
|
+
ruby-version: 3.1.6
|
71
71
|
bundler-cache: true
|
72
72
|
- name: Publish to RubyGems
|
73
73
|
run: |
|
data/.rubocop.yml
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
2
|
|
3
3
|
AllCops:
|
4
|
-
TargetRubyVersion:
|
4
|
+
TargetRubyVersion: 3.1
|
5
5
|
NewCops: enable
|
6
6
|
|
7
|
+
Gemspec/DevelopmentDependencies:
|
8
|
+
Enabled: False
|
9
|
+
|
7
10
|
Layout/LineLength:
|
8
11
|
Enabled: True
|
9
12
|
Max: 120
|
@@ -38,6 +41,9 @@ Lint/RaiseException:
|
|
38
41
|
Lint/StructNewOverride:
|
39
42
|
Enabled: True
|
40
43
|
|
44
|
+
Naming/VariableNumber:
|
45
|
+
Enabled: False
|
46
|
+
|
41
47
|
Style/AccessorGrouping:
|
42
48
|
Enabled: True
|
43
49
|
|
data/Gemfile.lock
CHANGED
@@ -1,54 +1,68 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ledger_sync-quickbooks_online (
|
4
|
+
ledger_sync-quickbooks_online (2.0.0)
|
5
5
|
dotenv
|
6
|
-
ledger_sync (>=
|
6
|
+
ledger_sync (>= 3.0, <= 4.0)
|
7
7
|
oauth2
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activemodel (7.
|
13
|
-
activesupport (= 7.
|
14
|
-
activesupport (7.
|
15
|
-
|
12
|
+
activemodel (7.2.2.1)
|
13
|
+
activesupport (= 7.2.2.1)
|
14
|
+
activesupport (7.2.2.1)
|
15
|
+
base64
|
16
|
+
benchmark (>= 0.3)
|
17
|
+
bigdecimal
|
18
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
19
|
+
connection_pool (>= 2.2.5)
|
20
|
+
drb
|
16
21
|
i18n (>= 1.6, < 2)
|
22
|
+
logger (>= 1.4.2)
|
17
23
|
minitest (>= 5.1)
|
18
|
-
|
19
|
-
|
20
|
-
|
24
|
+
securerandom (>= 0.3)
|
25
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
26
|
+
addressable (2.8.7)
|
27
|
+
public_suffix (>= 2.0.2, < 7.0)
|
21
28
|
ast (2.4.2)
|
22
29
|
awesome_print (1.9.2)
|
30
|
+
base64 (0.2.0)
|
31
|
+
benchmark (0.4.0)
|
32
|
+
bigdecimal (3.1.9)
|
23
33
|
bump (0.9.0)
|
24
34
|
byebug (11.1.3)
|
25
35
|
childprocess (4.1.0)
|
26
36
|
climate_control (1.2.0)
|
27
|
-
colorize (
|
28
|
-
concurrent-ruby (1.
|
29
|
-
|
37
|
+
colorize (1.1.0)
|
38
|
+
concurrent-ruby (1.3.4)
|
39
|
+
connection_pool (2.4.1)
|
40
|
+
coveralls_reborn (0.28.0)
|
30
41
|
simplecov (~> 0.22.0)
|
31
42
|
term-ansicolor (~> 1.7)
|
32
43
|
thor (~> 1.2)
|
33
44
|
tins (~> 1.32)
|
34
|
-
crack (0.
|
45
|
+
crack (1.0.0)
|
46
|
+
bigdecimal
|
35
47
|
rexml
|
36
|
-
diff-lcs (1.5.
|
37
|
-
docile (1.4.
|
38
|
-
dotenv (
|
39
|
-
|
48
|
+
diff-lcs (1.5.1)
|
49
|
+
docile (1.4.1)
|
50
|
+
dotenv (3.1.7)
|
51
|
+
drb (2.2.1)
|
52
|
+
dry-configurable (1.2.0)
|
40
53
|
dry-core (~> 1.0, < 2)
|
41
54
|
zeitwerk (~> 2.6)
|
42
|
-
dry-core (1.0.
|
55
|
+
dry-core (1.0.2)
|
43
56
|
concurrent-ruby (~> 1.0)
|
57
|
+
logger
|
44
58
|
zeitwerk (~> 2.6)
|
45
|
-
dry-inflector (1.
|
59
|
+
dry-inflector (1.1.0)
|
46
60
|
dry-initializer (3.1.1)
|
47
61
|
dry-logic (1.5.0)
|
48
62
|
concurrent-ruby (~> 1.0)
|
49
63
|
dry-core (~> 1.0, < 2)
|
50
64
|
zeitwerk (~> 2.6)
|
51
|
-
dry-schema (1.13.
|
65
|
+
dry-schema (1.13.4)
|
52
66
|
concurrent-ruby (~> 1.0)
|
53
67
|
dry-configurable (~> 1.0, >= 1.0.1)
|
54
68
|
dry-core (~> 1.0, < 2)
|
@@ -56,7 +70,8 @@ GEM
|
|
56
70
|
dry-logic (>= 1.4, < 2)
|
57
71
|
dry-types (>= 1.7, < 2)
|
58
72
|
zeitwerk (~> 2.6)
|
59
|
-
dry-types (1.7.
|
73
|
+
dry-types (1.7.2)
|
74
|
+
bigdecimal (~> 3.0)
|
60
75
|
concurrent-ruby (~> 1.0)
|
61
76
|
dry-core (~> 1.0)
|
62
77
|
dry-inflector (~> 1.0)
|
@@ -70,7 +85,7 @@ GEM
|
|
70
85
|
zeitwerk (~> 2.6)
|
71
86
|
factory_bot (6.1.0)
|
72
87
|
activesupport (>= 5.0.0)
|
73
|
-
faraday (1.10.
|
88
|
+
faraday (1.10.4)
|
74
89
|
faraday-em_http (~> 1.0)
|
75
90
|
faraday-em_synchrony (~> 1.0)
|
76
91
|
faraday-excon (~> 1.1)
|
@@ -88,26 +103,27 @@ GEM
|
|
88
103
|
faraday-em_synchrony (1.0.0)
|
89
104
|
faraday-excon (1.1.0)
|
90
105
|
faraday-httpclient (1.0.1)
|
91
|
-
faraday-multipart (1.0
|
92
|
-
multipart-post (~> 2)
|
93
|
-
faraday-net_http (1.0.
|
106
|
+
faraday-multipart (1.1.0)
|
107
|
+
multipart-post (~> 2.0)
|
108
|
+
faraday-net_http (1.0.2)
|
94
109
|
faraday-net_http_persistent (1.2.0)
|
95
110
|
faraday-patron (1.0.0)
|
96
111
|
faraday-rack (1.0.0)
|
97
112
|
faraday-retry (1.0.3)
|
98
|
-
faraday_middleware (1.2.
|
113
|
+
faraday_middleware (1.2.1)
|
99
114
|
faraday (~> 1.0)
|
100
115
|
fingerprintable (1.2.1)
|
101
116
|
colorize
|
102
|
-
hashdiff (1.
|
117
|
+
hashdiff (1.1.2)
|
103
118
|
hashie (5.0.0)
|
104
|
-
i18n (1.
|
119
|
+
i18n (1.14.6)
|
105
120
|
concurrent-ruby (~> 1.0)
|
106
121
|
iniparse (1.5.0)
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
122
|
+
json (2.9.1)
|
123
|
+
jwt (2.10.1)
|
124
|
+
base64
|
125
|
+
language_server-protocol (3.17.0.3)
|
126
|
+
ledger_sync (3.0.0)
|
111
127
|
activemodel
|
112
128
|
dotenv
|
113
129
|
dry-schema
|
@@ -117,18 +133,20 @@ GEM
|
|
117
133
|
faraday_middleware
|
118
134
|
fingerprintable (>= 1.2.1)
|
119
135
|
nokogiri
|
120
|
-
openssl (
|
136
|
+
openssl (> 2.2.0)
|
121
137
|
pd_ruby
|
122
138
|
rack (>= 2.2.3)
|
123
139
|
rainbow (~> 3.0)
|
124
140
|
resonad
|
125
141
|
simply_serializable (>= 1.5.1)
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
142
|
+
logger (1.6.4)
|
143
|
+
mini_portile2 (2.8.8)
|
144
|
+
minitest (5.25.4)
|
145
|
+
multi_xml (0.7.1)
|
146
|
+
bigdecimal (~> 3.1)
|
147
|
+
multipart-post (2.4.1)
|
148
|
+
nokogiri (1.18.0)
|
149
|
+
mini_portile2 (~> 2.8.2)
|
132
150
|
racc (~> 1.4)
|
133
151
|
oauth2 (2.0.9)
|
134
152
|
faraday (>= 0.17.3, < 3.0)
|
@@ -137,56 +155,57 @@ GEM
|
|
137
155
|
rack (>= 1.2, < 4)
|
138
156
|
snaky_hash (~> 2.0)
|
139
157
|
version_gem (~> 1.1)
|
140
|
-
openssl (
|
141
|
-
ipaddr
|
158
|
+
openssl (3.3.0)
|
142
159
|
overcommit (0.57.0)
|
143
160
|
childprocess (>= 0.6.3, < 5)
|
144
161
|
iniparse (~> 1.4)
|
145
|
-
parallel (1.
|
146
|
-
parser (3.
|
162
|
+
parallel (1.26.3)
|
163
|
+
parser (3.3.6.0)
|
147
164
|
ast (~> 2.4.1)
|
165
|
+
racc
|
148
166
|
pd_ruby (0.2.3)
|
149
167
|
colorize
|
150
|
-
public_suffix (
|
151
|
-
racc (1.
|
152
|
-
rack (3.
|
168
|
+
public_suffix (6.0.1)
|
169
|
+
racc (1.8.1)
|
170
|
+
rack (3.1.8)
|
153
171
|
rainbow (3.1.1)
|
154
|
-
rake (13.
|
155
|
-
regexp_parser (2.
|
172
|
+
rake (13.2.1)
|
173
|
+
regexp_parser (2.10.0)
|
156
174
|
resonad (1.4.0)
|
157
|
-
rexml (3.
|
158
|
-
rspec (3.
|
159
|
-
rspec-core (~> 3.
|
160
|
-
rspec-expectations (~> 3.
|
161
|
-
rspec-mocks (~> 3.
|
162
|
-
rspec-core (3.
|
163
|
-
rspec-support (~> 3.
|
164
|
-
rspec-expectations (3.
|
175
|
+
rexml (3.4.0)
|
176
|
+
rspec (3.13.0)
|
177
|
+
rspec-core (~> 3.13.0)
|
178
|
+
rspec-expectations (~> 3.13.0)
|
179
|
+
rspec-mocks (~> 3.13.0)
|
180
|
+
rspec-core (3.13.2)
|
181
|
+
rspec-support (~> 3.13.0)
|
182
|
+
rspec-expectations (3.13.3)
|
165
183
|
diff-lcs (>= 1.2.0, < 2.0)
|
166
|
-
rspec-support (~> 3.
|
167
|
-
rspec-mocks (3.
|
184
|
+
rspec-support (~> 3.13.0)
|
185
|
+
rspec-mocks (3.13.2)
|
168
186
|
diff-lcs (>= 1.2.0, < 2.0)
|
169
|
-
rspec-support (~> 3.
|
170
|
-
rspec-support (3.
|
171
|
-
rubocop (1.
|
187
|
+
rspec-support (~> 3.13.0)
|
188
|
+
rspec-support (3.13.2)
|
189
|
+
rubocop (1.69.2)
|
172
190
|
json (~> 2.3)
|
191
|
+
language_server-protocol (>= 3.17.0)
|
173
192
|
parallel (~> 1.10)
|
174
|
-
parser (>= 3.
|
193
|
+
parser (>= 3.3.0.2)
|
175
194
|
rainbow (>= 2.2.2, < 4.0)
|
176
|
-
regexp_parser (>=
|
177
|
-
|
178
|
-
rubocop-ast (>= 1.28.0, < 2.0)
|
195
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
196
|
+
rubocop-ast (>= 1.36.2, < 2.0)
|
179
197
|
ruby-progressbar (~> 1.7)
|
180
|
-
unicode-display_width (>= 2.4.0, <
|
181
|
-
rubocop-ast (1.
|
182
|
-
parser (>= 3.
|
198
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
199
|
+
rubocop-ast (1.37.0)
|
200
|
+
parser (>= 3.3.1.0)
|
183
201
|
ruby-progressbar (1.13.0)
|
184
202
|
ruby2_keywords (0.0.5)
|
203
|
+
securerandom (0.4.1)
|
185
204
|
simplecov (0.22.0)
|
186
205
|
docile (~> 1.1)
|
187
206
|
simplecov-html (~> 0.11)
|
188
207
|
simplecov_json_formatter (~> 0.1)
|
189
|
-
simplecov-html (0.
|
208
|
+
simplecov-html (0.13.1)
|
190
209
|
simplecov-lcov (0.8.0)
|
191
210
|
simplecov_json_formatter (0.1.4)
|
192
211
|
simply_serializable (1.5.1)
|
@@ -195,21 +214,25 @@ GEM
|
|
195
214
|
hashie
|
196
215
|
version_gem (~> 1.1, >= 1.1.1)
|
197
216
|
sync (0.5.0)
|
198
|
-
term-ansicolor (1.
|
217
|
+
term-ansicolor (1.11.2)
|
199
218
|
tins (~> 1.0)
|
200
|
-
thor (1.2
|
201
|
-
tins (1.
|
219
|
+
thor (1.3.2)
|
220
|
+
tins (1.37.1)
|
221
|
+
bigdecimal
|
202
222
|
sync
|
203
223
|
tzinfo (2.0.6)
|
204
224
|
concurrent-ruby (~> 1.0)
|
205
|
-
unicode-display_width (
|
206
|
-
|
207
|
-
|
208
|
-
|
225
|
+
unicode-display_width (3.1.3)
|
226
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
227
|
+
unicode-emoji (4.0.4)
|
228
|
+
vcr (6.3.1)
|
229
|
+
base64
|
230
|
+
version_gem (1.1.4)
|
231
|
+
webmock (3.24.0)
|
209
232
|
addressable (>= 2.8.0)
|
210
233
|
crack (>= 0.3.2)
|
211
234
|
hashdiff (>= 0.4.0, < 2.0.0)
|
212
|
-
zeitwerk (2.6.
|
235
|
+
zeitwerk (2.6.18)
|
213
236
|
|
214
237
|
PLATFORMS
|
215
238
|
ruby
|
@@ -54,7 +54,7 @@ while (session = server.accept) # rubocop:disable Lint/UnreachableLoop
|
|
54
54
|
# 2
|
55
55
|
_path, query = full_path.split('?')
|
56
56
|
|
57
|
-
params = query.split('&').
|
57
|
+
params = query.split('&').to_h { |e| e.split('=') } if query.present?
|
58
58
|
|
59
59
|
client.set_credentials_from_oauth_code(
|
60
60
|
code: params.fetch('code'),
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.authors = ['Modern Treasury']
|
11
11
|
spec.email = ['ledgersync@moderntreasury.com']
|
12
12
|
|
13
|
-
spec.required_ruby_version = '>=
|
13
|
+
spec.required_ruby_version = '>= 3.1.6'
|
14
14
|
|
15
15
|
spec.summary = 'Sync common objects to accounting software.'
|
16
16
|
spec.description = 'LedgerSync is a simple library that allows you to sync common objects to popular accounting ' \
|
@@ -40,9 +40,9 @@ Gem::Specification.new do |spec|
|
|
40
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
|
-
spec.
|
44
|
-
spec.
|
43
|
+
spec.add_dependency('dotenv')
|
44
|
+
spec.add_dependency('ledger_sync', '>= 3.0', '<= 4.0')
|
45
45
|
# spec.add_runtime_dependency('nokogiri', '>= 0')
|
46
|
-
spec.
|
46
|
+
spec.add_dependency('oauth2', '>= 0')
|
47
47
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
48
48
|
end
|
@@ -206,15 +206,15 @@ module LedgerSync
|
|
206
206
|
).perform
|
207
207
|
end
|
208
208
|
|
209
|
-
def set_credentials_from_oauth_token(token:, realm_id: nil)
|
209
|
+
def set_credentials_from_oauth_token(token:, realm_id: nil)
|
210
210
|
@previous_access_tokens << access_token if access_token.present?
|
211
211
|
@access_token = token.token
|
212
212
|
|
213
|
-
@expires_at = Time
|
213
|
+
@expires_at = Time.at(token.expires_at.to_i).to_datetime
|
214
214
|
unless token.params['x_refresh_token_expires_in'].nil?
|
215
|
-
@refresh_token_expires_at = Time
|
215
|
+
@refresh_token_expires_at = Time.at(
|
216
216
|
Time.now.to_i + token.params['x_refresh_token_expires_in']
|
217
|
-
)
|
217
|
+
).to_datetime
|
218
218
|
end
|
219
219
|
|
220
220
|
@previous_refresh_tokens << refresh_token if refresh_token.present?
|
@@ -36,7 +36,7 @@ module LedgerSync
|
|
36
36
|
resource = args.fetch(:resource)
|
37
37
|
merged_resource = resource.dup
|
38
38
|
|
39
|
-
self.class.attributes.
|
39
|
+
self.class.attributes.each_value do |deserializer_attribute|
|
40
40
|
next unless deserializer_attribute.references_many?
|
41
41
|
|
42
42
|
resources_from_ledger = attribute_value_from_ledger(
|
@@ -45,7 +45,7 @@ module LedgerSync
|
|
45
45
|
resource: merged_resource
|
46
46
|
)
|
47
47
|
|
48
|
-
resource_hash_from_ledger = resources_from_ledger.
|
48
|
+
resource_hash_from_ledger = resources_from_ledger.to_h { |e| [e.ledger_id, e] }
|
49
49
|
|
50
50
|
# Using original resource since it is overwritten by keyword arg
|
51
51
|
merged_value = resource.send(deserializer_attribute.resource_attribute_dot_parts.first).map do |referenced|
|
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:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Modern Treasury
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -226,20 +226,20 @@ dependencies:
|
|
226
226
|
requirements:
|
227
227
|
- - ">="
|
228
228
|
- !ruby/object:Gem::Version
|
229
|
-
version:
|
229
|
+
version: '3.0'
|
230
230
|
- - "<="
|
231
231
|
- !ruby/object:Gem::Version
|
232
|
-
version: '
|
232
|
+
version: '4.0'
|
233
233
|
type: :runtime
|
234
234
|
prerelease: false
|
235
235
|
version_requirements: !ruby/object:Gem::Requirement
|
236
236
|
requirements:
|
237
237
|
- - ">="
|
238
238
|
- !ruby/object:Gem::Version
|
239
|
-
version:
|
239
|
+
version: '3.0'
|
240
240
|
- - "<="
|
241
241
|
- !ruby/object:Gem::Version
|
242
|
-
version: '
|
242
|
+
version: '4.0'
|
243
243
|
- !ruby/object:Gem::Dependency
|
244
244
|
name: oauth2
|
245
245
|
requirement: !ruby/object:Gem::Requirement
|
@@ -464,14 +464,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
464
464
|
requirements:
|
465
465
|
- - ">="
|
466
466
|
- !ruby/object:Gem::Version
|
467
|
-
version:
|
467
|
+
version: 3.1.6
|
468
468
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
469
469
|
requirements:
|
470
470
|
- - ">="
|
471
471
|
- !ruby/object:Gem::Version
|
472
472
|
version: '0'
|
473
473
|
requirements: []
|
474
|
-
rubygems_version: 3.
|
474
|
+
rubygems_version: 3.3.27
|
475
475
|
signing_key:
|
476
476
|
specification_version: 4
|
477
477
|
summary: Sync common objects to accounting software.
|