finapps 5.0.34 → 5.0.43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/release-drafter.yml +49 -0
  3. data/.github/workflows/main.yaml +5 -10
  4. data/.github/workflows/release-drafter.yml +15 -0
  5. data/.github/workflows/release.yml +54 -0
  6. data/.github/workflows/verify-pr-labeled.yml +14 -0
  7. data/.rubocop.yml +5 -12
  8. data/.rubocop_todo.yml +4 -95
  9. data/README.md +1 -0
  10. data/RELEASES.md +20 -0
  11. data/finapps.gemspec +0 -1
  12. data/lib/finapps.rb +2 -0
  13. data/lib/finapps/rest/client.rb +8 -5
  14. data/lib/finapps/rest/documents_orders.rb +1 -1
  15. data/lib/finapps/rest/documents_upload_types.rb +11 -0
  16. data/lib/finapps/rest/documents_uploads.rb +23 -0
  17. data/lib/finapps/rest/orders.rb +26 -15
  18. data/lib/finapps/rest/sessions.rb +10 -8
  19. data/lib/finapps/utils/query_builder.rb +13 -4
  20. data/lib/finapps/version.rb +1 -1
  21. data/spec/rest/alert_definitions_spec.rb +2 -6
  22. data/spec/rest/client_spec.rb +32 -40
  23. data/spec/rest/consumers_spec.rb +221 -220
  24. data/spec/rest/documents_orders_notifications_spec.rb +1 -1
  25. data/spec/rest/documents_orders_spec.rb +1 -1
  26. data/spec/rest/documents_upload_types_spec.rb +21 -0
  27. data/spec/rest/documents_uploads_spec.rb +104 -0
  28. data/spec/rest/operators_password_resets_spec.rb +49 -56
  29. data/spec/rest/operators_spec.rb +167 -178
  30. data/spec/rest/order_notifications_spec.rb +1 -1
  31. data/spec/rest/order_refreshes_spec.rb +2 -5
  32. data/spec/rest/order_reports_spec.rb +14 -14
  33. data/spec/rest/order_statuses_spec.rb +10 -10
  34. data/spec/rest/order_tokens_spec.rb +33 -32
  35. data/spec/rest/orders_spec.rb +78 -64
  36. data/spec/rest/password_resets_spec.rb +28 -28
  37. data/spec/rest/plaid/plaid_consumer_institutions_spec.rb +1 -1
  38. data/spec/rest/portfolios_alerts_spec.rb +3 -3
  39. data/spec/rest/portfolios_consumers_spec.rb +2 -2
  40. data/spec/rest/portfolios_spec.rb +6 -18
  41. data/spec/rest/products_spec.rb +16 -15
  42. data/spec/rest/sessions_spec.rb +61 -60
  43. data/spec/rest/signed_documents_downloads_spec.rb +8 -4
  44. data/spec/rest/verix/verix_documents_spec.rb +2 -2
  45. data/spec/rest/version_spec.rb +4 -4
  46. data/spec/support/fake_api.rb +16 -1
  47. data/spec/support/fixtures/upload_types.json +9 -0
  48. metadata +67 -77
  49. data/lib/tasks/releaser.rake +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6958de8a43a73230709100da8c2ddc2c2eef53d2ae74f546c37dbab8d6790b6a
4
- data.tar.gz: 4af6e7780029881e968ef5551d3b24c965471a65080b9b45fda47ceb0e57d424
3
+ metadata.gz: 25bea095f4796915e3b73d50300279a31fd052ca797da34c91a41078f9eecc2b
4
+ data.tar.gz: 2f4123341bbc2703a26d8ad361428fb050a06c797390d7b57f2b67f07bef90de
5
5
  SHA512:
