finapps 5.4.1 → 6.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yaml +1 -1
  3. data/.github/workflows/release.yml +1 -1
  4. data/.github/workflows/verify-pr-labeled.yml +1 -1
  5. data/.rubocop.yml +1 -0
  6. data/finapps.gemspec +2 -3
  7. data/lib/finapps.rb +3 -0
  8. data/lib/finapps/rest/client.rb +3 -0
  9. data/lib/finapps/rest/consumer_login_tokens.rb +12 -0
  10. data/lib/finapps/rest/consumers.rb +1 -1
  11. data/lib/finapps/rest/documents_orders.rb +8 -8
  12. data/lib/finapps/rest/documents_uploads.rb +1 -1
  13. data/lib/finapps/rest/operator_change_password_email.rb +12 -0
  14. data/lib/finapps/rest/operator_login_tokens.rb +12 -0
  15. data/lib/finapps/rest/operators.rb +1 -1
  16. data/lib/finapps/rest/orders.rb +14 -14
  17. data/lib/finapps/rest/screenings.rb +3 -3
  18. data/lib/finapps/version.rb +1 -1
  19. data/spec/rest/alert_definitions_spec.rb +1 -1
  20. data/spec/rest/alert_occurrences_spec.rb +1 -1
  21. data/spec/rest/consumer_login_tokens_spec.rb +47 -0
  22. data/spec/rest/consumers_portfolios_spec.rb +1 -1
  23. data/spec/rest/consumers_spec.rb +14 -14
  24. data/spec/rest/operator_change_password_email_spec.rb +33 -0
  25. data/spec/rest/operators_login_tokens_spec.rb +43 -0
  26. data/spec/rest/operators_spec.rb +1 -1
  27. data/spec/rest/orders_spec.rb +24 -24
  28. data/spec/rest/portfolio_reports_spec.rb +1 -1
  29. data/spec/rest/portfolios_available_consumers_spec.rb +1 -1
  30. data/spec/rest/portfolios_consumers_spec.rb +1 -1
  31. data/spec/support/fake_api.rb +33 -0
  32. data/spec/support/fixtures/consumer_login_token.json +23 -0
  33. data/spec/support/fixtures/operator_login_token.json +18 -0
  34. metadata +59 -68
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f2a3cc29031a78b597ac3fadc86765e2d53fd1a9d5461ab484f565c7b9142f1
4
- data.tar.gz: 03cd2d0d21472ed22851506db157dc464beebb691cfa12d7f37852630c8939af
3
+ metadata.gz: 7266aadcc1504a05cf4417d5baa37bea3a70b190568aac2a6b74f817f71febc8
4
+ data.tar.gz: 33dd9d6926956a0c90d2cd22784ccc8767d52562e136db9e330f41a0fee8b82f
5
5
  SHA512:
6
- metadata.gz: 9f2c6a4534249d60fd3ee49fc29d810b47ebbc9984eddd55945bf0d1ba604d1062289bb0bbaee5e8b2c4174627ae243440c3a9ee3fe5dd28667490b341b82c53
7
- data.tar.gz: 65ca4b08c104b8c7201acb063b9d8c501143695dca17bbefc2b23451772878dd195a248c1f4e25a027203c2f3896c71013b666389f92f5839caf53a9bfd41ce2
6
+ metadata.gz: f516163b74e56120837b6c38150f72dc598d214554942c0c9d45eeb7ef8dda0f4f8f57be5b37f2b69c255ce151363de5e9c1fcd68f6f0a9f83ce2e9b96407a9f
7
+ data.tar.gz: d4e8b744c64ea42c79aadeb2fc7513eba325fb0084f5ae253c48d8cf8f09c57880beb7cc4b2ddaf946ee6628b16c6faf86f1caaede3bf2d246f81c26972b1e89
@@ -20,7 +20,7 @@ jobs:
20
20
  runs-on: ${{ matrix.os }}
21
21
  steps:
22
22
  - name: Checkout source code
23
- uses: actions/checkout@v2
23
+ uses: actions/checkout@v2.3.4
24
24
 
25
25
  - name: Install required ruby version
26
26
  uses: ruby/setup-ruby@v1
@@ -11,7 +11,7 @@ jobs:
11
11
 
12
12
  steps:
13
13
  - name: Checkout source code
14
- uses: actions/checkout@v2
14
+ uses: actions/checkout@v2.3.4
15
15
  with:
16
16
  persist-credentials: false
17
17
  fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
@@ -7,7 +7,7 @@ jobs:
7
7
  label:
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
- - uses: mheap/github-action-required-labels@v1
10
+ - uses: mheap/github-action-required-labels@v1.1.2
11
11
  with:
12
12
  mode: minimum
13
13
  count: 1
data/.rubocop.yml CHANGED
@@ -47,6 +47,7 @@ Metrics/ClassLength:
47
47
  Exclude:
48
48
  - app/controllers/orders_controller.rb
49
49
  - app/models/order.rb
50
+ - spec/support/fake_api.rb
50
51
  Metrics/BlockLength:
51
52
  IgnoredMethods: ['describe', 'context']
52
53
  Exclude:
data/finapps.gemspec CHANGED
@@ -20,15 +20,14 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = Dir['spec/**/*.rb']
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_runtime_dependency 'finapps_core', '~> 5.0', '>= 5.0.16'
23
+ spec.add_runtime_dependency 'finapps_core', '~> 6.0', '>= 6.0.0'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 2.2', '>= 2.2.16'
26
26
  spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
