finapps 5.0.17 → 5.0.19

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: 5512d2f1ee03d53352b24c01d80f7d58828bd6ffe4e6ab2e58d716e1474de6a3
4
- data.tar.gz: 0706fa34a43305d15380c0a0ea3f655bed1cbb7439b084c2bbb440218d692e94
3
+ metadata.gz: a0149d16f03d34730c867cecd5403eafa545a86409873c53486d0de8389d6a24
4
+ data.tar.gz: 9e1d672c3b64ef9e403b8fa049ab10757ecdc5dd475e34c7b2547275b8f8d773
5
5
  SHA512:
6
- metadata.gz: 1a179a210092c0c7692c0ea843780cc6809e5dd8eaa43eba5a2663ea473562fee4d2a45cddc981bcd3a7145878e3b61e9b9ef66443365c207981f5a27834ab29
7
- data.tar.gz: f3ee33264346715bedc618730cecd2b0bf5489d9a18907b96defb36de6ab4dc9271fa5864b01f709d2ed8f77cc4babda4aaa435f6765b494576e7b198a6bd4b0
6
+ metadata.gz: ff86485841923122273e9edd26ce173f852f3de9df705825659f3c72cb10cddd633b0520133a9dcda15ba51df2c5c4abdb6b8ad44dfd50d9a3841ab05966f772
7
+ data.tar.gz: 57897eb362e78eb67cad51f8d3d130485006e4d61e01899f13b7fdcfa4e250091a67e1111ae60384c80497dcacd730a0aba20e424394cfc14f04ab1a44dd5580
data/.codeclimate.yml CHANGED
@@ -1,8 +1,9 @@
1
- engines:
1
+ ---
2
+ version: "2"
3
+ plugins:
2
4
  rubocop:
3
5
  enabled: true
4
- brakeman:
5
- enabled: false
6
+ channel: rubocop-0-74 # Minimum version to support ruby 2.6
6
7
  eslint:
7
8
  enabled: false
8
9
  csslint:
@@ -12,10 +13,12 @@ engines:
12
13
  config:
13
14
  languages:
14
15
  - ruby
16
+
15
17
  ratings:
16
18
  paths:
17
19
  - lib/**
18
20
  - "**.rb"
21
+
19
22
  exclude_paths:
20
23
  - spec/**/*
21
- - "**/vendor/**/*"
24
+ - "**/vendor/**/*"
data/.rubocop.yml CHANGED
@@ -8,11 +8,6 @@ AllCops:
8
8
  Metrics/LineLength:
9
9
  Max: 120
10
10
 
11
- # Re-enable this when the following is resolved:
12
- # https://github.com/rubocop-hq/rubocop/issues/5953
13
- Style/AccessModifierDeclarations:
14
- Enabled: false
15
-
16
11
  Style/CollectionMethods:
17
12
  Description: Preferred collection methods.
18
13
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
@@ -34,7 +29,7 @@ Naming/PredicateName:
34
29
  - is_
35
30
  - has_
36
31
  - have_
37
- NamePrefixBlacklist:
32
+ ForbiddenPrefixes:
38
33
  - is_
39
34
  Exclude:
40
35
  - spec/**/*
@@ -89,7 +84,3 @@ Style/VariableInterpolation:
89
84
  strings.
90
85
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
91
86
  Enabled: false
92
- Lint/HandleExceptions:
93
- Description: Don't suppress exception.
94
- StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
95
- Enabled: false
data/.travis.yml CHANGED
@@ -4,13 +4,11 @@ cache:
4
4
  bundler: true
5
5
 
6
6
  rvm:
7
- - 2.5
8
7
  - 2.6
9
8
 
10
9
  before_install:
11
10
  - "echo 'gem: --no-document' > ~/.gemrc"
12
- - gem update --system
13
- - gem install bundler --force
11
+ - gem install bundler --force --quiet
14
12
 
15
13
  script:
16
14
  - bundle exec rspec