6
- metadata.gz: 06c98f429646d29272d6a5b4d7f3f9d9bb38ca20e9e5d4fbce6db76d86200eab81acb64476170f05c705eee82c4cfa44f83f4f3b783777ccb13e962b458be7c3
7
- data.tar.gz: fdaa7e5508c7d0f7929f15d8a68ba4137180ce56b1e4be46dcd83d7230d1f2d796d40ef1949d082309e55d7e9a78433ae927f9ec13785ec49dc80d345e8cfb6a
6
+ metadata.gz: 03c8eccc181f51654a07bad7769ce759707d6f6a54a21a806ce0b924ef7bce7ee17c1f27751a86f9659d83e6e7005988dd48bad3d51127bc1957f6764a392116
7
+ data.tar.gz: 01205c7a1e01a4267d5dd9ad4e10789872a2e6bf47e29c354ed2c9939c806e01bdfa00b1a1c1c36012397cbc6b235760c99486f8b3f71f17c912ad6e458cf059
@@ -0,0 +1,49 @@
1
+ name-template: 'version $RESOLVED_VERSION'
2
+ tag-template: 'v$RESOLVED_VERSION'
3
+ categories:
4
+ - title: 'Added'
5
+ labels: 'enhancement'
6
+ - title: 'Changed'
7
+ labels: 'change'
8
+ - title: 'Deprecated'
9
+ labels: 'deprecated'
10
+ - title: 'Removed'
11
+ labels: 'removed'
12
+ - title: 'Fixed'
13
+ labels: 'bug'
14
+ - title: 'Security'
15
+ label: 'dependencies'
16
+ - title: 'Documentation updates'
17
+ label: 'documentation'
18
+ - title: 'Maintenance'
19
+ labels: 'internal'
20
+
21
+ change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
22
+
23
+ version-resolver:
24
+ major:
25
+ labels:
26
+ - 'major'
27
+ minor:
28
+ labels:
29
+ - 'minor'
30
+ patch:
31
+ labels:
32
+ - 'patch'
33
+ default: patch
34
+
35
+ exclude-labels:
36
+ - reverted
37
+ - no-changelog
38
+ - skip-changelog
39
+ - invalid
40
+
41
+ template: |
42
+ ## [$RESOLVED_VERSION](https://github.com/finapps/ruby-client/compare/$PREVIOUS_TAG...$RESOLVED_VERSION)
43
+ $CHANGES
44
+
45
+ replacers:
46
+ - search: '/CVE-(\d{4})-(\d+)/g'
47
+ replace: 'https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-$1-$2'
48
+ - search: '@dependabot-preview'
49
+ replace: '@dependabot'
@@ -1,15 +1,10 @@
1
- name: Main
1
+ name: Continuous Integration
2
2
 
3
- on:
4
- push:
5
- branches:
6
- - master
7
- pull_request:
8
- branches:
9
- - master
3
+ on: [push, pull_request]
10
4
 
11
5
  jobs:
12
6
  ci:
7
+ if: "!contains(github.event.head_commit.message, 'skip ci')"
13
8
  runs-on: ubuntu-latest
14
9
 
15
10
  strategy:
@@ -23,7 +18,7 @@ jobs:
23
18
  with:
24
19
  ruby-version: '2.6'
25
20
 
26
- - uses: actions/cache@v1
21
+ - uses: actions/cache@v2
27
22
  with:
28
23
  path: vendor/bundle
29
24
  key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
@@ -32,7 +27,7 @@ jobs:
32
27
 
33
28
  - name: Install gems
34
29
  run: |
35
- gem install bundler
30
+ gem install -N bundler
36
31
  bundle config path vendor/bundle
37
32
  bundle install --jobs 4 --retry 3
38
33
 
