belvo 0.19.2 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/generate-docs.yml +26 -0
- data/.rubocop.yml +3 -0
- data/Gemfile +0 -11
- data/Gemfile.lock +60 -42
- data/README.md +6 -2
- data/lib/belvo/http.rb +6 -14
- data/lib/belvo/resources.rb +3 -4
- data/lib/belvo/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8ddc3b560df375b13cdfba4173c362979192231a40cc3c248bd3436f6c19790
|
4
|
+
data.tar.gz: a8a03709a98a0b0a1d59f57255a45e14631684199b1ebf1c5844d56da66b3860
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21f0eff9a499c6d7de8aa2b730224853eee43abdc91ac2e8a1cd3e700e3238f6c969f5fa75f3b129405d437123c65e2dd1ffac9bcabad01f6140790adbd67d58
|
7
|
+
data.tar.gz: 8aa63d37ed8b551b83483b0cd1ca08f9c72b477ee45781ad6a0baceb81c1be03adb689aa1fbc1105e299ead79f8b814e6d5676753fcf26deae2efc8563ed8299
|
@@ -0,0 +1,26 @@
|
|
1
|
+
name: Build & deploy Ruby SDK documentation
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- master
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
name: Update gh-pages with docs
|
10
|
+
steps:
|
11
|
+
- name: Checkout Belvo Ruby SDK repo
|
12
|
+
uses: actions/checkout@v2
|
13
|
+
- name: Set up Ruby
|
14
|
+
uses: actions/setup-ruby@v1
|
15
|
+
with:
|
16
|
+
ruby-version: "2.7"
|
17
|
+
- name: Install required gem dependencies
|
18
|
+
run: gem install yard --no-document
|
19
|
+
- name: Build RUBY SDK docs with YARD
|
20
|
+
run: yardoc --output-dir docs
|
21
|
+
- name: Deploy docs to gh-pages branch
|
22
|
+
uses: peaceiris/actions-gh-pages@v3
|
23
|
+
with:
|
24
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
25
|
+
publish_dir: ./docs
|
26
|
+
publish_branch: gh-pages
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# rubocop:disable all
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
3
|
source 'https://rubygems.org'
|
@@ -6,14 +5,4 @@ source 'https://rubygems.org'
|
|
6
5
|
# Specify your gem's dependencies in belvo.gemspec
|
7
6
|
gemspec
|
8
7
|
|
9
|
-
gem 'coveralls_reborn', require: false
|
10
|
-
gem 'faraday'
|
11
|
-
gem 'faraday_middleware'
|
12
|
-
gem 'rake', '~> 12.0'
|
13
|
-
gem 'rspec', '~> 3.0'
|
14
|
-
gem 'rubocop', '~> 0.81.0', require: false
|
15
|
-
gem 'rubocop-rspec', require: false
|
16
|
-
gem 'typhoeus'
|
17
8
|
gem 'danger', '8.2.1'
|
18
|
-
gem 'webmock'
|
19
|
-
# rubocop:enable all
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
belvo (0.
|
4
|
+
belvo (1.0.1)
|
5
5
|
faraday
|
6
6
|
faraday_middleware
|
7
7
|
typhoeus
|
@@ -11,8 +11,8 @@ GEM
|
|
11
11
|
specs:
|
12
12
|
addressable (2.8.0)
|
13
13
|
public_suffix (>= 2.0.2, < 5.0)
|
14
|
-
ast (2.4.
|
15
|
-
claide (1.0
|
14
|
+
ast (2.4.2)
|
15
|
+
claide (1.1.0)
|
16
16
|
claide-plugins (0.9.2)
|
17
17
|
cork
|
18
18
|
nap
|
@@ -20,12 +20,13 @@ GEM
|
|
20
20
|
colored2 (3.1.2)
|
21
21
|
cork (0.3.0)
|
22
22
|
colored2 (~> 3.1)
|
23
|
-
coveralls_reborn (0.
|
23
|
+
coveralls_reborn (0.24.0)
|
24
24
|
simplecov (>= 0.18.1, < 0.22.0)
|
25
25
|
term-ansicolor (~> 1.6)
|
26
26
|
thor (>= 0.20.3, < 2.0)
|
27
27
|
tins (~> 1.16)
|
28
|
-
crack (0.4.
|
28
|
+
crack (0.4.5)
|
29
|
+
rexml
|
29
30
|
danger (8.2.1)
|
30
31
|
claide (~> 1.0)
|
31
32
|
claide-plugins (>= 0.9.2)
|
@@ -39,54 +40,74 @@ GEM
|
|
39
40
|
no_proxy_fix
|
40
41
|
octokit (~> 4.7)
|
41
42
|
terminal-table (~> 1)
|
42
|
-
diff-lcs (1.
|
43
|
+
diff-lcs (1.5.0)
|
43
44
|
docile (1.4.0)
|
44
|
-
ethon (0.
|
45
|
-
ffi (>= 1.
|
46
|
-
faraday (1.
|
47
|
-
|
48
|
-
|
45
|
+
ethon (0.15.0)
|
46
|
+
ffi (>= 1.15.0)
|
47
|
+
faraday (1.10.0)
|
48
|
+
faraday-em_http (~> 1.0)
|
49
|
+
faraday-em_synchrony (~> 1.0)
|
50
|
+
faraday-excon (~> 1.1)
|
51
|
+
faraday-httpclient (~> 1.0)
|
52
|
+
faraday-multipart (~> 1.0)
|
53
|
+
faraday-net_http (~> 1.0)
|
54
|
+
faraday-net_http_persistent (~> 1.0)
|
55
|
+
faraday-patron (~> 1.0)
|
56
|
+
faraday-rack (~> 1.0)
|
57
|
+
faraday-retry (~> 1.0)
|
58
|
+
ruby2_keywords (>= 0.0.4)
|
59
|
+
faraday-em_http (1.0.0)
|
60
|
+
faraday-em_synchrony (1.0.0)
|
61
|
+
faraday-excon (1.1.0)
|
49
62
|
faraday-http-cache (2.2.0)
|
50
63
|
faraday (>= 0.8)
|
51
|
-
|
64
|
+
faraday-httpclient (1.0.1)
|
65
|
+
faraday-multipart (1.0.3)
|
66
|
+
multipart-post (>= 1.2, < 3)
|
67
|
+
faraday-net_http (1.0.1)
|
68
|
+
faraday-net_http_persistent (1.2.0)
|
69
|
+
faraday-patron (1.0.0)
|
70
|
+
faraday-rack (1.0.0)
|
71
|
+
faraday-retry (1.0.3)
|
72
|
+
faraday_middleware (1.2.0)
|
52
73
|
faraday (~> 1.0)
|
53
|
-
ffi (1.
|
54
|
-
git (1.
|
74
|
+
ffi (1.15.5)
|
75
|
+
git (1.11.0)
|
55
76
|
rchardet (~> 1.8)
|
56
77
|
hashdiff (1.0.1)
|
57
78
|
jaro_winkler (1.5.4)
|
58
|
-
kramdown (2.
|
79
|
+
kramdown (2.4.0)
|
59
80
|
rexml
|
60
81
|
kramdown-parser-gfm (1.1.0)
|
61
82
|
kramdown (~> 2.0)
|
62
83
|
multipart-post (2.1.1)
|
63
84
|
nap (1.1.0)
|
64
85
|
no_proxy_fix (0.1.2)
|
65
|
-
octokit (4.
|
86
|
+
octokit (4.22.0)
|
66
87
|
faraday (>= 0.9)
|
67
88
|
sawyer (~> 0.8.0, >= 0.5.3)
|
68
89
|
open4 (1.3.4)
|
69
|
-
parallel (1.
|
70
|
-
parser (
|
90
|
+
parallel (1.22.1)
|
91
|
+
parser (3.1.2.0)
|
71
92
|
ast (~> 2.4.1)
|
72
|
-
public_suffix (4.0.
|
73
|
-
rainbow (3.
|
93
|
+
public_suffix (4.0.7)
|
94
|
+
rainbow (3.1.1)
|
74
95
|
rake (12.3.3)
|
75
96
|
rchardet (1.8.0)
|
76
97
|
rexml (3.2.5)
|
77
|
-
rspec (3.
|
78
|
-
rspec-core (~> 3.
|
79
|
-
rspec-expectations (~> 3.
|
80
|
-
rspec-mocks (~> 3.
|
81
|
-
rspec-core (3.
|
82
|
-
rspec-support (~> 3.
|
83
|
-
rspec-expectations (3.
|
98
|
+
rspec (3.11.0)
|
99
|
+
rspec-core (~> 3.11.0)
|
100
|
+
rspec-expectations (~> 3.11.0)
|
101
|
+
rspec-mocks (~> 3.11.0)
|
102
|
+
rspec-core (3.11.0)
|
103
|
+
rspec-support (~> 3.11.0)
|
104
|
+
rspec-expectations (3.11.0)
|
84
105
|
diff-lcs (>= 1.2.0, < 2.0)
|
85
|
-
rspec-support (~> 3.
|
86
|
-
rspec-mocks (3.
|
106
|
+
rspec-support (~> 3.11.0)
|
107
|
+
rspec-mocks (3.11.1)
|
87
108
|
diff-lcs (>= 1.2.0, < 2.0)
|
88
|
-
rspec-support (~> 3.
|
89
|
-
rspec-support (3.
|
109
|
+
rspec-support (~> 3.11.0)
|
110
|
+
rspec-support (3.11.0)
|
90
111
|
rubocop (0.81.0)
|
91
112
|
jaro_winkler (~> 1.5.1)
|
92
113
|
parallel (~> 1.10)
|
@@ -97,8 +118,8 @@ GEM
|
|
97
118
|
unicode-display_width (>= 1.4.0, < 2.0)
|
98
119
|
rubocop-rspec (1.41.0)
|
99
120
|
rubocop (>= 0.68.1)
|
100
|
-
ruby-progressbar (1.
|
101
|
-
ruby2_keywords (0.0.
|
121
|
+
ruby-progressbar (1.11.0)
|
122
|
+
ruby2_keywords (0.0.5)
|
102
123
|
sawyer (0.8.2)
|
103
124
|
addressable (>= 2.3.5)
|
104
125
|
faraday (> 0.8, < 2.0)
|
@@ -107,20 +128,20 @@ GEM
|
|
107
128
|
simplecov-html (~> 0.11)
|
108
129
|
simplecov_json_formatter (~> 0.1)
|
109
130
|
simplecov-html (0.12.3)
|
110
|
-
simplecov_json_formatter (0.1.
|
131
|
+
simplecov_json_formatter (0.1.4)
|
111
132
|
sync (0.5.0)
|
112
133
|
term-ansicolor (1.7.1)
|
113
134
|
tins (~> 1.0)
|
114
135
|
terminal-table (1.8.0)
|
115
136
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
116
|
-
thor (1.1
|
117
|
-
tins (1.
|
137
|
+
thor (1.2.1)
|
138
|
+
tins (1.31.0)
|
118
139
|
sync
|
119
140
|
typhoeus (1.4.0)
|
120
141
|
ethon (>= 0.9.0)
|
121
|
-
unicode-display_width (1.
|
122
|
-
webmock (3.
|
123
|
-
addressable (>= 2.
|
142
|
+
unicode-display_width (1.8.0)
|
143
|
+
webmock (3.14.0)
|
144
|
+
addressable (>= 2.8.0)
|
124
145
|
crack (>= 0.3.2)
|
125
146
|
hashdiff (>= 0.4.0, < 2.0.0)
|
126
147
|
|
@@ -131,13 +152,10 @@ DEPENDENCIES
|
|
131
152
|
belvo!
|
132
153
|
coveralls_reborn
|
133
154
|
danger (= 8.2.1)
|
134
|
-
faraday
|
135
|
-
faraday_middleware
|
136
155
|
rake (~> 12.0)
|
137
156
|
rspec (~> 3.0)
|
138
157
|
rubocop (~> 0.81.0)
|
139
158
|
rubocop-rspec
|
140
|
-
typhoeus
|
141
159
|
webmock
|
142
160
|
|
143
161
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -53,7 +53,9 @@ begin
|
|
53
53
|
|
54
54
|
belvo.accounts.retrieve(link: link_id)
|
55
55
|
|
56
|
-
|
56
|
+
belvo.accounts.list.each do |item|
|
57
|
+
puts item
|
58
|
+
end
|
57
59
|
rescue Belvo::RequestError => e
|
58
60
|
puts e.status_code
|
59
61
|
puts e.detail
|
@@ -83,7 +85,9 @@ begin
|
|
83
85
|
|
84
86
|
belvo.accounts.retrieve(link: new_link['id'])
|
85
87
|
|
86
|
-
|
88
|
+
belvo.accounts.list.each do |item|
|
89
|
+
puts item
|
90
|
+
end
|
87
91
|
rescue Belvo::RequestError => e
|
88
92
|
puts e.status_code
|
89
93
|
puts e.detail
|
data/lib/belvo/http.rb
CHANGED
@@ -41,7 +41,7 @@ module Belvo
|
|
41
41
|
raise RequestError.new(
|
42
42
|
'Request error',
|
43
43
|
response.status,
|
44
|
-
response.body
|
44
|
+
response.body
|
45
45
|
)
|
46
46
|
end
|
47
47
|
response
|
@@ -51,8 +51,8 @@ module Belvo
|
|
51
51
|
# @return [Boolean] True if credentials are valid to authenticate
|
52
52
|
# to Belvo API else False.
|
53
53
|
def authenticate
|
54
|
-
@session.basic_auth
|
55
|
-
response = @session.get('')
|
54
|
+
@session.request(:basic_auth, @key_id, @key_password)
|
55
|
+
response = @session.get('api/')
|
56
56
|
response.success?
|
57
57
|
end
|
58
58
|
|
@@ -91,16 +91,8 @@ module Belvo
|
|
91
91
|
# @raise [RequestError] If response code is different than 2XX
|
92
92
|
def list(path, params: nil)
|
93
93
|
params = {} if params.nil?
|
94
|
-
|
95
|
-
|
96
|
-
response.body['results'].each do |item|
|
97
|
-
yield item if block_given?
|
98
|
-
end
|
99
|
-
|
100
|
-
break unless response.body['next']
|
101
|
-
|
102
|
-
params = Faraday::Utils.parse_query URI(response.body['next']).query
|
103
|
-
end
|
94
|
+
response = get(path, params: params)
|
95
|
+
response.body['results']
|
104
96
|
end
|
105
97
|
|
106
98
|
# Show specific resource details
|
@@ -113,7 +105,7 @@ module Belvo
|
|
113
105
|
params = {} if params.nil?
|
114
106
|
|
115
107
|
resource_path = format('%<path>s%<id>s/', path: path, id: id)
|
116
|
-
response = get(resource_path, params)
|
108
|
+
response = get(resource_path, **params)
|
117
109
|
|
118
110
|
raise_for_status response
|
119
111
|
response.body
|
data/lib/belvo/resources.rb
CHANGED
@@ -25,12 +25,11 @@ module Belvo
|
|
25
25
|
|
26
26
|
# List all results
|
27
27
|
# @param params [Hash] Extra parameters sent as query strings.
|
28
|
-
# @return [Array]
|
28
|
+
# @return [Array] List of results when no block is passed.
|
29
|
+
# @yield [Hash] Each result to be processed individually.
|
29
30
|
# @raise [RequestError] If response code is different than 2XX
|
30
31
|
def list(params: nil)
|
31
|
-
|
32
|
-
@session.list(@endpoint, params: params) { |item| results.push item }
|
33
|
-
results
|
32
|
+
@session.list(@endpoint, params: params)
|
34
33
|
end
|
35
34
|
|
36
35
|
# Show specific resource details
|
data/lib/belvo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: belvo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Belvo Finance S.L.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
153
153
|
- ".github/pull_request_template.md"
|
154
154
|
- ".github/workflows/danger-pr-reviews.yml"
|
155
|
+
- ".github/workflows/generate-docs.yml"
|
155
156
|
- ".gitignore"
|
156
157
|
- ".rspec"
|
157
158
|
- ".rubocop.yml"
|
@@ -194,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
195
|
- !ruby/object:Gem::Version
|
195
196
|
version: '0'
|
196
197
|
requirements: []
|
197
|
-
rubygems_version: 3.
|
198
|
+
rubygems_version: 3.3.11
|
198
199
|
signing_key:
|
199
200
|
specification_version: 4
|
200
201
|
summary: The Ruby gem for the Belvo API
|