codat 0.1.6.2 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +1 -1
- data/.rubocop.yml +9 -1
- data/.ruby-version +1 -1
- data/Gemfile +0 -11
- data/bin/console +1 -1
- data/codat.gemspec +16 -3
- data/lib/codat/camelizer.rb +1 -1
- data/lib/codat/client.rb +8 -4
- data/lib/codat/faraday_codat_auth.rb +2 -0
- data/lib/codat/models/bank_statement_list.rb +1 -1
- data/lib/codat/models/company.rb +1 -1
- data/lib/codat/models/financial_sheet.rb +6 -4
- data/lib/codat/version.rb +1 -1
- metadata +179 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16dc68b012222a1b8437c2c55dd2351218c03702f31923b1cde00642e6dc8bcb
|
4
|
+
data.tar.gz: 576c2812a166a51385ced7c111812d84bacb5c8bfce478266e070e4e10410fd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc87539d13dbd2c15195f89fe68d2112b018a6218eb66c862868de909a2d31482784349b9a01ee32c05548471bf73a0d9998a3a27654c6216c6df888b4cfbdfd
|
7
|
+
data.tar.gz: b425e777bb969794ae73d028d031a1111c9cad724137616a608bcb0094576055374417c5db30f898a73b9483201c7eb7b51f8b38d5549041311402b6eaf64798
|
data/.gitlab-ci.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
require: rubocop-rspec
|
2
2
|
|
3
3
|
AllCops:
|
4
|
-
TargetRubyVersion: 2.
|
4
|
+
TargetRubyVersion: 3.2.0
|
5
|
+
NewCops: enable
|
6
|
+
SuggestExtensions: false
|
7
|
+
|
8
|
+
Gemspec/RequiredRubyVersion:
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
Gemspec/RequireMFA:
|
12
|
+
Enabled: false
|
5
13
|
|
6
14
|
# Don't force top level comments in every class
|
7
15
|
Style/Documentation:
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
3.2.0
|
data/Gemfile
CHANGED
@@ -6,14 +6,3 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
6
6
|
|
7
7
|
# Specify your gem's dependencies in codat.gemspec
|
8
8
|
gemspec
|
9
|
-
|
10
|
-
# Development dependencies
|
11
|
-
gem 'dotenv'
|
12
|
-
gem 'pry-byebug'
|
13
|
-
gem 'rake'
|
14
|
-
gem 'rspec'
|
15
|
-
gem 'rubocop'
|
16
|
-
gem 'rubocop-rspec'
|
17
|
-
gem 'simplecov'
|
18
|
-
gem 'vcr'
|
19
|
-
gem 'webmock'
|
data/bin/console
CHANGED
data/codat.gemspec
CHANGED
@@ -27,7 +27,20 @@ Gem::Specification.new do |spec|
|
|
27
27
|
|
28
28
|
spec.required_ruby_version = '>= 2.5'
|
29
29
|
|
30
|
-
spec.add_dependency 'faraday', '~>
|
31
|
-
spec.add_dependency '
|
32
|
-
spec.add_dependency '
|
30
|
+
spec.add_dependency 'faraday', '~> 1.10'
|
31
|
+
spec.add_dependency 'faraday_middleware', '~> 1.2'
|
32
|
+
spec.add_dependency 'faraday_middleware-multi_json', '~> 0.0.6'
|
33
|
+
spec.add_dependency 'multi_json', '~> 1.15'
|
34
|
+
spec.add_dependency 'rainbow', '~> 3.1'
|
35
|
+
|
36
|
+
spec.add_development_dependency 'bundler'
|
37
|
+
spec.add_development_dependency 'dotenv', '~> 2.5'
|
38
|
+
spec.add_development_dependency 'pry-byebug', '~> 3.6'
|
39
|
+
spec.add_development_dependency 'rake'
|
40
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
41
|
+
spec.add_development_dependency 'rubocop', '~> 1.43'
|
42
|
+
spec.add_development_dependency 'rubocop-rspec'
|
43
|
+
spec.add_development_dependency 'simplecov', '~> 0.16'
|
44
|
+
spec.add_development_dependency 'vcr', '~> 6.1.0'
|
45
|
+
spec.add_development_dependency 'webmock', '~> 3.18.1'
|
33
46
|
end
|
data/lib/codat/camelizer.rb
CHANGED
data/lib/codat/client.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'faraday'
|
4
|
-
require 'multi_json'
|
4
|
+
require 'faraday_middleware/multi_json'
|
5
5
|
require 'codat/faraday_codat_auth'
|
6
6
|
|
7
7
|
module Codat
|
@@ -11,6 +11,10 @@ module Codat
|
|
11
11
|
uat: 'https://api-uat.codat.io/'
|
12
12
|
}.freeze
|
13
13
|
|
14
|
+
def initialize
|
15
|
+
Faraday::Request.register_middleware codat_auth: -> { Codat::FaradayCodatAuth }
|
16
|
+
end
|
17
|
+
|
14
18
|
def get(path, params = {})
|
15
19
|
connection.get(path, params)
|
16
20
|
end
|
@@ -21,8 +25,8 @@ module Codat
|
|
21
25
|
|
22
26
|
def connection
|
23
27
|
@connection ||= Faraday.new(url: api_url) do |conn|
|
24
|
-
conn.
|
25
|
-
conn.response :
|
28
|
+
conn.request :codat_auth, Codat.configuration.api_key
|
29
|
+
conn.response :multi_json, symbolize_keys: true
|
26
30
|
# conn.response :logger # if Codat.configuration.debug?
|
27
31
|
conn.adapter Faraday.default_adapter
|
28
32
|
end
|
@@ -31,7 +35,7 @@ module Codat
|
|
31
35
|
private
|
32
36
|
|
33
37
|
def api_url
|
34
|
-
BASE_URLS
|
38
|
+
BASE_URLS[Codat.configuration.environment.to_sym]
|
35
39
|
end
|
36
40
|
end
|
37
41
|
end
|
data/lib/codat/models/company.rb
CHANGED
@@ -14,6 +14,8 @@ module Codat
|
|
14
14
|
attr_reader :reports
|
15
15
|
|
16
16
|
def self.inherited(other)
|
17
|
+
super
|
18
|
+
|
17
19
|
other.attributes :currency, :most_recent_available_month, :earliest_available_month
|
18
20
|
end
|
19
21
|
|
@@ -28,7 +30,7 @@ module Codat
|
|
28
30
|
#
|
29
31
|
# An ArgumentError is raised unless you provide a :company_id key in the params.
|
30
32
|
def self.find(params = {})
|
31
|
-
company_id = params
|
33
|
+
company_id = params[:company_id]
|
32
34
|
|
33
35
|
raise ArgumentError, 'please provide company_id' unless company_id
|
34
36
|
|
@@ -49,7 +51,7 @@ module Codat
|
|
49
51
|
periodsToCompare: options.fetch(:periods_to_compare, DEFAULT_PERIODS_TO_COMPARE)
|
50
52
|
}
|
51
53
|
|
52
|
-
options = options.
|
54
|
+
options = options.transform_keys { |key| Camelizer.transform(key) }
|
53
55
|
|
54
56
|
query.merge(options)
|
55
57
|
end
|
@@ -69,8 +71,8 @@ module Codat
|
|
69
71
|
def initialize(json: {})
|
70
72
|
super
|
71
73
|
|
72
|
-
@most_recent_available_month = Date.parse(json
|
73
|
-
@earliest_available_month = Date.parse(json
|
74
|
+
@most_recent_available_month = Date.parse(json[:mostRecentAvailableMonth])
|
75
|
+
@earliest_available_month = Date.parse(json[:earliestAvailableMonth])
|
74
76
|
|
75
77
|
reports_json = json.fetch(:reports, {})
|
76
78
|
@reports = reports_json.map { |report| self.class.report_class.new(json: report) }
|
data/lib/codat/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Otero
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,22 +16,78 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.10'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday_middleware
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: faraday_middleware-multi_json
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.0.6
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.0.6
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
56
|
name: multi_json
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.15'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.15'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rainbow
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.1'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: bundler
|
29
85
|
requirement: !ruby/object:Gem::Requirement
|
30
86
|
requirements:
|
31
87
|
- - ">="
|
32
88
|
- !ruby/object:Gem::Version
|
33
89
|
version: '0'
|
34
|
-
type: :
|
90
|
+
type: :development
|
35
91
|
prerelease: false
|
36
92
|
version_requirements: !ruby/object:Gem::Requirement
|
37
93
|
requirements:
|
@@ -39,19 +95,131 @@ dependencies:
|
|
39
95
|
- !ruby/object:Gem::Version
|
40
96
|
version: '0'
|
41
97
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
98
|
+
name: dotenv
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.5'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '2.5'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry-byebug
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '3.6'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '3.6'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rake
|
43
127
|
requirement: !ruby/object:Gem::Requirement
|
44
128
|
requirements:
|
45
129
|
- - ">="
|
46
130
|
- !ruby/object:Gem::Version
|
47
131
|
version: '0'
|
48
|
-
type: :
|
132
|
+
type: :development
|
49
133
|
prerelease: false
|
50
134
|
version_requirements: !ruby/object:Gem::Requirement
|
51
135
|
requirements:
|
52
136
|
- - ">="
|
53
137
|
- !ruby/object:Gem::Version
|
54
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '3.0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '3.0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rubocop
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '1.43'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '1.43'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rubocop-rspec
|
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: simplecov
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0.16'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0.16'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: vcr
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - "~>"
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: 6.1.0
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - "~>"
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: 6.1.0
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: webmock
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - "~>"
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: 3.18.1
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - "~>"
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: 3.18.1
|
55
223
|
description: Codat API wrapper in Ruby
|
56
224
|
email:
|
57
225
|
- oterosantos@gmail.com
|
@@ -96,7 +264,7 @@ homepage: https://gitlab.com/finpoint/codat
|
|
96
264
|
licenses:
|
97
265
|
- MIT
|
98
266
|
metadata: {}
|
99
|
-
post_install_message:
|
267
|
+
post_install_message:
|
100
268
|
rdoc_options: []
|
101
269
|
require_paths:
|
102
270
|
- lib
|
@@ -111,8 +279,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
279
|
- !ruby/object:Gem::Version
|
112
280
|
version: '0'
|
113
281
|
requirements: []
|
114
|
-
rubygems_version: 3.
|
115
|
-
signing_key:
|
282
|
+
rubygems_version: 3.4.1
|
283
|
+
signing_key:
|
116
284
|
specification_version: 4
|
117
285
|
summary: Codat API wrapper in Ruby
|
118
286
|
test_files: []
|