data/lib/finapps.rb CHANGED
@@ -38,5 +38,8 @@ require 'finapps/rest/plaid/plaid_accounts'
38
38
  require 'finapps/rest/plaid/plaid_account_permissions'
39
39
  require 'finapps/rest/plaid/plaid_institution_logos'
40
40
 
41
+ require 'finapps/rest/verix/verix_metadata'
42
+ require 'finapps/rest/verix/verix_records'
43
+
41
44
  require 'finapps/utils/query_builder'
42
45
  require 'finapps/version' unless defined?(FinApps::VERSION)
@@ -36,6 +36,8 @@ module FinApps
36
36
  plaid_accounts
37
37
  plaid_account_permissions
38
38
  plaid_institution_logos
39
+ verix_metadata
40
+ verix_records
39
41
  ].freeze
40
42
 
41
43
  # @param [String] tenant_token
@@ -15,7 +15,7 @@ module FinApps
15
15
  begin
16
16
  super params, path
17
17
  rescue FinAppsCore::ApiUnauthenticatedError
18
- return(
18
+ (
19
19
  [
20
20
  nil,
21
21
  [
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FinApps
4
+ module REST
5
+ class VerixMetadata < FinAppsCore::REST::Resources # :nodoc:
6
+ def show
7
+ super nil, 'v/metadata'
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module FinApps
4
+ module REST
5
+ class VerixRecords < FinAppsCore::REST::Resources # :nodoc:
6
+ def create(params)
7
+ super(params, 'v/record')
8
+ end
9
+
10
+ def list
11
+ super 'v/record'
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinApps
4
- VERSION = '5.0.17'
4
+ VERSION = '5.0.19'
5
5
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helpers/client'
4
+ require 'rest/api_request'
5
+
6
+ RSpec.describe FinApps::REST::VerixMetadata do
7
+ include SpecHelpers::Client
8
+
9
+ # noinspection RubyBlockToMethodReference
10
+ let(:api_client) { client }
11
+
12
+ describe '#show' do
13
+ subject(:show) { FinApps::REST::VerixMetadata.new(api_client).show }
14
+
15
+ it_behaves_like 'an API request'
16
+ it_behaves_like 'a successful request'
17
+ it('returns the verix environment') { expect(show[RESULTS]).to have_key(:environment) }
18
+ it('returns the verix client id') { expect(show[RESULTS]).to have_key(:client_id) }
19
+ end
20
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helpers/client'
4
+ require 'rest/api_request'
5
+
6
+ RSpec.describe FinApps::REST::VerixRecords do
7
+ include SpecHelpers::Client
8
+
9
+ # noinspection RubyBlockToMethodReference
10
+ let(:api_client) { client }
11
+
12
+ describe '#create' do
13
+ subject(:create) do
14
+ FinApps::REST::VerixRecords.new(api_client).create(
15
+ code: 'authcode',
16
+ download: [
17
+ 'form_1040'
18
+ ]
19
+ )
20
+ end
21
+
22
+ it_behaves_like 'an API request'
23
+ it_behaves_like 'a successful request'
24
+ it('returns an id') { expect(create[RESULTS]).to have_key(:_id) }
25
+ it('returns a consumer id') { expect(create[RESULTS]).to have_key(:consumer_id) }
26
+ it('returns a status') { expect(create[RESULTS]).to have_key(:status) }
27
+ it('returns an error node') { expect(create[RESULTS]).to have_key(:error) }
28
+ it('returns a list of documents') { expect(create[RESULTS]).to have_key(:documents) }
29
+ it('returns a document count') { expect(create[RESULTS][:documents].first).to have_key(:count) }
30
+ it('returns a document date sycned node') { expect(create[RESULTS][:documents].first).to have_key(:date_synced) }
31
+ it('returns a document id') { expect(create[RESULTS][:documents].first).to have_key(:document_id) }
32
+ it('returns a document downloaded bool') { expect(create[RESULTS][:documents].first).to have_key(:downloaded) }
33
+ it('returns a document type') { expect(create[RESULTS][:documents].first).to have_key(:type) }
34
+ end
35
+
36
+ describe '#list' do
37
+ subject(:list) { FinApps::REST::VerixRecords.new(api_client).list }
38
+
39
+ it_behaves_like 'an API request'
40
+ it_behaves_like 'a successful request'
41
+ it('returns an array') { expect(list[RESULTS]).to be_an_instance_of(Array) }
42
+ it('returns an id') { expect(list[RESULTS].first).to have_key(:_id) }
43
+ it('returns a status') { expect(list[RESULTS].first).to have_key(:status) }
44
+ it('returns a consumer id') { expect(list[RESULTS].first).to have_key(:consumer_id) }
45
+ it('returns an error node') { expect(list[RESULTS].first).to have_key(:error) }
46
+ it('returns a list of documents') { expect(list[RESULTS].first).to have_key(:documents) }
47
+ it('returns a document type') { expect(list[RESULTS].first[:documents].first).to have_key(:type) }
48
+ it('returns a document id') { expect(list[RESULTS].first[:documents].first).to have_key(:document_id) }
49
+ it('returns a document count') { expect(list[RESULTS].first[:documents].first).to have_key(:count) }
50
+ it('returns a document downloaded bool') { expect(list[RESULTS].first[:documents].first).to have_key(:downloaded) }
51
+ it('returns a document date_synced') { expect(list[RESULTS].first[:documents].first).to have_key(:date_synced) }
52
+ end
53
+ end
@@ -15,6 +15,19 @@ class FakeApi < Sinatra::Base
15
15
  put("/#{version}/resources") { json_response 201, 'resource.json' }
16
16
  delete("/#{version}/resources/:id") { status 202 }
17
17
 
18
+ # verix_metadata
19
+ get("/#{version}/v/metadata") do
20
+ json_response 200, 'verix/metadata.json'
21
+ end
22
+
23
+ # verix_records
24
+ get("/#{version}/v/record") do
25
+ json_response 200, 'verix/record/list.json'
26
+ end
27
+ post("/#{version}/v/record") do
28
+ json_response 200, 'verix/record/create.json'
29
+ end
30
+
18
31
  # plaid_webhook
19
32
  get("/#{version}/p/webhook") do
20
33
  tenant_token = request.env['HTTP_X_TENANT_TOKEN']
@@ -0,0 +1,4 @@
1
+ {
2
+ "environment": "development",
3
+ "client_id": "ddac099d7d5b6165f560591f1b1cdbe8"
4
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "_id": "string",
3
+ "consumer_id": "string",
4
+ "date_exchanged": "2019-12-17T14:50:00Z",
5
+ "date_modified": "2019-12-17T14:50:00Z",
6
+ "documents": [
7
+ {
8
+ "count": 0,
9
+ "date_synced": "2019-12-17T14:50:00Z",
10
+ "document_id": "string",
11
+ "downloaded": true,
12
+ "type": "string"
13
+ }
14
+ ],
15
+ "error": "string",
16
+ "status": 0
17
+ }
@@ -0,0 +1,82 @@
1
+ [
2
+ {
3
+ "_id": "5df7eadbfe13f5000148ca0e",
4
+ "consumer_id": "594625b4-e8fe-40b7-422f-f758bb877ae7",
5
+ "status": 2,
6
+ "error": "",
7
+ "date_exchanged": "2019-12-16T20:36:43.342Z",
8
+ "date_modified": "2019-12-16T20:36:45.59Z",
9
+ "documents": [
10
+ {
11
+ "type": "form_1040",
12
+ "document_id": "5df7eadbc496df0001e9daa0",
13
+ "count": 2,
14
+ "downloaded": false,
15
+ "date_synced": "2019-12-16T20:36:43.537Z"
16
+ },
17
+ {
18
+ "type": "schedule_c",
19
+ "document_id": "5df7eadbc496df0001e9daa1",
20
+ "count": 0,
21
+ "downloaded": false,
22
+ "date_synced": "2019-12-16T20:36:43.613Z"
23
+ },
24
+ {
25
+ "type": "schedule_d",
26
+ "document_id": "5df7eadbc496df0001e9daa2",
27
+ "count": 2,
28
+ "downloaded": false,
29
+ "date_synced": "2019-12-16T20:36:43.676Z"
30
+ },
31
+ {
32
+ "type": "schedule_e",
33
+ "document_id": "5df7eadbc496df0001e9daa3",
34
+ "count": 2,
35
+ "downloaded": false,
36
+ "date_synced": "2019-12-16T20:36:43.737Z"
37
+ },
38
+ {
39
+ "type": "schedule_k1_form_1065",
40
+ "document_id": "5df7eadbc496df0001e9daa4",
41
+ "count": 1,
42
+ "downloaded": false,
43
+ "date_synced": "2019-12-16T20:36:43.807Z"
44
+ },
45
+ {
46
+ "type": "schedule_k1_form_1120s",
47
+ "document_id": "5df7eadbc496df0001e9daa5",
48
+ "count": 2,
49
+ "downloaded": false,
50
+ "date_synced": "2019-12-16T20:36:43.912Z"
51
+ },
52
+ {
53
+ "type": "form_w2",
54
+ "document_id": "5df7eadcc496df0001e9daa6",
55
+ "count": 1,
56
+ "downloaded": false,
57
+ "date_synced": "2019-12-16T20:36:44.015Z"
58
+ },
59
+ {
60
+ "type": "form_1099_div",
61
+ "document_id": "5df7eaddc496df0001e9daa9",
62
+ "count": 4,
63
+ "downloaded": false,
64
+ "date_synced": "2019-12-16T20:36:45.441Z"
65
+ },
66
+ {
67
+ "type": "form_1099_int",
68
+ "document_id": "5df7eaddc496df0001e9daaa",
69
+ "count": 2,
70
+ "downloaded": false,
71
+ "date_synced": "2019-12-16T20:36:45.501Z"
72
+ },
73
+ {
74
+ "type": "form_5498",
75
+ "document_id": "5df7eaddc496df0001e9daab",
76
+ "count": 4,
77
+ "downloaded": false,
78
+ "date_synced": "2019-12-16T20:36:45.587Z"
79
+ }
80
+ ]
81
+ }
82
+ ]
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.0.17
4
+ version: 5.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-30 00:00:00.000000000 Z
11
+ date: 2019-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: finapps_core
@@ -328,6 +328,8 @@ files:
328
328
  - lib/finapps/rest/statements.rb
329
329
  - lib/finapps/rest/tenant_app_settings.rb
330
330
  - lib/finapps/rest/tenant_settings.rb
331
+ - lib/finapps/rest/verix/verix_metadata.rb
332
+ - lib/finapps/rest/verix/verix_records.rb
331
333
  - lib/finapps/rest/version.rb
332
334
  - lib/finapps/utils/query_builder.rb
333
335
  - lib/finapps/version.rb
@@ -363,6 +365,8 @@ files:
363
365
  - spec/rest/statements_spec.rb
364
366
  - spec/rest/tenant_app_settings_spec.rb
365
367
  - spec/rest/tenant_settings_spec.rb
368
+ - spec/rest/verix/verix_metadata_spec.rb
369
+ - spec/rest/verix/verix_records_spec.rb
366
370
  - spec/rest/version_spec.rb
367
371
  - spec/spec_helper.rb
368
372
  - spec/spec_helpers/client.rb
@@ -413,6 +417,9 @@ files:
413
417
  - spec/support/fixtures/tenant_settings.json
414
418
  - spec/support/fixtures/unauthorized.json
415
419
  - spec/support/fixtures/user.json
420
+ - spec/support/fixtures/verix/metadata.json
421
+ - spec/support/fixtures/verix/record/create.json
422
+ - spec/support/fixtures/verix/record/list.json
416
423
  - spec/utils/query_builder_spec.rb
417
424
  - tags
418
425
  homepage: https://github.com/finapps/ruby-client
@@ -445,39 +452,41 @@ signing_key:
445
452
  specification_version: 4
446
453
  summary: FinApps REST API ruby client.
447
454
  test_files:
448
- - spec/rest/portfolios_consumers_spec.rb
449
- - spec/rest/consumers_portfolios_spec.rb
450
- - spec/rest/operators_password_resets_spec.rb
451
- - spec/rest/portfolios_available_consumers_spec.rb
452
- - spec/rest/products_spec.rb
453
- - spec/rest/statements_spec.rb
454
- - spec/rest/alert_definitions_spec.rb
455
- - spec/rest/version_spec.rb
455
+ - spec/utils/query_builder_spec.rb
456
+ - spec/spec_helpers/client.rb
457
+ - spec/spec_helper.rb
458
+ - spec/support/fake_api.rb
459
+ - spec/rest/alert_occurrences_spec.rb
456
460
  - spec/rest/consumers_spec.rb
461
+ - spec/rest/order_statuses_spec.rb
462
+ - spec/rest/api_request.rb
457
463
  - spec/rest/orders_spec.rb
458
- - spec/rest/order_tokens_spec.rb
459
- - spec/rest/tenant_app_settings_spec.rb
460
- - spec/rest/operators_spec.rb
461
464
  - spec/rest/client_spec.rb
462
- - spec/rest/tenant_settings_spec.rb
463
- - spec/rest/api_request.rb
464
- - spec/rest/alert_occurrences_spec.rb
465
465
  - spec/rest/password_resets_spec.rb
466
- - spec/rest/order_reports_spec.rb
467
- - spec/rest/portfolios_spec.rb
468
- - spec/rest/order_statuses_spec.rb
469
- - spec/rest/plaid/plaid_accounts_spec.rb
470
- - spec/rest/plaid/plaid_account_permissions_spec.rb
471
- - spec/rest/plaid/plaid_webhooks_spec.rb
472
- - spec/rest/plaid/plaid_institution_logos_spec.rb
473
- - spec/rest/plaid/plaid_consumer_institutions_spec.rb
474
- - spec/rest/order_refreshes_spec.rb
475
- - spec/rest/order_notifications_spec.rb
476
- - spec/rest/portfolios_alerts_spec.rb
466
+ - spec/rest/version_spec.rb
467
+ - spec/rest/operators_spec.rb
468
+ - spec/rest/tenant_app_settings_spec.rb
469
+ - spec/rest/operators_password_resets_spec.rb
470
+ - spec/rest/portfolios_consumers_spec.rb
471
+ - spec/rest/portfolios_available_consumers_spec.rb
472
+ - spec/rest/products_spec.rb
477
473
  - spec/rest/order_assignments_spec.rb
474
+ - spec/rest/order_refreshes_spec.rb
475
+ - spec/rest/order_tokens_spec.rb
476
+ - spec/rest/consumers_portfolios_spec.rb
477
+ - spec/rest/verix/verix_records_spec.rb
478
+ - spec/rest/verix/verix_metadata_spec.rb
478
479
  - spec/rest/sessions_spec.rb
479
480
  - spec/rest/portfolio_reports_spec.rb
480
- - spec/support/fake_api.rb
481
- - spec/utils/query_builder_spec.rb
482
- - spec/spec_helpers/client.rb
483
- - spec/spec_helper.rb
481
+ - spec/rest/portfolios_alerts_spec.rb
482
+ - spec/rest/plaid/plaid_webhooks_spec.rb
483
+ - spec/rest/plaid/plaid_account_permissions_spec.rb
484
+ - spec/rest/plaid/plaid_consumer_institutions_spec.rb
485
+ - spec/rest/plaid/plaid_institution_logos_spec.rb
486
+ - spec/rest/plaid/plaid_accounts_spec.rb
487
+ - spec/rest/order_reports_spec.rb
488
+ - spec/rest/statements_spec.rb
489
+ - spec/rest/alert_definitions_spec.rb
490
+ - spec/rest/order_notifications_spec.rb
491
+ - spec/rest/tenant_settings_spec.rb
492
+ - spec/rest/portfolios_spec.rb