belvo 1.3.0 → 1.5.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: 2451a25febe9bcc2e507d13977720f0886f89da8ff9e65d639846ca029717a53
4
- data.tar.gz: 0ab5eb4ff9f6196ebc876011f3485e4bcba7a7888cbd20264f0abaaf9380e158
3
+ metadata.gz: cb2779e82bc56e77377b9c0a11c349fcf2b9e344d094004f8fd4314a3e3e47ba
4
+ data.tar.gz: 269766531d31fb9e9b33481024bf47ff534b93a2703210d419e382cb1b93b125
5
5
  SHA512:
6
- metadata.gz: 0ecbbb2a7c36121c8f9bfffdb5dddc4e4d2eb9065e3405ae0574736c808b2d24796c292dfc98a2b50d3431875d8b25bf6db5aea9946f765f5a1dca3acf5fd4d9
7
- data.tar.gz: 90490528e75a6cca01484b74094c750368191b726ad36530912c27dc560c49ae85b19856cb462947d6da9f07bce3eff5169265cb206e07a938eead59d3bd9ab1
6
+ metadata.gz: c7ceb92b9b07ce906f29a71459849f9bef5171ca6028f82e78e0c34404804cf0d591fdcc80684dbdb7623eaa43735d6438d9ed58e39bcfe568384cf65c13ec9a
7
+ data.tar.gz: a999b7ddb4701aee56cc9da5bcc254efd0b73c5a4195685d219b1b099588af2f161e3810f7b5ed18bfd61bab82bf16987e39f648095f354657042cfd3352a935
@@ -0,0 +1,52 @@
1
+ name: Run Danger (Custom)
2
+
3
+ on: [pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ name: Run Danger (Custom)
8
+ runs-on: ubuntu-latest
9
+ if: ${{ github.actor != 'dependabot[bot]' }}
10
+
11
+ steps:
12
+ - name: Checkout Code
13
+ uses: actions/checkout@v2
14
+ with:
15
+ fetch-depth: 50
16
+
17
+ # Setup ruby
18
+ - name: Set up Ruby 3.2
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: 3.2
22
+ bundler-cache: true
23
+
24
+ # Install the right bundler version
25
+ - name: Install bundler
26
+ run: gem install bundler
27
+
28
+ # Cache dependencies
29
+ - name: Cache ruby dependencies
30
+ id: cache-ruby
31
+ uses: actions/cache@v3
32
+ with:
33
+ path: vendor/bundle
34
+ key: union-gems-${{ hashFiles('**/Gemfile.lock') }}
35
+ restore-keys: |
36
+ union-gems-
37
+
38
+ # Install dependencies on cache miss
39
+ - name: Install ruby dependencies
40
+ if: steps.cache-ruby.outputs.cache-hit != 'true'
41
+ run: |
42
+ bundle config --local without "documentation"
43
+ bundle config path vendor/bundle
44
+ bundle install --jobs 4 --retry 3
45
+
46
+ # Run danger
47
+ - name: Run danger
48
+ env:
49
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50
+ run: |
51
+ bundle config path vendor/bundle
52
+ bundle exec danger --dangerfile=Dangerfile.custom
@@ -6,18 +6,20 @@ jobs:
6
6
  build:
7
7
  name: Run Danger
8
8
  runs-on: ubuntu-latest
9
+ if: ${{ github.actor != 'dependabot[bot]' }}
9
10
 
10
11
  steps:
11
12
  - name: Checkout Code
12
13
  uses: actions/checkout@v2
13
14
  with:
14
- fetch-depth: 10
15
+ fetch-depth: 50
15
16
 
16
17
  # Setup ruby
17
- - name: Set up Ruby 2.6
18
- uses: actions/setup-ruby@v1
18
+ - name: Set up Ruby 3.2
19
+ uses: ruby/setup-ruby@v1
19
20
  with:
20
- ruby-version: 2.6
21
+ ruby-version: 3.2
22
+ bundler-cache: true
21
23
 
22
24
  # Install the right bundler version
23
25
  - name: Install bundler
@@ -26,18 +28,21 @@ jobs:
26
28
  # Cache dependencies
27
29
  - name: Cache ruby dependencies
28
30
  id: cache-ruby
29
- uses: actions/cache@v2
31
+ uses: actions/cache@v3
30
32
  with:
31
33
  path: vendor/bundle
32
34
  key: union-gems-${{ hashFiles('**/Gemfile.lock') }}
33
35
  restore-keys: |
34
36
  union-gems-
37
+
35
38
  # Install dependencies on cache miss
36
39
  - name: Install ruby dependencies
37
40
  if: steps.cache-ruby.outputs.cache-hit != 'true'
38
41
  run: |
42
+ bundle config --local without "documentation"
39
43
  bundle config path vendor/bundle
40
- bundle install --jobs 4 --retry 3 --without=documentation
44
+ bundle install --jobs 4 --retry 3
45
+
41
46
  # Run danger
42
47
  - name: Run danger
43
48
  env:
@@ -45,4 +50,3 @@ jobs:
45
50
  run: |
46
51
  bundle config path vendor/bundle
47
52
  bundle exec danger
48
-
@@ -11,9 +11,10 @@ jobs:
11
11
  - name: Checkout Belvo Ruby SDK repo
12
12
  uses: actions/checkout@v2
13
13
  - name: Set up Ruby
14
- uses: actions/setup-ruby@v1
14
+ uses: ruby/setup-ruby@v1
15
15
  with:
16
- ruby-version: "2.7"
16
+ ruby-version: 3.2
17
+ bundler-cache: true
17
18
  - name: Install required gem dependencies
18
19
  run: gem install yard --no-document
19
20
  - name: Build RUBY SDK docs with YARD
data/Dangerfile CHANGED
@@ -1,21 +1,27 @@
1
- # rubocop:disable all
2
- # Mainly to encourage writing up some reasoning about the PR, rather than
3
- # just leaving a title
4
- fail "Please provide a short summary in the PR description :page_with_curl:" if github.pr_body.length < 10
1
+ # frozen_string_literal: true
5
2
 
6
- # The title should include the correct prefix tag
7
- if !github.pr_title.match(/^\[(?:Fixed|Added|Changed|Removed|Security|Other)\]/)
8
- fail "Please provide a valid PR title label: [Added]/[Fixed]/[Changed]/[Removed]/[Security]/[Other]"
3
+ ##########################################################################
4
+ # THIS FILE IS OWNED BY SECURITY CHANGES TO THIS FILE ARE MADE CENTRALLY #
5
+ # CONTACT SECURITY@BELVO.COM or SLACK #ASK-SECURITY #
6
+ ##########################################################################
7
+
8
+ # Provide a description
9
+ if github.pr_body.length < 10
10
+ raise 'Please provide a short summary in the PR description :page_with_curl:'
9
11
  end
10
12
 
11
- # The title should include the JIRA ticket unless is a dependabot PR
12
- if github.pr_labels.include?("dependencies")
13
- message ("PR autogenerated by dependabot")
14
- elsif !github.pr_title.match(/^\[.*\]\s?\[BEL-\d+\]/)
15
- fail "Please provide a valid Jira ticket ID associated to this PR: [BEL-XXXX]. If you do not have any associated Jira ticket, just use [BEL-XXXX]"
13
+ # The title has to include a JIRA ticket unless is a dependabot PR or SNYK
14
+ if github.pr_labels.include?('dependencies')
15
+ message 'PR autogenerated by dependabot'
16
+ elsif github.pr_title =~ /\[Snyk\]/
17
+ message 'PR generated by Snyk'
18
+ elsif github.pr_title !~ /\[[A-Z]{1,10}-[0-9]{1,5}\]/
19
+ raise 'Please provide a valid Jira ticket ID associated to this PR'\
20
+ '(e.g. [BEL-XXXXX]'
16
21
  end
17
22
 
18
- warn("PR is classed as Work in Progress", sticky: false) if github.pr_title.include? "[WIP]"
23
+ if github.pr_title.include? '[WIP]'
24
+ warn('PR is classed as Work in Progress', sticky: false)
25
+ end
19
26
 
20
- message("One approval required for merging :smiley_cat: :smiley_cat:")
21
- # rubocop:enable all
27
+ message('One approval required for merging')
data/Dangerfile.custom ADDED
@@ -0,0 +1,6 @@
1
+ # The PR title should include the correct label
2
+ if !github.pr_title.match(/\[Snyk\]/) &&
3
+ !github.pr_labels.include?("dependencies") &&
4
+ !github.pr_title.match(/^\[(?:Added|Changed|Docs|Fixed|Migrations|Other|Removed|Security)\]/)
5
+ fail "Please provide a valid PR title label: [Added]/[Changed]/[Docs]/[Fixed]/[Migrations]/[Other]/[Removed]/[Security]."
6
+ end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- belvo (1.3.0)
4
+ belvo (1.5.0)
5
5
  faraday
6
6
  faraday_middleware
7
7
  typhoeus
data/lib/belvo/options.rb CHANGED
@@ -215,15 +215,11 @@ module Belvo
215
215
  class InvestmentsPortfolioOptions < Faraday::Options.new(:token, :save_data)
216
216
  end
217
217
 
218
- # @!class InvestmentsTransactionOptions < Faraday::Options
219
- # Contains configurable properties of an InvestmentsTransaction
220
- # @!attribute date_to [rw] Date string (YYYY-MM-DD)
218
+ # @!class EmploymentRecordsOptions < Faraday::Options
219
+ # Contains configurable properties of an Employment Record
221
220
  # @!attribute save_data [rw] Should data be persisted or not.
222
- # @!attribute token [rw] OTP token required by the institution
223
- class InvestmentsTransactionOptions < Faraday::Options.new(
224
- :date_to,
225
- :token,
226
- :save_data
227
- )
221
+ # @!attribute attach_pdf [rw] Should the PDF file be included in the
222
+ # response or not.
223
+ class EmploymentRecordsOptions < Faraday::Options.new(:save_data, :attach_pdf)
228
224
  end
229
225
  end
@@ -656,29 +656,26 @@ module Belvo
656
656
  end
657
657
  end
658
658
 
659
- # A InvestmentsTransaction gets the existing transactions for an instrument
660
- class InvestmentsTransaction < Resource
659
+ # Employment records
660
+ class EmploymentRecords < Resource
661
661
  def initialize(session)
662
662
  super(session)
663
- @endpoint = 'investments/transactions/'
663
+ @endpoint = 'api/employment-records/'
664
664
  end
665
665
 
666
- # Retrieve investments transactions from an existing link
666
+ # Retrieve employment records from an existing government link
667
667
  # @param link [String] Link UUID
668
- # @param date_from [String] Date string (YYYY-MM-DD)
669
- # @param options [InvestmentsTransactionOptions] Configurable properties
670
- # @return [Hash] created investments transactions details
668
+ # @param options [EmploymentRecordsOptions] Configurable properties
669
+ # @return [Hash] created employment records details
671
670
  # @raise [RequestError] If response code is different than 2XX
672
- def retrieve(link:, date_from:, options: nil)
673
- options = InvestmentsTransactionOptions.from(options)
674
- date_to = options.date_to || Date.today.to_s
671
+ def retrieve(link:, options: nil)
672
+ options = EmploymentRecordsOptions.from(options)
675
673
  body = {
676
674
  link: link,
677
- date_from: date_from,
678
- date_to: date_to,
679
- token: options.token,
680
- save_data: options.save_data || true
675
+ save_data: options.save_data || true,
676
+ attach_pdf: options.attach_pdf
681
677
  }.merge(options)
678
+
682
679
  body = clean body: body
683
680
  @session.post(@endpoint, body)
684
681
  end
data/lib/belvo/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Belvo
4
4
  # belvo-ruby current version
5
- VERSION = '1.3.0'
5
+ VERSION = '1.5.0'
6
6
  end
data/lib/belvo.rb CHANGED
@@ -140,10 +140,10 @@ module Belvo
140
140
  @investments_portfolio = InvestmentsPortfolio.new @session
141
141
  end
142
142
 
143
- # Provides access to InvestmentsTransaction resource
144
- # @return [InvestmentsTransaction]
145
- def investments_transaction
146
- @investments_transaction = InvestmentsTransaction.new @session
143
+ # Provides access to EmploymentRecords resource
144
+ # @return [EmploymentRecords]
145
+ def employment_records
146
+ @employment_records = EmploymentRecords.new @session
147
147
  end
148
148
  end
149
149
  end
data/specs.4.8.gz ADDED
Binary file
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: 1.3.0
4
+ version: 1.5.0
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: 2022-11-16 00:00:00.000000000 Z
11
+ date: 2023-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -151,6 +151,7 @@ files:
151
151
  - ".github/CODEOWNERS"
152
152
  - ".github/ISSUE_TEMPLATE/feature_request.md"
153
153
  - ".github/pull_request_template.md"
154
+ - ".github/workflows/danger-pr-reviews-custom.yml"
154
155
  - ".github/workflows/danger-pr-reviews.yml"
155
156
  - ".github/workflows/generate-docs.yml"
156
157
  - ".gitignore"
@@ -158,6 +159,7 @@ files:
158
159
  - ".rubocop.yml"
159
160
  - CODE_OF_CONDUCT.md
160
161
  - Dangerfile
162
+ - Dangerfile.custom
161
163
  - Gemfile
162
164
  - Gemfile.lock
163
165
  - LICENSE
@@ -173,6 +175,7 @@ files:
173
175
  - lib/belvo/resources.rb
174
176
  - lib/belvo/utils.rb
175
177
  - lib/belvo/version.rb
178
+ - specs.4.8.gz
176
179
  homepage: https://github.com/belvo-finance/belvo-ruby
177
180
  licenses:
178
181
  - MIT
@@ -195,7 +198,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
198
  - !ruby/object:Gem::Version
196
199
  version: '0'
197
200
  requirements: []
198
- rubygems_version: 3.3.11
201
+ rubygems_version: 3.3.26
199
202
  signing_key:
200
203
  specification_version: 4
201
204
  summary: The Ruby gem for the Belvo API