belvo 1.4.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: a629a7752ddbb1913f5313eeab072774c4ecd36748fb3cdf306a78f2bd4f6bbb
4
- data.tar.gz: fd1d6c751d71663622e94f076ab1b4fbd606fdafdfc62ca5e1574d6cf4b17ef4
3
+ metadata.gz: cb2779e82bc56e77377b9c0a11c349fcf2b9e344d094004f8fd4314a3e3e47ba
4
+ data.tar.gz: 269766531d31fb9e9b33481024bf47ff534b93a2703210d419e382cb1b93b125
5
5
  SHA512:
6
- metadata.gz: 2d2c41f8f976ec9a67622b12ed5f5ff1ef5373b1f7d170cd17a85f341e1313028be9f323f57102fc8f5c105c56f4572e1960fc45f051ed4fe210e0c90c13d195
7
- data.tar.gz: ff9552fe45ccf2ea98bf53c2392b8e68120e4c965aa9f2843132f664bf24bfd7c7b9ad5c60eb54e8b0f29d7dda2dddf2d14a25b44890939127a5e1066ada95ab
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,12 +6,13 @@ 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
18
  - name: Set up Ruby 3.2
@@ -27,18 +28,21 @@ jobs:
27
28
  # Cache dependencies
28
29
  - name: Cache ruby dependencies
29
30
  id: cache-ruby
30
- uses: actions/cache@v2
31
+ uses: actions/cache@v3
31
32
  with:
32
33
  path: vendor/bundle
33
34
  key: union-gems-${{ hashFiles('**/Gemfile.lock') }}
34
35
  restore-keys: |
35
36
  union-gems-
37
+
36
38
  # Install dependencies on cache miss
37
39
  - name: Install ruby dependencies
38
40
  if: steps.cache-ruby.outputs.cache-hit != 'true'
39
41
  run: |
42
+ bundle config --local without "documentation"
40
43
  bundle config path vendor/bundle
41
- bundle install --jobs 4 --retry 3 --without=documentation
44
+ bundle install --jobs 4 --retry 3
45
+
42
46
  # Run danger
43
47
  - name: Run danger
44
48
  env:
@@ -46,4 +50,3 @@ jobs:
46
50
  run: |
47
51
  bundle config path vendor/bundle
48
52
  bundle exec danger
49
-
@@ -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.4.0)
4
+ belvo (1.5.0)
5
5
  faraday
6
6
  faraday_middleware
7
7
  typhoeus
data/lib/belvo/options.rb CHANGED
@@ -214,4 +214,12 @@ module Belvo
214
214
  # @!attribute token [rw] OTP token required by the institution
215
215
  class InvestmentsPortfolioOptions < Faraday::Options.new(:token, :save_data)
216
216
  end
217
+
218
+ # @!class EmploymentRecordsOptions < Faraday::Options
219
+ # Contains configurable properties of an Employment Record
220
+ # @!attribute save_data [rw] Should data be persisted or not.
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)
224
+ end
217
225
  end
@@ -655,4 +655,29 @@ module Belvo
655
655
  @session.post(@endpoint, body)
656
656
  end
657
657
  end
658
+
659
+ # Employment records
660
+ class EmploymentRecords < Resource
661
+ def initialize(session)
662
+ super(session)
663
+ @endpoint = 'api/employment-records/'
664
+ end
665
+
666
+ # Retrieve employment records from an existing government link
667
+ # @param link [String] Link UUID
668
+ # @param options [EmploymentRecordsOptions] Configurable properties
669
+ # @return [Hash] created employment records details
670
+ # @raise [RequestError] If response code is different than 2XX
671
+ def retrieve(link:, options: nil)
672
+ options = EmploymentRecordsOptions.from(options)
673
+ body = {
674
+ link: link,
675
+ save_data: options.save_data || true,
676
+ attach_pdf: options.attach_pdf
677
+ }.merge(options)
678
+
679
+ body = clean body: body
680
+ @session.post(@endpoint, body)
681
+ end
682
+ end
658
683
  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.4.0'
5
+ VERSION = '1.5.0'
6
6
  end
data/lib/belvo.rb CHANGED
@@ -139,5 +139,11 @@ module Belvo
139
139
  def investments_portfolio
140
140
  @investments_portfolio = InvestmentsPortfolio.new @session
141
141
  end
142
+
143
+ # Provides access to EmploymentRecords resource
144
+ # @return [EmploymentRecords]
145
+ def employment_records
146
+ @employment_records = EmploymentRecords.new @session
147
+ end
142
148
  end
143
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.4.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: 2023-01-12 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