nubank_sdk 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 053f6750d8819dc5c05fa23831829106314f7002357d65083f45a234a28233f0
4
- data.tar.gz: 827596b59873ca86d556323dda076f710ee9dc19494bba206ee53cd748fa62ff
3
+ metadata.gz: 4e6aaa0047c7851123791cc437134505bf04b655c080f21697882c604a706cd2
4
+ data.tar.gz: 552a50d9b7e1baf80231de4f0e7fd2f0db9d0014f541bb5a77a59b51ffda37fa
5
5
  SHA512:
6
- metadata.gz: bf061fa7d6423a5c356418a5e9b2a823fa4492766e5b6bb92503bca7118cd323ce220a1042863b715a4af2297547c0539f44de35e95dd4ee1e814accbd8935df
7
- data.tar.gz: e103553e8c83693f918437f7d4ac7ae5d9121af6f88c71b759c1b0ef9878b0be84c81a9775b770b60b64bbabd9d59be52dca2a985a225fa51829594ab3ac249f
6
+ metadata.gz: 8be041a0742e7eb8dc54d9dad86788cf9f960b632ea4e9179e11055dd2c0354e20666f4489f7e7aee9905376ed8eacbc9b3a018cc92b8dbb788f2a9f2c135274
7
+ data.tar.gz: cd642897726264a36cb6d97c5c767aecf7d6525d45611ac685d97d04b90be29c6602c2451d0868da336169d74eab892c79ec1426bc745607d1317a86a17fd533
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nubank_sdk (0.7.0)
4
+ nubank_sdk (0.7.1)
5
5
  faraday (~> 2.7.1)
6
6
  json (~> 2.3)
7
7
 
data/Rakefile CHANGED
@@ -19,8 +19,6 @@ task :start_new_release do
19
19
  sh 'git add .'
20
20
  sh "git commit -m \"build(version): :bookmark: bump #{bump}\""
21
21
  sh 'git push'
22
-
23
- Rake::Task[:generate_git_tag].invoke
24
22
  end
25
23
 
26
24
  task :generate_git_tag do
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Graphql
4
+ class Account
5
+ BALANCE = '{viewer {savingsAccount {currentSavingsBalance {netAmount}}}}'
6
+ FEED = <<~GRAPHQL
7
+ {
8
+ viewer {
9
+ savingsAccount {
10
+ id
11
+ feed {
12
+ id
13
+ __typename
14
+ title
15
+ detail
16
+ postDate
17
+ ... on TransferInEvent {
18
+ amount
19
+ originAccount {
20
+ name
21
+ }
22
+ }
23
+ ... on TransferOutEvent {
24
+ amount
25
+ destinationAccount {
26
+ name
27
+ }
28
+ }
29
+ ... on TransferOutReversalEvent {
30
+ amount
31
+ }
32
+ ... on BillPaymentEvent {
33
+ amount
34
+ }
35
+ ... on DebitPurchaseEvent {
36
+ amount
37
+ }
38
+ ... on BarcodePaymentEvent {
39
+ amount
40
+ }
41
+ ... on DebitWithdrawalFeeEvent {
42
+ amount
43
+ }
44
+ ... on DebitWithdrawalEvent {
45
+ amount
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ GRAPHQL
52
+ end
53
+ end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'graphql/account'
4
+
3
5
  module NubankSdk
4
6
  #
5
7
  # Returns the account statement
@@ -25,7 +27,7 @@ module NubankSdk
25
27
  response = @connection.post(
26
28
  query_url, {
27
29
  'variables': {},
28
- 'query': '{viewer {savingsAccount {currentSavingsBalance {netAmount}}}}'
30
+ 'query': Graphql::Account::BALANCE
29
31
  }
30
32
  )
31
33
 
@@ -43,7 +45,7 @@ module NubankSdk
43
45
  response = @connection.post(
44
46
  query_url, {
45
47
  'variables': {},
46
- 'query': Utils.read_graphql_query('account', 'feed')
48
+ 'query': Graphql::Account::FEED
47
49
  }
48
50
  )
49
51
 
@@ -7,7 +7,7 @@ module NubankSdk
7
7
  # Auth method to connect with the nubank api
8
8
  #
9
9
  class Auth
10
- attr_reader :refresh_token, :refresh_before, :access_token
10
+ attr_accessor :refresh_token, :refresh_before, :access_token
11
11
 
12
12
  #
13
13
  # Auth method to connect with the nubank api
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NubankSdk
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.1'
5
5
  end
data/lib/nubank_sdk.rb CHANGED
@@ -8,7 +8,6 @@ require 'nubank_sdk/credit'
8
8
  require 'nubank_sdk/client'
9
9
  require 'nubank_sdk/user'
10
10
  require 'nubank_sdk/version'
11
- require 'nubank_sdk/utils'
12
11
 
13
12
  module NubankSdk
14
13
  class Error < StandardError; end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nubank_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Viserion77
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-02 00:00:00.000000000 Z
11
+ date: 2023-01-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -201,7 +201,7 @@ files:
201
201
  - bin/console
202
202
  - bin/setup
203
203
  - certificates/.gitkeep
204
- - lib/graphql/account/feed.gql
204
+ - lib/graphql/account.rb
205
205
  - lib/nubank_sdk.rb
206
206
  - lib/nubank_sdk/account.rb
207
207
  - lib/nubank_sdk/api_routes.rb
@@ -210,7 +210,6 @@ files:
210
210
  - lib/nubank_sdk/client.rb
211
211
  - lib/nubank_sdk/credit.rb
212
212
  - lib/nubank_sdk/user.rb
213
- - lib/nubank_sdk/utils.rb
214
213
  - lib/nubank_sdk/version.rb
215
214
  - nubank_sdk.gemspec
216
215
  homepage: https://github.com/Viserion77/nubank_sdk
@@ -1,44 +0,0 @@
1
- {
2
- viewer {
3
- savingsAccount {
4
- id
5
- feed {
6
- id
7
- __typename
8
- title
9
- detail
10
- postDate
11
- ... on TransferInEvent {
12
- amount
13
- originAccount {
14
- name
15
- }
16
- }
17
- ... on TransferOutEvent {
18
- amount
19
- destinationAccount {
20
- name
21
- }
22
- }
23
- ... on TransferOutReversalEvent {
24
- amount
25
- }
26
- ... on BillPaymentEvent {
27
- amount
28
- }
29
- ... on DebitPurchaseEvent {
30
- amount
31
- }
32
- ... on BarcodePaymentEvent {
33
- amount
34
- }
35
- ... on DebitWithdrawalFeeEvent {
36
- amount
37
- }
38
- ... on DebitWithdrawalEvent {
39
- amount
40
- }
41
- }
42
- }
43
- }
44
- }
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module NubankSdk
4
- #
5
- # Utils
6
- module Utils
7
- #
8
- # read graphQL query from file in ../graphql/{path}/{query}.gql
9
- #
10
- # @param [String] path - path to the query account, credit
11
- # @param [String] query - query name
12
- #
13
- # @return [String]
14
- def self.read_graphql_query(path, query)
15
- File.read(File.join('.', 'lib', 'graphql', path, "#{query}.gql"))
16
- end
17
- end
18
- end