@@ -0,0 +1,15 @@
1
+ name: Release Drafter
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+
8
+ jobs:
9
+ update_release_draft:
10
+ if: "!contains(github.event.head_commit.message, 'skip ci')"
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: release-drafter/release-drafter@v5
14
+ env:
15
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,54 @@
1
+ name: Bump version and Release
2
+ on:
3
+ release:
4
+ types: [published]
5
+
6
+ jobs:
7
+ release:
8
+ runs-on: ubuntu-latest
9
+ strategy:
10
+ fail-fast: true
11
+
12
+ steps:
13
+ - uses: actions/checkout@master
14
+ with:
15
+ persist-credentials: false
16
+ fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
17
+
18
+ - uses: actions/setup-ruby@v1
19
+ with:
20
+ ruby-version: '2.6'
21
+
22
+ - name: Get version from latest tag
23
+ id: get_version
24
+ uses: battila7/get-version-action@v2
25
+
26
+ - name: Bump version
27
+ run: |
28
+ gem install -N gem-release
29
+ git config --local user.email "action@github.com"
30
+ git config --local user.name "GitHub Action"
31
+ gem bump --skip-ci --version ${{ steps.get_version.outputs.version-without-v }}
32
+
33
+ - name: Push changes
34
+ uses: ad-m/github-push-action@master
35
+ with:
36
+ # GitHub Actions token does not support pushing to protected branches.
37
+ # github_token: ${{ secrets.GITHUB_TOKEN }}
38
+ #
39
+ # A manually populated`PERSONAL_ACCESS_TOKEN` environment variable
40
+ # with permissions to push to a protected branch must be used.
41
+ # not ideal - keep eyes open for a better solution
42
+ github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
43
+
44
+ - name: Release gem to rubygems.org
45
+ run: |
46
+ set +x
47
+ mkdir -p ~/.gem
48
+ cat << EOF > ~/.gem/credentials
49
+ ---
50
+ :rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}
51
+ EOF
52
+ chmod 0600 ~/.gem/credentials
53
+ set -x
54
+ gem release
@@ -0,0 +1,14 @@
1
+ name: "Require PR labels"
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, labeled, unlabeled, synchronize]
6
+ jobs:
7
+ label:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: mheap/github-action-required-labels@v1
11
+ with:
12
+ mode: exactly
13
+ count: 1
14
+ labels: "bug, change, enhancement"
@@ -10,6 +10,7 @@ AllCops:
10
10
  - "vendor/**/*"
11
11
  - "bin/**/*"
12
12
  CacheRootDirectory: tmp
13
+ NewCops: enable
13
14
 
14
15
  Layout/SpaceAroundMethodCallOperator:
15
16
  Enabled: true
@@ -69,6 +70,8 @@ Naming/PredicateName:
69
70
 
70
71
  RSpec/FilePath:
71
72
  Enabled: false
73
+ Gemspec/RequiredRubyVersion:
74
+ Enabled: false
72
75
 
73
76
  Style/RedundantRegexpCharacterClass:
74
77
  Enabled: true
@@ -138,18 +141,8 @@ Style/OneLineConditional:
138
141
  Description: Favor the ternary operator(?:) over if/then/else/end constructs.
139
142
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
140
143
  Enabled: false
141
- Style/ExponentialNotation:
142
- Enabled: true
143
- Style/HashEachMethods:
144
- Enabled: true
145
- Style/HashTransformKeys:
146
- Enabled: true
147
- Style/HashTransformValues:
148
- Enabled: true
149
- Style/RedundantFetchBlock:
150
- Enabled: true
151
- Style/SlicingWithRange:
152
- Enabled: true
144
+ Style/OptionalBooleanParameter:
145
+ Enabled: false
153
146
 
154
147
  RSpec/NestedGroups:
155
148
  Max: 5
@@ -6,115 +6,24 @@
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 12
10
- # Cop supports --auto-correct.
11
- # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
12
- # URISchemes: http, https
13
- Layout/LineLength:
14
- Max: 119
15
-
16
- # Offense count: 1
17
- # Configuration parameters: IgnoredMethods.
18
- Metrics/AbcSize:
19
- Max: 16
20
-
21
9
  # Offense count: 1
22
10
  # Configuration parameters: CountComments, ExcludedMethods.
23
11
  # ExcludedMethods: refine
12
+ # finapps.gemspec - leaving as is intentionally
24
13
  Metrics/BlockLength:
25
14
  Max: 28
26
15
 
27
16
  # Offense count: 1
28
17
  # Configuration parameters: CountComments.
18
+ # fake_api.rb - leaving as is intentionally
29
19
  Metrics/ClassLength:
