finapps 6.0.0 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/lib/finapps.rb +1 -0
- data/lib/finapps/rest/client.rb +1 -0
- data/lib/finapps/rest/documents_uploads.rb +1 -1
- data/lib/finapps/rest/operator_login_tokens.rb +12 -0
- data/lib/finapps/version.rb +1 -1
- data/spec/rest/alert_definitions_spec.rb +1 -1
- data/spec/rest/alert_occurrences_spec.rb +1 -1
- data/spec/rest/consumers_portfolios_spec.rb +1 -1
- data/spec/rest/consumers_spec.rb +14 -14
- data/spec/rest/operators_login_tokens_spec.rb +43 -0
- data/spec/rest/operators_spec.rb +1 -1
- data/spec/rest/orders_spec.rb +24 -24
- data/spec/rest/portfolio_reports_spec.rb +1 -1
- data/spec/rest/portfolios_available_consumers_spec.rb +1 -1
- data/spec/rest/portfolios_consumers_spec.rb +1 -1
- data/spec/support/fake_api.rb +11 -0
- data/spec/support/fixtures/operator_login_token.json +18 -0
- metadata +40 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 287e012502599f7781e37f492a27d67c956fa2f4d94073163302f3c429da4d42
|
4
|
+
data.tar.gz: f7da81b6008ac880f6d028c3dc209945e65641f979d5c9d3d98580ab3deb7713
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f87c89de3b7915c3ecc54300cc31060b3ce39da36c860e4a539832e302e1576a560c31247925351a0eb798e32563a65f2358d265760c3078940e1f4e7c2aa88d
|
7
|
+
data.tar.gz: 6a8ac80500a6f696817efff46e1fd39a79feb6823ae4ab9693a2b588166bcf175ebcdede16d491b4410fd015d0e4519d45e81acc98e2f9f8b7adfbd85f63193f
|
data/.rubocop.yml
CHANGED
data/lib/finapps.rb
CHANGED
@@ -14,6 +14,7 @@ require 'finapps/rest/order_statuses'
|
|
14
14
|
require 'finapps/rest/order_notifications'
|
15
15
|
require 'finapps/rest/password_resets'
|
16
16
|
require 'finapps/rest/operators'
|
17
|
+
require 'finapps/rest/operator_login_tokens'
|
17
18
|
require 'finapps/rest/operators_password_resets'
|
18
19
|
require 'finapps/rest/products'
|
19
20
|
require 'finapps/rest/order_assignments'
|
data/lib/finapps/rest/client.rb
CHANGED
data/lib/finapps/version.rb
CHANGED
@@ -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
|
-
|
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
|
@@ -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
|
-
|
59
|
+
'requested=25&sort=-created_date'
|
60
60
|
expect(WebMock).to have_requested(:get, url)
|
61
61
|
end
|
62
62
|
end
|
data/spec/rest/consumers_spec.rb
CHANGED
@@ -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
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
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
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
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,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
|
data/spec/rest/operators_spec.rb
CHANGED
@@ -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
|
-
|
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
|
data/spec/rest/orders_spec.rb
CHANGED
@@ -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
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
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
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
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
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
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
|
-
|
180
|
+
'filter=%7B%22assignment.operator_id%22:null%7D'
|
181
181
|
expect(WebMock).to have_requested(:get, url)
|
182
182
|
end
|
183
183
|
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
|
-
|
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
|
-
|
59
|
+
'requested=25&sort=-created_date'
|
60
60
|
expect(WebMock).to have_requested(:get, url)
|
61
61
|
end
|
62
62
|
end
|
data/spec/support/fake_api.rb
CHANGED
@@ -358,6 +358,17 @@ module Fake
|
|
358
358
|
end
|
359
359
|
end
|
360
360
|
|
361
|
+
# operators login tokens
|
362
|
+
post("/#{version}/login/operators/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
|
+
|
361
372
|
# session
|
362
373
|
post("/#{version}/login") do
|
363
374
|
request.body.rewind
|
@@ -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: 6.
|
4
|
+
version: 6.1.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-
|
11
|
+
date: 2021-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: finapps_core
|
@@ -268,6 +268,7 @@ files:
|
|
268
268
|
- lib/finapps/rest/documents_upload_types.rb
|
269
269
|
- lib/finapps/rest/documents_uploads.rb
|
270
270
|
- lib/finapps/rest/esign_templates.rb
|
271
|
+
- lib/finapps/rest/operator_login_tokens.rb
|
271
272
|
- lib/finapps/rest/operators.rb
|
272
273
|
- lib/finapps/rest/operators_password_resets.rb
|
273
274
|
- lib/finapps/rest/order_assignments.rb
|
@@ -313,6 +314,7 @@ files:
|
|
313
314
|
- spec/rest/documents_upload_types_spec.rb
|
314
315
|
- spec/rest/documents_uploads_spec.rb
|
315
316
|
- spec/rest/esign_templates_spec.rb
|
317
|
+
- spec/rest/operators_login_tokens_spec.rb
|
316
318
|
- spec/rest/operators_password_resets_spec.rb
|
317
319
|
- spec/rest/operators_spec.rb
|
318
320
|
- spec/rest/order_assignments_spec.rb
|
@@ -368,6 +370,7 @@ files:
|
|
368
370
|
- spec/support/fixtures/operator.json
|
369
371
|
- spec/support/fixtures/operator_forgot_password.json
|
370
372
|
- spec/support/fixtures/operator_list.json
|
373
|
+
- spec/support/fixtures/operator_login_token.json
|
371
374
|
- spec/support/fixtures/order.json
|
372
375
|
- spec/support/fixtures/order_refresh.json
|
373
376
|
- spec/support/fixtures/order_report.json
|
@@ -451,51 +454,52 @@ signing_key:
|
|
451
454
|
specification_version: 4
|
452
455
|
summary: FinApps REST API ruby client.
|
453
456
|
test_files:
|
454
|
-
- spec/support/fake_api.rb
|
455
|
-
- spec/support/screenings_routes.rb
|
456
457
|
- spec/support/documents_uploads_routes.rb
|
457
|
-
- spec/
|
458
|
-
- spec/
|
458
|
+
- spec/support/screenings_routes.rb
|
459
|
+
- spec/support/fake_api.rb
|
459
460
|
- spec/utils/query_builder_spec.rb
|
460
|
-
- spec/
|
461
|
-
- spec/
|
462
|
-
- spec/rest/consumers_spec.rb
|
461
|
+
- spec/spec_helpers/client.rb
|
462
|
+
- spec/spec_helper.rb
|
463
463
|
- spec/rest/order_reports_spec.rb
|
464
|
+
- spec/rest/api_request.rb
|
465
|
+
- spec/rest/operators_login_tokens_spec.rb
|
466
|
+
- spec/rest/tenant_app_settings_spec.rb
|
464
467
|
- spec/rest/products_spec.rb
|
468
|
+
- spec/rest/orders_spec.rb
|
469
|
+
- spec/rest/esign_templates_spec.rb
|
470
|
+
- spec/rest/sessions_spec.rb
|
471
|
+
- spec/rest/order_assignments_spec.rb
|
472
|
+
- spec/rest/documents_orders_spec.rb
|
465
473
|
- spec/rest/order_tokens_spec.rb
|
466
|
-
- spec/rest/
|
467
|
-
- spec/rest/operators_spec.rb
|
474
|
+
- spec/rest/order_notifications_spec.rb
|
468
475
|
- spec/rest/order_refreshes_spec.rb
|
469
|
-
- spec/rest/client_spec.rb
|
470
|
-
- spec/rest/signed_documents_downloads_spec.rb
|
471
|
-
- spec/rest/documents_orders_spec.rb
|
472
|
-
- spec/rest/screenings_spec.rb
|
473
|
-
- spec/rest/portfolios_consumers_spec.rb
|
474
|
-
- spec/rest/tenant_app_settings_spec.rb
|
475
|
-
- spec/rest/alert_definitions_spec.rb
|
476
|
-
- spec/rest/documents_uploads_spec.rb
|
477
|
-
- spec/rest/order_assignments_spec.rb
|
478
|
-
- spec/rest/verix/verix_documents_spec.rb
|
479
|
-
- spec/rest/verix/verix_records_spec.rb
|
480
|
-
- spec/rest/verix/verix_metadata_spec.rb
|
481
|
-
- spec/rest/verix/verix_pdf_documents_spec.rb
|
482
|
-
- spec/rest/portfolios_alerts_spec.rb
|
483
|
-
- spec/rest/api_request.rb
|
484
476
|
- spec/rest/plaid/plaid_accounts_spec.rb
|
485
477
|
- spec/rest/plaid/plaid_institution_logos_spec.rb
|
478
|
+
- spec/rest/plaid/plaid_account_permissions_spec.rb
|
486
479
|
- spec/rest/plaid/plaid_consumer_institutions_spec.rb
|
487
480
|
- spec/rest/plaid/plaid_webhooks_spec.rb
|
488
|
-
- spec/rest/
|
489
|
-
- spec/rest/
|
490
|
-
- spec/rest/
|
491
|
-
- spec/rest/
|
492
|
-
- spec/rest/
|
493
|
-
- spec/rest/
|
481
|
+
- spec/rest/verix/verix_pdf_documents_spec.rb
|
482
|
+
- spec/rest/verix/verix_metadata_spec.rb
|
483
|
+
- spec/rest/verix/verix_records_spec.rb
|
484
|
+
- spec/rest/verix/verix_documents_spec.rb
|
485
|
+
- spec/rest/portfolios_alerts_spec.rb
|
486
|
+
- spec/rest/operators_password_resets_spec.rb
|
494
487
|
- spec/rest/portfolio_reports_spec.rb
|
495
|
-
- spec/rest/
|
496
|
-
- spec/rest/
|
497
|
-
- spec/rest/sessions_spec.rb
|
498
|
-
- spec/rest/password_resets_spec.rb
|
488
|
+
- spec/rest/alert_definitions_spec.rb
|
489
|
+
- spec/rest/consumers_spec.rb
|
499
490
|
- spec/rest/tenant_settings_spec.rb
|
491
|
+
- spec/rest/signed_documents_downloads_spec.rb
|
500
492
|
- spec/rest/consumers_portfolios_spec.rb
|
493
|
+
- spec/rest/documents_upload_types_spec.rb
|
494
|
+
- spec/rest/documents_orders_notifications_spec.rb
|
495
|
+
- spec/rest/version_spec.rb
|
496
|
+
- spec/rest/documents_uploads_spec.rb
|
497
|
+
- spec/rest/client_spec.rb
|
498
|
+
- spec/rest/portfolios_consumers_spec.rb
|
501
499
|
- spec/rest/portfolios_spec.rb
|
500
|
+
- spec/rest/order_statuses_spec.rb
|
501
|
+
- spec/rest/alert_occurrences_spec.rb
|
502
|
+
- spec/rest/screenings_spec.rb
|
503
|
+
- spec/rest/operators_spec.rb
|
504
|
+
- spec/rest/password_resets_spec.rb
|
505
|
+
- spec/rest/portfolios_available_consumers_spec.rb
|