27
27
  spec.add_development_dependency 'rspec', '~> 3.10', '>= 3.10.0'
28
- spec.add_development_dependency 'rubocop', '~> 1.9', '>= 1.9.1'
29
28
  spec.add_development_dependency 'rubocop-performance', '~> 1.9', '>= 1.9.2'
30
29
  spec.add_development_dependency 'rubocop-rake', '~> 0.5', '>= 0.5.1'
31
- spec.add_development_dependency 'rubocop-rspec', '~> 2.2', '>= 2.2.0'
30
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.4', '>= 2.4.0'
32
31
  spec.add_development_dependency 'simplecov', '~> 0.21', '>= 0.21.2'
33
32
  spec.add_development_dependency 'simplecov-console', '~> 0.9'
34
33
  spec.add_development_dependency 'sinatra', '~> 2.1', '>= 2.1.0'
data/lib/finapps.rb CHANGED
@@ -6,6 +6,7 @@ require 'faraday_middleware'
6
6
  require 'finapps_core'
7
7
  require 'finapps/rest/version'
8
8
  require 'finapps/rest/consumers'
9
+ require 'finapps/rest/consumer_login_tokens'
9
10
  require 'finapps/rest/sessions'
10
11
  require 'finapps/rest/order_tokens'
11
12
  require 'finapps/rest/orders'
@@ -14,7 +15,9 @@ require 'finapps/rest/order_statuses'
14
15
  require 'finapps/rest/order_notifications'
15
16
  require 'finapps/rest/password_resets'
16
17
  require 'finapps/rest/operators'
18
+ require 'finapps/rest/operator_login_tokens'
17
19
  require 'finapps/rest/operators_password_resets'
20
+ require 'finapps/rest/operator_change_password_email'
18
21
  require 'finapps/rest/products'
19
22
  require 'finapps/rest/order_assignments'
20
23
  require 'finapps/rest/client'
@@ -10,6 +10,7 @@ module FinApps
10
10
  alert_definitions
11
11
  alert_occurrences
12
12
  consumers
13
+ consumer_login_tokens
13
14
  consumers_portfolios
14
15
  documents_orders
15
16
  documents_orders_notifications
@@ -24,7 +25,9 @@ module FinApps
24
25
  order_statuses
25
26
  order_tokens
26
27
  operators
28
+ operator_login_tokens
27
29
  operators_password_resets
30
+ operator_change_password_email
28
31
  password_resets
29
32
  plaid_webhooks
30
33
  plaid_consumer_institutions
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FinApps
4
+ module REST
5
+ class ConsumerLoginTokens < FinAppsCore::REST::Resources
6
+ def create(params)
7
+ not_blank(params, :params)
8
+ super params, 'login/token'
9
+ end
10
+ end
11
+ end
12
+ end
@@ -56,7 +56,7 @@ module FinApps
56
56
  def search_query(term)
57
57
  query = with_space_search(term).concat(name_search(term))
58
58
  {
59
- "$or": query
59
+ '$or': query
60
60
  }
61
61
  end
62
62
 
@@ -75,28 +75,28 @@ module FinApps
75
75
  return {} unless term
76
76
 
77
77
  query = with_space_search(term).concat(name_search(term))
78
- {"$or": query}
78
+ {'$or': query}
79
79
  end
80
80
 
81
81
  def name_search(term)
82
82
  search_arr = []
83
83
  if /\s/.match?(term)
84
84
  term.split.each do |t|
85
- search_arr.append("applicant.first_name": t)
86
- search_arr.append("applicant.last_name": t)
85
+ search_arr.append('applicant.first_name': t)
86
+ search_arr.append('applicant.last_name': t)
87
87
  end
88
88
  end
89
89
  search_arr
90
90
  end
91
91
 
92
92
  def with_space_search(term)
