nova-api 1.1.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -1
- data/Gemfile.lock +2 -2
- data/lib/nova/api/base.rb +5 -2
- data/lib/nova/api/resource/apportionment_value.rb +1 -0
- data/lib/nova/api/resource/financial_account.rb +1 -0
- data/lib/nova/api/version.rb +1 -1
- data/lib/nova/configuration.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e0c5e3fd4abc0508f7031522a9c92cbe0780b473d32d1c97285b75f0e9523cd
|
4
|
+
data.tar.gz: 150bea2842ded8c9d8896616f324d6ab4f265a42b869aa867dc3b8a42c6228bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04cd17671e6e3e5ae7e3bfae540ea428e0a38e24afc22af58ed1e217c7c4e79b0e29bc0dfd83d7391fee0da09711d5c196cce588b9a065a1049e93dd934d7e8c
|
7
|
+
data.tar.gz: e2d50d901257bbcc89ab91a4d8b2d4c95ac84918e1651f01e8b26b6d8df724854c91c68a70f2635149e20a70580d6106443d4381fcae2b8fc85dec8853c2c4e5
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [1.3.0] - 2023-10-03
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
- Configuration to use the staging environment (```use_staging```)
|
13
|
+
|
14
|
+
## [1.2.0] - 2023-09-29
|
15
|
+
|
16
|
+
### Added
|
17
|
+
|
18
|
+
- Apportionment name to ApportionmentValue class
|
19
|
+
- Active flag to FinancialAccount class
|
20
|
+
|
8
21
|
## [1.1.0] - 2023-09-22
|
9
22
|
|
10
23
|
### Added
|
@@ -101,7 +114,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
101
114
|
|
102
115
|
- Apportionment related stuff
|
103
116
|
|
104
|
-
[unreleased]: https://github.com/coyosoftware/nova-api/compare/1.
|
117
|
+
[unreleased]: https://github.com/coyosoftware/nova-api/compare/1.3.0...HEAD
|
118
|
+
[1.3.0]: https://github.com/coyosoftware/nova-api/releases/tag/1.3.0
|
119
|
+
[1.2.0]: https://github.com/coyosoftware/nova-api/releases/tag/1.2.0
|
105
120
|
[1.1.0]: https://github.com/coyosoftware/nova-api/releases/tag/1.1.0
|
106
121
|
[1.0.0]: https://github.com/coyosoftware/nova-api/releases/tag/1.0.0
|
107
122
|
[0.8.0]: https://github.com/coyosoftware/nova-api/releases/tag/0.8.0
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
nova-api (1.
|
4
|
+
nova-api (1.3.0)
|
5
5
|
dry-struct (~> 1.6)
|
6
6
|
dry-types (~> 1.7)
|
7
7
|
httparty (~> 0.1)
|
@@ -41,7 +41,7 @@ GEM
|
|
41
41
|
mini_mime (>= 1.0.0)
|
42
42
|
multi_xml (>= 0.5.2)
|
43
43
|
ice_nine (0.11.2)
|
44
|
-
mini_mime (1.1.
|
44
|
+
mini_mime (1.1.5)
|
45
45
|
multi_xml (0.6.0)
|
46
46
|
public_suffix (4.0.6)
|
47
47
|
rake (13.0.6)
|
data/lib/nova/api/base.rb
CHANGED
@@ -9,7 +9,8 @@ module Nova
|
|
9
9
|
format :json
|
10
10
|
|
11
11
|
SCHEME = 'https'
|
12
|
-
|
12
|
+
PRODUCTION_HOST = 'nova.money'
|
13
|
+
STAGING_HOST = 'staging.nova.money'
|
13
14
|
|
14
15
|
def self.endpoint
|
15
16
|
raise EndpointNotConfiguredError, 'Each class must implement its own endpoint'
|
@@ -18,7 +19,9 @@ module Nova
|
|
18
19
|
def self.base_url
|
19
20
|
raise Nova::API::MissingSubdomainError, 'The subdomain must be informed' if configuration.subdomain.nil? || configuration.subdomain.empty?
|
20
21
|
|
21
|
-
|
22
|
+
host = configuration.use_staging? ? STAGING_HOST : PRODUCTION_HOST
|
23
|
+
|
24
|
+
"#{SCHEME}://#{configuration.subdomain}.#{host}"
|
22
25
|
end
|
23
26
|
|
24
27
|
def endpoint
|
@@ -8,6 +8,7 @@ module Nova
|
|
8
8
|
attribute :name, Dry::Types['coercible.string']
|
9
9
|
attribute? :active, Dry::Types['strict.bool'].optional
|
10
10
|
attribute? :apportionment_id, Dry::Types['coercible.integer']
|
11
|
+
attribute? :apportionment_name, Dry::Types['coercible.string']
|
11
12
|
|
12
13
|
def self.endpoint(apportionment_id)
|
13
14
|
"/api/apportionments/#{apportionment_id}/apportionment_values"
|
@@ -22,6 +22,7 @@ module Nova
|
|
22
22
|
attribute? :financial_account, Dry::Types['coercible.string'].optional
|
23
23
|
attribute? :income, Dry::Types['strict.bool'].optional
|
24
24
|
attribute? :outcome, Dry::Types['strict.bool'].optional
|
25
|
+
attribute? :active, Dry::Types['strict.bool'].optional
|
25
26
|
attribute? :children, Dry::Types['strict.array'].of(Nova::API::Resource::FinancialAccount).optional
|
26
27
|
|
27
28
|
def self.endpoint
|
data/lib/nova/api/version.rb
CHANGED
data/lib/nova/configuration.rb
CHANGED
@@ -1,9 +1,13 @@
|
|
1
1
|
module Nova
|
2
2
|
module API
|
3
3
|
class Configuration
|
4
|
-
attr_accessor :api_key, :subdomain
|
4
|
+
attr_accessor :api_key, :subdomain, :use_staging
|
5
5
|
attr_reader :host
|
6
6
|
attr_reader :scheme
|
7
|
+
|
8
|
+
def use_staging?
|
9
|
+
[true, 'true'].include?(use_staging)
|
10
|
+
end
|
7
11
|
end
|
8
12
|
end
|
9
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nova-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Coyô Software
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|