30
- Max: 431
31
-
32
- # Offense count: 3
33
- # Configuration parameters: CountComments, ExcludedMethods.
34
- Metrics/MethodLength:
35
- Max: 16
36
-
37
- # Offense count: 29
38
- # Configuration parameters: Prefixes.
39
- # Prefixes: when, with, without
40
- RSpec/ContextWording:
41
- Exclude:
42
- - 'spec/rest/client_spec.rb'
43
- - 'spec/rest/consumers_spec.rb'
44
- - 'spec/rest/documents_orders_notifications_spec.rb'
45
- - 'spec/rest/operators_password_resets_spec.rb'
46
- - 'spec/rest/operators_spec.rb'
47
- - 'spec/rest/order_notifications_spec.rb'
48
- - 'spec/rest/order_tokens_spec.rb'
49
- - 'spec/rest/orders_spec.rb'
50
- - 'spec/rest/portfolios_consumers_spec.rb'
51
- - 'spec/rest/sessions_spec.rb'
52
-
53
- # Offense count: 6
54
- RSpec/DescribeMethod:
55
- Exclude:
56
- - 'spec/rest/consumers_spec.rb'
57
- - 'spec/rest/operators_password_resets_spec.rb'
58
- - 'spec/rest/operators_spec.rb'
59
- - 'spec/rest/order_tokens_spec.rb'
60
- - 'spec/rest/products_spec.rb'
61
- - 'spec/rest/sessions_spec.rb'
20
+ Max: 442
62
21
 
63
22
  # Offense count: 5
64
23
  # Configuration parameters: Max.
24
+ # Leaving as is intentionally - url being tested takes up as many lines
65
25
  RSpec/ExampleLength:
66
26
  Exclude:
67
27
  - 'spec/rest/consumers_spec.rb'
68
28
  - 'spec/rest/documents_orders_spec.rb'
69
29
  - 'spec/rest/orders_spec.rb'
70
-
71
- # Offense count: 1
72
- # Configuration parameters: .
73
- # SupportedStyles: have_received, receive
74
- RSpec/MessageSpies:
75
- EnforcedStyle: receive
76
-
77
- # Offense count: 13
78
- RSpec/MultipleExpectations:
79
- Max: 3
80
-
81
- # Offense count: 114
82
- # Configuration parameters: IgnoreSharedExamples.
83
- RSpec/NamedSubject:
84
- Exclude:
85
- - 'spec/rest/client_spec.rb'
86
- - 'spec/rest/consumers_spec.rb'
87
- - 'spec/rest/documents_orders_spec.rb'
88
- - 'spec/rest/order_reports_spec.rb'
89
- - 'spec/rest/order_statuses_spec.rb'
90
- - 'spec/rest/order_tokens_spec.rb'
91
- - 'spec/rest/orders_spec.rb'
92
- - 'spec/rest/password_resets_spec.rb'
93
- - 'spec/rest/plaid/plaid_consumer_institutions_spec.rb'
94
- - 'spec/rest/sessions_spec.rb'
95
- - 'spec/rest/signed_documents_downloads_spec.rb'
96
- - 'spec/rest/verix/verix_documents_spec.rb'
97
- - 'spec/rest/verix/verix_pdf_documents_spec.rb'
98
- - 'spec/rest/version_spec.rb'
99
-
100
- # Offense count: 6
101
- RSpec/RepeatedExample:
102
- Exclude:
103
- - 'spec/rest/signed_documents_downloads_spec.rb'
104
- - 'spec/rest/verix/verix_documents_spec.rb'
105
- - 'spec/rest/verix/verix_pdf_documents_spec.rb'
106
-
107
- # Offense count: 2
108
- RSpec/RepeatedExampleGroupBody:
109
- Exclude:
110
- - 'spec/rest/client_spec.rb'
111
-
112
- # Offense count: 4
113
- RSpec/RepeatedExampleGroupDescription:
114
- Exclude:
115
- - 'spec/rest/client_spec.rb'
116
-
117
- # Offense count: 1
118
- RSpec/SubjectStub:
119
- Exclude:
120
- - 'spec/rest/orders_spec.rb'
data/README.md CHANGED
@@ -3,6 +3,7 @@ FinApps Ruby-Client
3
3
  ===================
4
4
 