93
- [{"applicant.email": term},
94
- {"applicant.first_name": term},
95
- {"applicant.last_name": term},
96
- {"applicant.external_id": term},
93
+ [{'applicant.email': term},
94
+ {'applicant.first_name': term},
95
+ {'applicant.last_name': term},
96
+ {'applicant.external_id': term},
97
97
  {
98
98
  reference_no: {
99
- "$regex": "^#{term}", "$options": 'i'
99
+ '$regex': "^#{term}", '$options': 'i'
100
100
  }
101
101
  }]
102
102
  end
@@ -9,7 +9,7 @@ module FinApps
9
9
 
10
10
  path =
11
11
  "consumers/#{ERB::Util.url_encode(consumer_id)}/"\
12
- "documents/#{ERB::Util.url_encode(doc_id)}?thumbnail=#{thumbnail}"
12
+ "documents/#{ERB::Util.url_encode(doc_id)}?thumbnail=#{thumbnail}"
13
13
  super(nil, path)
14
14
  end
15
15
 
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FinApps
4
+ module REST
5
+ class OperatorChangePasswordEmail < FinAppsCore::REST::Resources
6
+ def create(params)
7
+ not_blank(params, :params)
8
+ super params, 'login/change_password_email'
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FinApps
4
+ module REST
5
+ class OperatorLoginTokens < FinAppsCore::REST::Resources
6
+ def create(params)
7
+ not_blank(params, :params)
8
+ super params, 'login/operators/token'
9
+ end
10
+ end
11
+ end
12
+ end
@@ -69,7 +69,7 @@ module FinApps
69
69
 
70
70
  def role_query(role)
71
71
  if role.is_a?(Array)
72
- {role: {"$in": role.map(&:to_i)}}
72
+ {role: {'$in': role.map(&:to_i)}}
73
73
  else
74
74
  {role: role.to_i}
75
75
  end
@@ -66,28 +66,28 @@ module FinApps
66
66
  return {} unless term
67
67
 
68
68
  query = search_query_object(term).concat(consumer_name_query(term))
69
- {"$or": query}
69
+ {'$or': query}
70
70
  end
71
71
 
72
72
  def consumer_name_query(term)
73
73
  search_arr = []
74
74
  if /\s/.match?(term)
75
75
  term.split.each do |t|
76
- search_arr.append("applicant.first_name": t)
77
- search_arr.append("applicant.last_name": t)
76
+ search_arr.append('applicant.first_name': t)
77
+ search_arr.append('applicant.last_name': t)
78
78
  end
79
79
  end
80
80
  search_arr
81
81
  end
82
82
 
83
83
  def search_query_object(term)
84
- [{public_id: {"$regex": "^#{term}", "$options": 'i'}},
85
- {"assignment.last_name": term},
86
- {"applicant.first_name": term},
87
- {"applicant.last_name": term},
84
+ [{public_id: {'$regex': "^#{term}", '$options': 'i'}},
85
+ {'assignment.last_name': term},
86
+ {'applicant.first_name': term},
87
+ {'applicant.last_name': term},
88
88
  {
89
- "requestor.reference_no": {
90
- "$regex": "^#{term}", "$options": 'i'
89
+ 'requestor.reference_no': {
90
+ '$regex': "^#{term}", '$options': 'i'
91
91
  }
92
92
  }]
93
93
  end
@@ -95,7 +95,7 @@ module FinApps
95
95
  def status_query(status)
96
96
  if status
97
97
  if status.is_a?(Array)
98
- {status: {"$in": status.map(&:to_i)}}
98
+ {status: {'$in': status.map(&:to_i)}}
99
99
  else
100
100
  {status: status.to_i}
101
101
  end
@@ -107,7 +107,7 @@ module FinApps
107
107
  def assignment_query(assignment)
108
108
  # translate "" to null assignment
109
109
  if assignment
110
- {"assignment.operator_id": assignment.empty? ? nil : assignment}
110
+ {'assignment.operator_id': assignment.empty? ? nil : assignment}
111
111
  else
112
112
  {}
113
113
  end
@@ -124,9 +124,9 @@ module FinApps
124
124
  def relation_query(relation, search_term)
125
125
  if !search_term && !nil_or_empty?(relation)
126
126
  {
127
- "$or": [
128
- {public_id: {"$in": relation}},
129
- {original_order_id: {"$in": relation}}
127
+ '$or': [
128
+ {public_id: {'$in': relation}},
129
+ {original_order_id: {'$in': relation}}
130
130
  ]
131
131
  }
132
132
  else
@@ -62,13 +62,13 @@ module FinApps
62
62
  return {} unless term
63
63
 
64
64
  query = search_query_object(term)
65
- {"$or": query}
65
+ {'$or': query}
66
66
  end
67
67
 
68
68
  def search_query_object(term)
69
69
  [
70
- {"consumer.public_id": term},
71
- {"consumer.email": term}
70
+ {'consumer.public_id': term},
71
+ {'consumer.email': term}
72
72
  ]
73
73
  end
74
74
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '5.4.1'
4
+ VERSION = '6.3.0'
5
5
  end
@@ -46,7 +46,7 @@ RSpec.describe FinApps::REST::AlertDefinitions do
46
46
  list
47
47
  url =
48
48
  "#{versioned_api_path}/portfolio/alerts/definitions?page=2&requested=25&" \
49
- 'sort=-created_date'
49
+ 'sort=-created_date'
50
50
  expect(WebMock).to have_requested(:get, url)
51
51
  end
52
52
  end
@@ -53,7 +53,7 @@ RSpec.describe FinApps::REST::AlertOccurrences do
53
53
  list
54
54
  url =
55
55
  "#{versioned_api_path}/portfolio/alerts/occurrences?" \
56
- 'filter=%7B%22portfolio_id%22:%22valid_id%22%7D&page=2&requested=25&sort=-created_date'
56
+ 'filter=%7B%22portfolio_id%22:%22valid_id%22%7D&page=2&requested=25&sort=-created_date'
57
57
  expect(WebMock).to have_requested(:get, url)
58
58
  end
59
59
  end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helpers/client'
4
+
5
+ RSpec.describe FinApps::REST::ConsumerLoginTokens do
6
+ context 'when initialized with valid FinApps::Client object' do
7
+ include SpecHelpers::Client
8
+ subject(:consumer_login_tokens) { described_class.new(client) }
9
+
10
+ describe '#create' do
11
+ let(:results) { create[0] }
12
+ let(:error_messages) { create[1] }
13
+
14
+ context 'when missing params' do
15
+ let(:create) { consumer_login_tokens.create(nil) }
16
+
17
+ error = FinAppsCore::MissingArgumentsError
18
+ it { expect { create }.to raise_error(error) }
19
+ end
20
+
21
+ context 'when invalid params are provided' do
22
+ let(:create) { consumer_login_tokens.create(params: 'invalid') }
23
+
24
+ it { expect { create }.not_to raise_error }
25
+ it('results is nil') { expect(results).to be_nil }
26
+
27
+ it('error messages array is populated') do
28
+ expect(error_messages.first.downcase).to eq('invalid request body')
29
+ end
30
+ end
31
+
32
+ context 'when valid params are provided' do
33
+ let(:create) { consumer_login_tokens.create(params: 'valid') }
34
+
35
+ it { expect { create }.not_to raise_error }
36
+ it('returns an array') { expect(create).to be_a(Array) }
37
+ it { expect(results).to have_key(:public_id) }
38
+ it { expect(results).to have_key(:external_id) }
39
+ it { expect(results).to have_key(:tenant_id) }
40
+ it { expect(results).to have_key(:role) }
41
+ it { expect(results).to have_key(:memo) }
42
+ it { expect(results).to have_key(:token) }
43
+ it('returns no error messages') { expect(error_messages).to be_empty }
44
+ end
45
+ end
46
+ end
47
+ end
@@ -56,7 +56,7 @@ RSpec.describe FinApps::REST::ConsumersPortfolios do
56
56
  list
57
57
  url =
58
58
  "#{versioned_api_path}/consumers/#{id}/portfolios?page=2&" \
59
- 'requested=25&sort=-created_date'
59
+ 'requested=25&sort=-created_date'
60
60
  expect(WebMock).to have_requested(:get, url)
61
61
  end
62
62
  end
@@ -119,11 +119,11 @@ RSpec.describe FinApps::REST::Consumers do
119
119
  it 'builds query and sends proper request' do
120
120
  list
121
121
  filter = '{"$or":['\
122
- '{"external_id":"term"},'\
123
- '{"email":"term"},'\
124
- '{"first_name":"term"},'\
125
- '{"last_name":"term"}'\
126
- ']}'
122
+ '{"external_id":"term"},'\
123
+ '{"email":"term"},'\
124
+ '{"first_name":"term"},'\
125
+ '{"last_name":"term"}'\
126
+ ']}'
127
127
  query = "?filter=#{filter}&page=2&requested=25&sort=date_created"
128
128
  url = "#{versioned_api_path}/consumers#{query}"
129
129
  expect(WebMock).to have_requested(:get, url)
@@ -142,15 +142,15 @@ RSpec.describe FinApps::REST::Consumers do
142
142
  it 'treats space as start of a new query for first and last name' do
143
143
  list
144
144
  filter = '{"$or":['\
145
- '{"external_id":"Two terms"},'\
146
- '{"email":"Two terms"},'\
147
- '{"first_name":"Two terms"},'\
148
- '{"last_name":"Two terms"},'\
149
- '{"first_name":"Two"},'\
150
- '{"last_name":"Two"},'\
151
- '{"first_name":"terms"},'\
152
- '{"last_name":"terms"}'\
153
- ']}'
145
+ '{"external_id":"Two terms"},'\
146
+ '{"email":"Two terms"},'\
147
+ '{"first_name":"Two terms"},'\
148
+ '{"last_name":"Two terms"},'\
149
+ '{"first_name":"Two"},'\
150
+ '{"last_name":"Two"},'\
151
+ '{"first_name":"terms"},'\
152
+ '{"last_name":"terms"}'\
153
+ ']}'
154
154
  query = "?filter=#{filter}&page=2&requested=25&sort=date_created"
155
155
  url = "#{versioned_api_path}/consumers#{query}"
156
156
  expect(WebMock).to have_requested(:get, url)
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helpers/client'
4
+
5
+ RSpec.describe FinApps::REST::OperatorChangePasswordEmail do
6
+ context 'when initialized with valid FinApps::Client object' do
7
+ include SpecHelpers::Client
8
+ subject(:operators_change_password_email) do
9
+ described_class.new(client)
10
+ end
11
+
12
+ describe '#create' do
13
+ let(:results) { create[0] }
14
+ let(:error_messages) { create[1] }
15
+
16
+ context 'when missing params' do
17
+ let(:create) { subject.create(nil) }
18
+
19
+ it do
20
+ expect { create }.to raise_error(FinAppsCore::MissingArgumentsError)
21
+ end
22
+ end
23
+
24
+ context 'with valid params' do
25
+ let(:create) { subject.create(email: 'valid email') }
26
+
27
+ it('doesn\'t raise an error') { expect { create }.not_to raise_error }
28
+ it('doesn\'t have a response') { expect(results).to be_nil }
29
+ it('returns no error messages') { expect(error_messages).to be_empty }
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helpers/client'
4
+
5
+ RSpec.describe FinApps::REST::OperatorLoginTokens do
6
+ context 'when initialized with valid FinApps::Client object' do
7
+ include SpecHelpers::Client
8
+ subject(:operator_login_tokens) { described_class.new(client) }
9
+
10
+ describe '#create' do
11
+ let(:results) { create[0] }
12
+ let(:error_messages) { create[1] }
13
+
14
+ context 'when missing params' do
15
+ let(:create) { subject.create(nil) }
16
+
17
+ error = FinAppsCore::MissingArgumentsError
18
+ it { expect { create }.to raise_error(error) }
19
+ end
20
+
21
+ context 'when invalid params are provided' do
22
+ let(:create) { subject.create(params: 'invalid') }
23
+
24
+ it { expect { create }.not_to raise_error }
25
+ it('results is nil') { expect(results).to be_nil }
26
+
27
+ it('error messages array is populated') do
28
+ expect(error_messages.first.downcase).to eq('invalid request body')
29
+ end
30
+ end
31
+
32
+ context 'when valid params are provided' do
33
+ let(:create) { subject.create(params: 'valid') }
34
+
35
+ it { expect { create }.not_to raise_error }
36
+ it('returns an array') { expect(create).to be_a(Array) }
37
+ it { expect(results).to have_key(:public_id) }
38
+ it { expect(results).to have_key(:role) }
39
+ it('returns no error messages') { expect(error_messages).to be_empty }
40
+ end
41
+ end
42
+ end
43
+ end
@@ -61,7 +61,7 @@ RSpec.describe FinApps::REST::Operators do
61
61
  list
62
62
  url =
63
63
  "#{versioned_api_path}/operators?filter=%7B%22last_name%22:%22term%22," \
64
- '%22role%22:2%7D&page=2&requested=25&sort=date_created'
64
+ '%22role%22:2%7D&page=2&requested=25&sort=date_created'
65
65
  expect(WebMock).to have_requested(:get, url)
66
66
  end
67
67
  end
@@ -133,13 +133,13 @@ RSpec.describe FinApps::REST::Orders do
133
133
  it 'builds query and sends proper request' do
134
134
  list
135
135
  url = "#{versioned_api_path}/orders?"\
136
- 'filter=%7B%22$or%22:%5B%7B%22public_id%22:%7B%22$regex%22:%22%5E'\
137
- 'term%22,%22$options%22:%22i%22%7D%7D,%7B%22assignment.last_name%22:%22'\
138
- 'term%22%7D,%7B%22applicant.first_name%22:%22term%22%7D,%7B%22'\
139
- 'applicant.last_name%22:%22term%22%7D,%7B%22requestor.reference_no'\
140
- '%22:%7B%22$regex%22:%22%5Eterm%22,%22$options%22:%22i%22%7D%7D%5D,%22'\
141
- 'status%22:%7B%22$in%22:%5B1,7%5D%7D,%22assignment.operator_id%22:%22'\
142
- 'valid_operator%22,%22consumer_id%22:%22valid_consumer_id%22%7D&page=2&requested=25&sort=status'
136
+ 'filter=%7B%22$or%22:%5B%7B%22public_id%22:%7B%22$regex%22:%22%5E'\
137
+ 'term%22,%22$options%22:%22i%22%7D%7D,%7B%22assignment.last_name%22:%22'\
138
+ 'term%22%7D,%7B%22applicant.first_name%22:%22term%22%7D,%7B%22'\
139
+ 'applicant.last_name%22:%22term%22%7D,%7B%22requestor.reference_no'\
140
+ '%22:%7B%22$regex%22:%22%5Eterm%22,%22$options%22:%22i%22%7D%7D%5D,%22'\
141
+ 'status%22:%7B%22$in%22:%5B1,7%5D%7D,%22assignment.operator_id%22:%22'\
142
+ 'valid_operator%22,%22consumer_id%22:%22valid_consumer_id%22%7D&page=2&requested=25&sort=status'
143
143
  expect(WebMock).to have_requested(:get, url)
144
144
  end
145
145
 
@@ -147,12 +147,12 @@ RSpec.describe FinApps::REST::Orders do
147
147
  params[:searchTerm] = nil
148
148
  list
149
149
  url = "#{versioned_api_path}/orders?"\
150
- 'filter=%7B%22status%22:%7B%22$in%22:%5B1,7%5D%7D,' \
151
- '%22assignment.operator_id%22:%22valid_operator%22,'\
152
- '%22consumer_id%22:%22valid_consumer_id%22,' \
153
- '%22$or%22:%5B%7B%22public_id%22:%7B%22$in%22:%5B%22valid_order_id%22%5D%7D%7D,'\
154
- '%7B%22original_order_id%22:%7B%22$in%22:%5B%22valid_order_id%22%5D%7D%7D%5D%7D&'\
155
- 'page=2&requested=25&sort=status'
150
+ 'filter=%7B%22status%22:%7B%22$in%22:%5B1,7%5D%7D,' \
151
+ '%22assignment.operator_id%22:%22valid_operator%22,'\
152
+ '%22consumer_id%22:%22valid_consumer_id%22,' \
153
+ '%22$or%22:%5B%7B%22public_id%22:%7B%22$in%22:%5B%22valid_order_id%22%5D%7D%7D,'\
154
+ '%7B%22original_order_id%22:%7B%22$in%22:%5B%22valid_order_id%22%5D%7D%7D%5D%7D&'\
155
+ 'page=2&requested=25&sort=status'
156
156
  expect(WebMock).to have_requested(:get, url)
157
157
  end
158
158
 
@@ -160,16 +160,16 @@ RSpec.describe FinApps::REST::Orders do
160
160
  params[:searchTerm] = 'Spacing Out'
161
161
  list
162
162
  url = "#{versioned_api_path}/orders?"\
163
- 'filter=%7B%22$or%22:%5B%7B%22public_id%22:%7B%22$regex%22:%22%5E'\
164
- 'Spacing%20Out%22,%22$options%22:%22i%22%7D%7D,%7B%22assignment.last_name'\
165
- '%22:%22Spacing%20Out%22%7D,%7B%22applicant.first_name%22:%22'\
166
- 'Spacing%20Out%22%7D,%7B%22applicant.last_name%22:%22Spacing%20Out'\
167
- '%22%7D,%7B%22requestor.reference_no%22:%7B%22$regex%22:%22%5ESpacing%20Out'\
168
- '%22,%22$options%22:%22i%22%7D%7D,%7B%22applicant.first_name%22:%22Spacing'\
169
- '%22%7D,%7B%22applicant.last_name%22:%22Spacing%22%7D,%7B%22applicant.first_name'\
170
- '%22:%22Out%22%7D,%7B%22applicant.last_name%22:%22Out%22%7D%5D,%22status'\
171
- '%22:%7B%22$in%22:%5B1,7%5D%7D,%22assignment.operator_id%22:%22valid_operator'\
172
- '%22,%22consumer_id%22:%22valid_consumer_id%22%7D&page=2&requested=25&sort=status'
163
+ 'filter=%7B%22$or%22:%5B%7B%22public_id%22:%7B%22$regex%22:%22%5E'\
164
+ 'Spacing%20Out%22,%22$options%22:%22i%22%7D%7D,%7B%22assignment.last_name'\
165
+ '%22:%22Spacing%20Out%22%7D,%7B%22applicant.first_name%22:%22'\
166
+ 'Spacing%20Out%22%7D,%7B%22applicant.last_name%22:%22Spacing%20Out'\
167
+ '%22%7D,%7B%22requestor.reference_no%22:%7B%22$regex%22:%22%5ESpacing%20Out'\
168
+ '%22,%22$options%22:%22i%22%7D%7D,%7B%22applicant.first_name%22:%22Spacing'\
169
+ '%22%7D,%7B%22applicant.last_name%22:%22Spacing%22%7D,%7B%22applicant.first_name'\
170
+ '%22:%22Out%22%7D,%7B%22applicant.last_name%22:%22Out%22%7D%5D,%22status'\
171
+ '%22:%7B%22$in%22:%5B1,7%5D%7D,%22assignment.operator_id%22:%22valid_operator'\
172
+ '%22,%22consumer_id%22:%22valid_consumer_id%22%7D&page=2&requested=25&sort=status'
173
173
  expect(WebMock).to have_requested(:get, url)
174
174
  end
175
175
 
@@ -177,7 +177,7 @@ RSpec.describe FinApps::REST::Orders do
177
177
  described_class.new(client).list(assignment: '')
178
178
 
179
179
  url = "#{versioned_api_path}/orders?"\
180
- 'filter=%7B%22assignment.operator_id%22:null%7D'
180
+ 'filter=%7B%22assignment.operator_id%22:null%7D'
181
181
  expect(WebMock).to have_requested(:get, url)
182
182
  end
183
183
  end
@@ -46,7 +46,7 @@ RSpec.describe FinApps::REST::PortfolioReports do
46
46
  list
47
47
  url =
48
48
  "#{versioned_api_path}/portfolio/reports?page=2&requested=25&" \
49
- 'sort=-created_date'
49
+ 'sort=-created_date'
50
50
  expect(WebMock).to have_requested(:get, url)
51
51
  end
52
52
  end
@@ -56,7 +56,7 @@ RSpec.describe FinApps::REST::PortfoliosAvailableConsumers do
56
56
  list
57
57
  url =
58
58
  "#{versioned_api_path}/portfolios/#{id}/consumers/available?page=2&" \
59
- 'requested=25&sort=-created_date'
59
+ 'requested=25&sort=-created_date'
60
60
  expect(WebMock).to have_requested(:get, url)
61
61
  end
62
62
  end
@@ -56,7 +56,7 @@ RSpec.describe FinApps::REST::PortfoliosConsumers do
56
56
  list
57
57
  url =
58
58
  "#{versioned_api_path}/portfolios/#{portfolio_id}/consumers?page=2&" \
59
- 'requested=25&sort=-created_date'
59
+ 'requested=25&sort=-created_date'
60
60
  expect(WebMock).to have_requested(:get, url)
61
61
  end
62
62
  end
@@ -358,6 +358,39 @@ module Fake
358
358
  end
359
359
  end
360
360
 
361
+ # operators login tokens
362
+ post("/#{version}/login/token") do
363
+ request.body.rewind
364
+ request_payload = JSON.parse request.body.read
365
+ if request_payload['params'] == 'valid'
366
+ json_response 200, 'operator_login_token.json'
367
+ else
368
+ json_response 400, 'invalid_request_body.json'
369
+ end
370
+ end
371
+
372
+ # operators login tokens
373
+ post("/#{version}/login/operators/token") do
374
+ request.body.rewind
375
+ request_payload = JSON.parse request.body.read
376
+ if request_payload['params'] == 'valid'
377
+ json_response 200, 'consumer_login_token.json'
378
+ else
379
+ json_response 400, 'invalid_request_body.json'
380
+ end
381
+ end
382
+
383
+ # operator change password email
384
+ post("/#{version}/login/change_password_email") do
385
+ request.body.rewind
386
+ request_payload = JSON.parse request.body.read
387
+ if request_payload['email'] == 'valid email'
388
+ status 200
389
+ else
390
+ json_response 404, 'resource_not_found.json'
391
+ end
392
+ end
393
+
361
394
  # session
362
395
  post("/#{version}/login") do
363
396
  request.body.rewind
@@ -0,0 +1,23 @@
1
+ {
2
+ "auth0_id": "string",
3
+ "date_created": "2021-07-19T13:04:09Z",
4
+ "date_modified": "2021-07-19T13:04:09Z",
5
+ "email": "string",
6
+ "external_id": "string",
7
+ "first_name": "string",
8
+ "last_name": "string",
9
+ "locked": true,
10
+ "memo": "string",
11
+ "metadata": {
12
+ "property1": { },
13
+ "property2": { }
14
+ },
15
+ "phone": "string",
16
+ "phone_country_code": "string",
17
+ "postal_code": "string",
18
+ "public_id": "string",
19
+ "role": 0,
20
+ "status": 0,
21
+ "tenant_id": "string",
22
+ "token": "string"
23
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "auth0_id": "string",
3
+ "date_created": "2021-07-16T19:14:23Z",
4
+ "date_modified": "2021-07-16T19:14:23Z",
5
+ "email": "string",
6
+ "external_id": "string",
7
+ "first_name": "string",
8
+ "last_name": "string",
9
+ "locked": true,
10
+ "memo": "string",
11
+ "phone": "string",
12
+ "phone_country_code": "string",
13
+ "public_id": "string",
14
+ "role": 0,
15
+ "status": 0,
16
+ "tenant_id": "string",
17
+ "token": "string"
18
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finapps
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.1
4
+ version: 6.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-30 00:00:00.000000000 Z
11
+ date: 2021-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: '6.0'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 5.0.16
22
+ version: 6.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '5.0'
29
+ version: '6.0'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 5.0.16
32
+ version: 6.0.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -90,26 +90,6 @@ dependencies:
90
90
  - - ">="
91
91
  - !ruby/object:Gem::Version
92
92
  version: 3.10.0
93
- - !ruby/object:Gem::Dependency
94
- name: rubocop
95
- requirement: !ruby/object:Gem::Requirement
96
- requirements:
97
- - - "~>"
98
- - !ruby/object:Gem::Version
99
- version: '1.9'
100
- - - ">="
101
- - !ruby/object:Gem::Version
102
- version: 1.9.1
103
- type: :development
104
- prerelease: false
105
- version_requirements: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - "~>"
108
- - !ruby/object:Gem::Version
109
- version: '1.9'
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- version: 1.9.1
113
93
  - !ruby/object:Gem::Dependency
114
94
  name: rubocop-performance
115
95
  requirement: !ruby/object:Gem::Requirement
@@ -156,20 +136,20 @@ dependencies:
156
136
  requirements:
157
137
  - - "~>"
158
138
  - !ruby/object:Gem::Version
159
- version: '2.2'
139
+ version: '2.4'
160
140
  - - ">="
161
141
  - !ruby/object:Gem::Version
162
- version: 2.2.0
142
+ version: 2.4.0
163
143
  type: :development
164
144
  prerelease: false
165
145
  version_requirements: !ruby/object:Gem::Requirement
166
146
  requirements:
167
147
  - - "~>"
168
148
  - !ruby/object:Gem::Version
169
- version: '2.2'
149
+ version: '2.4'
170
150
  - - ">="
171
151
  - !ruby/object:Gem::Version
172
- version: 2.2.0
152
+ version: 2.4.0
173
153
  - !ruby/object:Gem::Dependency
174
154
  name: simplecov
175
155
  requirement: !ruby/object:Gem::Requirement
@@ -281,6 +261,7 @@ files:
281
261
  - lib/finapps/rest/alert_definitions.rb
282
262
  - lib/finapps/rest/alert_occurrences.rb
283
263
  - lib/finapps/rest/client.rb
264
+ - lib/finapps/rest/consumer_login_tokens.rb
284
265
  - lib/finapps/rest/consumers.rb
285
266
  - lib/finapps/rest/consumers_portfolios.rb
286
267
  - lib/finapps/rest/documents_orders.rb
@@ -288,6 +269,8 @@ files:
288
269
  - lib/finapps/rest/documents_upload_types.rb
289
270
  - lib/finapps/rest/documents_uploads.rb
290
271
  - lib/finapps/rest/esign_templates.rb
272
+ - lib/finapps/rest/operator_change_password_email.rb
273
+ - lib/finapps/rest/operator_login_tokens.rb
291
274
  - lib/finapps/rest/operators.rb
292
275
  - lib/finapps/rest/operators_password_resets.rb
293
276
  - lib/finapps/rest/order_assignments.rb
@@ -326,6 +309,7 @@ files:
326
309
  - spec/rest/alert_occurrences_spec.rb
327
310
  - spec/rest/api_request.rb
328
311
  - spec/rest/client_spec.rb
312
+ - spec/rest/consumer_login_tokens_spec.rb
329
313
  - spec/rest/consumers_portfolios_spec.rb
330
314
  - spec/rest/consumers_spec.rb
331
315
  - spec/rest/documents_orders_notifications_spec.rb
@@ -333,6 +317,8 @@ files:
333
317
  - spec/rest/documents_upload_types_spec.rb
334
318
  - spec/rest/documents_uploads_spec.rb
335
319
  - spec/rest/esign_templates_spec.rb
320
+ - spec/rest/operator_change_password_email_spec.rb
321
+ - spec/rest/operators_login_tokens_spec.rb
336
322
  - spec/rest/operators_password_resets_spec.rb
337
323
  - spec/rest/operators_spec.rb
338
324
  - spec/rest/order_assignments_spec.rb
@@ -371,6 +357,7 @@ files:
371
357
  - spec/support/fixtures/alert_definition.json
372
358
  - spec/support/fixtures/alert_definitions.json
373
359
  - spec/support/fixtures/alert_occurrences.json
360
+ - spec/support/fixtures/consumer_login_token.json
374
361
  - spec/support/fixtures/documents/retrieve_order.json
375
362
  - spec/support/fixtures/documents_order.json
376
363
  - spec/support/fixtures/documents_orders.json
@@ -388,6 +375,7 @@ files:
388
375
  - spec/support/fixtures/operator.json
389
376
  - spec/support/fixtures/operator_forgot_password.json
390
377
  - spec/support/fixtures/operator_list.json
378
+ - spec/support/fixtures/operator_login_token.json
391
379
  - spec/support/fixtures/order.json
392
380
  - spec/support/fixtures/order_refresh.json
393
381
  - spec/support/fixtures/order_report.json
@@ -471,51 +459,54 @@ signing_key:
471
459
  specification_version: 4
472
460
  summary: FinApps REST API ruby client.
473
461
  test_files:
474
- - spec/utils/query_builder_spec.rb
475
- - spec/spec_helper.rb
476
- - spec/support/documents_uploads_routes.rb
477
- - spec/support/screenings_routes.rb
478
- - spec/support/fake_api.rb
479
- - spec/spec_helpers/client.rb
462
+ - spec/rest/order_refreshes_spec.rb
463
+ - spec/rest/documents_orders_notifications_spec.rb
464
+ - spec/rest/operators_password_resets_spec.rb
465
+ - spec/rest/operators_spec.rb
466
+ - spec/rest/tenant_settings_spec.rb
467
+ - spec/rest/api_request.rb
480
468
  - spec/rest/password_resets_spec.rb
481
- - spec/rest/order_reports_spec.rb
482
- - spec/rest/order_statuses_spec.rb
483
- - spec/rest/plaid/plaid_account_permissions_spec.rb
484
- - spec/rest/plaid/plaid_institution_logos_spec.rb
469
+ - spec/rest/products_spec.rb
470
+ - spec/rest/verix/verix_metadata_spec.rb
471
+ - spec/rest/verix/verix_records_spec.rb
472
+ - spec/rest/verix/verix_documents_spec.rb
473
+ - spec/rest/verix/verix_pdf_documents_spec.rb
474
+ - spec/rest/documents_uploads_spec.rb
475
+ - spec/rest/alert_occurrences_spec.rb
476
+ - spec/rest/consumers_portfolios_spec.rb
477
+ - spec/rest/esign_templates_spec.rb
478
+ - spec/rest/orders_spec.rb
485
479
  - spec/rest/plaid/plaid_accounts_spec.rb
480
+ - spec/rest/plaid/plaid_institution_logos_spec.rb
486
481
  - spec/rest/plaid/plaid_consumer_institutions_spec.rb
482
+ - spec/rest/plaid/plaid_account_permissions_spec.rb
487
483
  - spec/rest/plaid/plaid_webhooks_spec.rb
488
- - spec/rest/api_request.rb
489
- - spec/rest/orders_spec.rb
490
- - spec/rest/screenings_spec.rb
491
- - spec/rest/documents_orders_notifications_spec.rb
492
- - spec/rest/documents_upload_types_spec.rb
493
- - spec/rest/consumers_portfolios_spec.rb
494
- - spec/rest/consumers_spec.rb
495
- - spec/rest/documents_uploads_spec.rb
496
- - spec/rest/tenant_app_settings_spec.rb
497
- - spec/rest/signed_documents_downloads_spec.rb
484
+ - spec/rest/portfolios_consumers_spec.rb
485
+ - spec/rest/order_statuses_spec.rb
498
486
  - spec/rest/order_assignments_spec.rb
499
- - spec/rest/operators_spec.rb
500
- - spec/rest/documents_orders_spec.rb
501
- - spec/rest/tenant_settings_spec.rb
502
- - spec/rest/operators_password_resets_spec.rb
503
- - spec/rest/portfolios_spec.rb
487
+ - spec/rest/version_spec.rb
488
+ - spec/rest/portfolio_reports_spec.rb
504
489
  - spec/rest/order_tokens_spec.rb
505
490
  - spec/rest/order_notifications_spec.rb
506
491
  - spec/rest/sessions_spec.rb
507
- - spec/rest/verix/verix_documents_spec.rb
508
- - spec/rest/verix/verix_metadata_spec.rb
509
- - spec/rest/verix/verix_pdf_documents_spec.rb
510
- - spec/rest/verix/verix_records_spec.rb
511
- - spec/rest/alert_occurrences_spec.rb
512
- - spec/rest/version_spec.rb
513
- - spec/rest/order_refreshes_spec.rb
514
- - spec/rest/alert_definitions_spec.rb
515
- - spec/rest/portfolios_available_consumers_spec.rb
516
- - spec/rest/products_spec.rb
517
492
  - spec/rest/client_spec.rb
493
+ - spec/rest/documents_orders_spec.rb
494
+ - spec/rest/portfolios_available_consumers_spec.rb
495
+ - spec/rest/consumers_spec.rb
496
+ - spec/rest/consumer_login_tokens_spec.rb
497
+ - spec/rest/screenings_spec.rb
498
+ - spec/rest/tenant_app_settings_spec.rb
499
+ - spec/rest/order_reports_spec.rb
500
+ - spec/rest/signed_documents_downloads_spec.rb
501
+ - spec/rest/operators_login_tokens_spec.rb
502
+ - spec/rest/operator_change_password_email_spec.rb
503
+ - spec/rest/documents_upload_types_spec.rb
518
504
  - spec/rest/portfolios_alerts_spec.rb
519
- - spec/rest/esign_templates_spec.rb
520
- - spec/rest/portfolio_reports_spec.rb
521
- - spec/rest/portfolios_consumers_spec.rb
505
+ - spec/rest/portfolios_spec.rb
506
+ - spec/rest/alert_definitions_spec.rb
507
+ - spec/spec_helpers/client.rb
508
+ - spec/support/fake_api.rb
509
+ - spec/support/screenings_routes.rb
510
+ - spec/support/documents_uploads_routes.rb
511
+ - spec/spec_helper.rb
512
+ - spec/utils/query_builder_spec.rb