spendee-rb 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/console +1 -0
- data/lib/spendee-rb.rb +4 -2
- data/lib/spendee/clients/base_client.rb +2 -4
- data/lib/spendee/clients/get_all_user_categories.rb +3 -3
- data/lib/spendee/clients/login.rb +19 -0
- data/lib/spendee/clients/user_get_profile.rb +3 -3
- data/lib/spendee/clients/verify_identity.rb +18 -0
- data/lib/spendee/clients/wallet_create_transaction.rb +3 -3
- data/lib/spendee/clients/wallet_get_all.rb +3 -3
- data/lib/spendee/clients/wallet_get_transactions.rb +3 -3
- data/lib/spendee/entities/identity.rb +7 -0
- data/lib/spendee/initializers/api_struct.rb +8 -2
- data/lib/spendee/login.rb +9 -0
- data/lib/spendee/verify_identity.rb +7 -0
- data/lib/spendee/version.rb +1 -1
- metadata +8 -6
- data/lib/spendee/clients/user_login.rb +0 -17
- data/lib/spendee/user_login.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14949bc4b80e195fe46c2c54d43312904b7b0aad5df8fa1c9b79485bbd1a16b2
|
4
|
+
data.tar.gz: b04ecd3792f051efe54a7de4dda31cd2596ecf9cdb5ea10f3497acb9f90ab8e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 344268880cd56d68509f7dcc9f134c2ca3b9599094fa8f9c1202a5413ccc658251d38fc6ef27c2db49801268edd6e01645fd606503b8be0686100ced78e40c27
|
7
|
+
data.tar.gz: e5266f338780fa0ae41ec0651d1df2a6360cc565ef98063217d08f33184f7d4b69ce9dbea1397daf47a711c3ede40580e0023dc9d96f4a079030e67ccb8ced0c
|
data/bin/console
CHANGED
data/lib/spendee-rb.rb
CHANGED
@@ -16,7 +16,8 @@ module Spendee
|
|
16
16
|
module Clients
|
17
17
|
autoload :BaseClient, 'spendee/clients/base_client'
|
18
18
|
|
19
|
-
autoload :
|
19
|
+
autoload :VerifyIdentity, 'spendee/clients/verify_identity'
|
20
|
+
autoload :Login, 'spendee/clients/login'
|
20
21
|
autoload :UserGetProfile, 'spendee/clients/user_get_profile'
|
21
22
|
autoload :WalletGetAll, 'spendee/clients/wallet_get_all'
|
22
23
|
autoload :WalletGetTransactions, 'spendee/clients/wallet_get_transactions'
|
@@ -24,7 +25,8 @@ module Spendee
|
|
24
25
|
autoload :GetAllUserCategories, 'spendee/clients/get_all_user_categories'
|
25
26
|
end
|
26
27
|
|
27
|
-
autoload :
|
28
|
+
autoload :VerifyIdentity, 'spendee/verify_identity'
|
29
|
+
autoload :Login, 'spendee/login'
|
28
30
|
autoload :UserProfile, 'spendee/user_profile'
|
29
31
|
autoload :Wallet, 'spendee/wallet'
|
30
32
|
autoload :Transaction, 'spendee/transaction'
|
@@ -3,10 +3,8 @@
|
|
3
3
|
module Spendee
|
4
4
|
module Clients
|
5
5
|
class BaseClient < ApiStruct::Client
|
6
|
-
|
7
|
-
|
8
|
-
def default_headers(api_uuid)
|
9
|
-
{ API_UUID => api_uuid }
|
6
|
+
def default_headers(token, device_uuid = nil)
|
7
|
+
{ authorization: "Bearer #{token}", 'content-type': 'application/json', 'device-uuid': device_uuid}
|
10
8
|
end
|
11
9
|
end
|
12
10
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Spendee
|
2
2
|
module Clients
|
3
3
|
class GetAllUserCategories < BaseClient
|
4
|
-
spendee_api 'get-all-user-categories'
|
4
|
+
spendee_api 'v1.8/get-all-user-categories'
|
5
5
|
|
6
|
-
def index(
|
7
|
-
get(headers: default_headers(
|
6
|
+
def index(token, device_uuid)
|
7
|
+
get(headers: default_headers(token, device_uuid))
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Spendee
|
2
|
+
module Clients
|
3
|
+
class Login < BaseClient
|
4
|
+
spendee_api 'v3/auth/login'
|
5
|
+
|
6
|
+
def create(token, global_currency:, default_wallet_name:, timezone:, platform:)
|
7
|
+
post(
|
8
|
+
body: {
|
9
|
+
global_currency: global_currency,
|
10
|
+
default_wallet_name: default_wallet_name,
|
11
|
+
timezone: timezone,
|
12
|
+
platform: platform
|
13
|
+
}.to_json,
|
14
|
+
headers: default_headers(token)
|
15
|
+
)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Spendee
|
2
2
|
module Clients
|
3
3
|
class UserGetProfile < BaseClient
|
4
|
-
spendee_api 'user-get-profile'
|
4
|
+
spendee_api 'v1.8/user-get-profile'
|
5
5
|
|
6
|
-
def show(
|
7
|
-
post(headers: default_headers(
|
6
|
+
def show(token, device_uuid)
|
7
|
+
post(headers: default_headers(token, device_uuid))
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Spendee
|
2
|
+
module Clients
|
3
|
+
class VerifyIdentity < ApiStruct::Client
|
4
|
+
googleapis 'verifyPassword'
|
5
|
+
|
6
|
+
def create(email:, password:, key:)
|
7
|
+
post(
|
8
|
+
params: { key: key },
|
9
|
+
body: {
|
10
|
+
email: email,
|
11
|
+
password: password,
|
12
|
+
returnSecureToken: true
|
13
|
+
}.to_json
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module Spendee
|
2
2
|
module Clients
|
3
3
|
class WalletCreateTransaction < BaseClient
|
4
|
-
spendee_api 'wallet-create-transaction'
|
4
|
+
spendee_api 'v1.8/wallet-create-transaction'
|
5
5
|
|
6
|
-
def create(
|
6
|
+
def create(token, device_uuid, amount:, start_date:, wallet_id:, note:, category_id:, timezone:, offset:)
|
7
7
|
post(
|
8
8
|
body: {
|
9
9
|
amount: amount,
|
@@ -14,7 +14,7 @@ module Spendee
|
|
14
14
|
timezone: timezone,
|
15
15
|
offset: offset
|
16
16
|
}.to_json,
|
17
|
-
headers: default_headers(
|
17
|
+
headers: default_headers(token, device_uuid)
|
18
18
|
)
|
19
19
|
end
|
20
20
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Spendee
|
2
2
|
module Clients
|
3
3
|
class WalletGetAll < BaseClient
|
4
|
-
spendee_api 'wallet-get-all'
|
4
|
+
spendee_api 'v1.8/wallet-get-all'
|
5
5
|
|
6
|
-
def index(
|
7
|
-
post(headers: default_headers(
|
6
|
+
def index(token, device_uuid)
|
7
|
+
post(headers: default_headers(token, device_uuid))
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Spendee
|
2
2
|
module Clients
|
3
3
|
class WalletGetTransactions < BaseClient
|
4
|
-
spendee_api 'wallet-get-transactions'
|
4
|
+
spendee_api 'v1.8/wallet-get-transactions'
|
5
5
|
|
6
|
-
def index(
|
7
|
-
post(headers: default_headers(
|
6
|
+
def index(token, device_uuid)
|
7
|
+
post(headers: default_headers(token, device_uuid))
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -1,7 +1,13 @@
|
|
1
1
|
ApiStruct::Settings.configure do |config|
|
2
2
|
config.endpoints = {
|
3
3
|
spendee_api: {
|
4
|
-
root: 'https://api.spendee.com
|
5
|
-
}
|
4
|
+
root: 'https://api.spendee.com',
|
5
|
+
},
|
6
|
+
googleapis: {
|
7
|
+
root: 'https://www.googleapis.com/identitytoolkit/v3/relyingparty',
|
8
|
+
headers: {
|
9
|
+
'content-type': 'application/json'
|
10
|
+
}
|
11
|
+
},
|
6
12
|
}
|
7
13
|
end
|
data/lib/spendee/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spendee-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taras Shpachenko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: api_struct
|
@@ -191,20 +191,23 @@ files:
|
|
191
191
|
- lib/spendee/category.rb
|
192
192
|
- lib/spendee/clients/base_client.rb
|
193
193
|
- lib/spendee/clients/get_all_user_categories.rb
|
194
|
+
- lib/spendee/clients/login.rb
|
194
195
|
- lib/spendee/clients/user_get_profile.rb
|
195
|
-
- lib/spendee/clients/
|
196
|
+
- lib/spendee/clients/verify_identity.rb
|
196
197
|
- lib/spendee/clients/wallet_create_transaction.rb
|
197
198
|
- lib/spendee/clients/wallet_get_all.rb
|
198
199
|
- lib/spendee/clients/wallet_get_transactions.rb
|
199
200
|
- lib/spendee/create_transaction.rb
|
200
201
|
- lib/spendee/entities/category.rb
|
202
|
+
- lib/spendee/entities/identity.rb
|
201
203
|
- lib/spendee/entities/transaction.rb
|
202
204
|
- lib/spendee/entities/user.rb
|
203
205
|
- lib/spendee/entities/wallet.rb
|
204
206
|
- lib/spendee/initializers/api_struct.rb
|
207
|
+
- lib/spendee/login.rb
|
205
208
|
- lib/spendee/transaction.rb
|
206
|
-
- lib/spendee/user_login.rb
|
207
209
|
- lib/spendee/user_profile.rb
|
210
|
+
- lib/spendee/verify_identity.rb
|
208
211
|
- lib/spendee/version.rb
|
209
212
|
- lib/spendee/wallet.rb
|
210
213
|
- spendee-rb.gemspec
|
@@ -226,8 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
229
|
- !ruby/object:Gem::Version
|
227
230
|
version: '0'
|
228
231
|
requirements: []
|
229
|
-
|
230
|
-
rubygems_version: 2.7.3
|
232
|
+
rubygems_version: 3.1.2
|
231
233
|
signing_key:
|
232
234
|
specification_version: 4
|
233
235
|
summary: Spendee API ruby client.
|