5
5
  [![Gem Version](https://img.shields.io/gem/v/finapps.svg)](https://rubygems.org/gems/finapps)
6
+ ![Main](https://github.com/finapps/ruby-client/workflows/Main/badge.svg)
6
7
  [![Build Status](https://travis-ci.org/finapps/ruby-client.svg?branch=master)](https://travis-ci.org/finapps/ruby-client)
7
8
  [![Code Climate](https://codeclimate.com/github/finapps/ruby-client/badges/gpa.svg)](https://codeclimate.com/github/finapps/ruby-client)
8
9
  [![Test Coverage](https://codeclimate.com/github/finapps/ruby-client/badges/coverage.svg)](https://codeclimate.com/github/finapps/ruby-client/coverage)
@@ -1,3 +1,23 @@
1
+ ## [5.0.36] - 2020-08-05
2
+
3
+ ### Changed
4
+ * Add upload endpoints to support dashboard ([#309][i309])
5
+
6
+ [i309]: https://github.com/finapps/tenant-dashboard-react/issues/309
7
+
8
+ [5.0.36]: https://github.com/finapps/ruby-client/compare/5.0.35...5.0.36
9
+
10
+ ## [5.0.35] - 2020-07-09
11
+
12
+ ### Changed
13
+ * Change code to match rubocop suggestions ([#232][i232])
14
+ * Add support for first name order search with space ([#404][i404])
15
+
16
+ [i232]: https://github.com/finapps/ruby-client/issues/232
17
+ [i404]: https://github.com/finapps/tenant-dashboard-react/issues/404
18
+
19
+ [5.0.35]: https://github.com/finapps/ruby-client/compare/5.0.34...5.0.35
20
+
1
21
  ## [5.0.32] - 2020-06-11
2
22
 
3
23
  ### Fixed
@@ -24,7 +24,6 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 2.0', '>= 2.0.2'
26
26
  spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0', '>= 1.0.9'
27
- spec.add_development_dependency 'gem-release', '~> 2.1', '>= 2.1.1'
28
27
  spec.add_development_dependency 'guard', '~> 2.16', '>= 2.16.1'
29
28
  spec.add_development_dependency 'guard-rspec', '~> 4.7', '>= 4.7.3'
30
29
  spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
@@ -30,7 +30,9 @@ require 'finapps/rest/portfolios_consumers'
30
30
  require 'finapps/rest/consumers_portfolios'
31
31
  require 'finapps/rest/portfolio_reports'
32
32
  require 'finapps/rest/documents_orders'
33
+ require 'finapps/rest/documents_uploads'
33
34
  require 'finapps/rest/esign_templates'
35
+ require 'finapps/rest/documents_upload_types'
34
36
  require 'finapps/rest/signed_documents_downloads'
35
37
  require 'finapps/rest/documents_orders_notifications'
36
38
 
@@ -13,6 +13,8 @@ module FinApps
13
13
  consumers_portfolios
14
14
  documents_orders
15
15
  documents_orders_notifications
16
+ documents_upload_types
17
+ documents_uploads
16
18
  esign_templates
17
19
  orders
18
20
  order_assignments
@@ -60,17 +62,18 @@ module FinApps
60
62
  if RESOURCES.include? symbol
61
63
  class_name = camelize(symbol.to_s)
62
64
  variable = "@#{class_name.downcase}"
63
- unless instance_variable_defined? variable
64
- klass =
65
- Object.const_get('FinApps').const_get('REST').const_get class_name
66
- instance_variable_set(variable, klass.new(self))
67
- end
65
+ set_variable(class_name, variable) unless instance_variable_defined? variable
68
66
  instance_variable_get(variable)
69
67
  else
70
68
  super
71
69
  end
72
70
  end
73
71
 
72
+ def set_variable(class_name, variable)
73
+ klass = Object.const_get('FinApps').const_get('REST').const_get class_name
74
+ instance_variable_set(variable, klass.new(self))
75
+ end
76
+
74
77
  def respond_to_missing?(method_sym, include_private = false)
75
78
  RESOURCES.include?(method_sym) ? true : super
76
79
  end
@@ -33,7 +33,7 @@ module FinApps
33
33
 
34
34
  def destroy(id)
35
35
  not_blank(id, :order_id)
36
- super(id, "documents/orders/#{id}")
36
+ super(nil, "documents/orders/#{id}")
37
37
  end
38
38
 
39
39
  def show_signing_url(order_id, signature_id)
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FinApps
4
+ module REST
5
+ class DocumentsUploadTypes < FinAppsCore::REST::Resources
6
+ def list
7
+ super('documents/upload_types')
8
+ end
9
+ end
10
+ end
11
+ end