pisoni 1.28.0 → 1.29.0

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: b4bd300163940397f3151f3648985d23dfa38da6a18d1fabb235020f69cd3ef0
4
- data.tar.gz: de16fdc8e8dc900f80c33bac0e324ac831e1260830d5a456b4bc509bcbc4d54e
3
+ metadata.gz: 8f1ad974b6dcbbf155ca09a341c90299512b202c25be5d02313d8230b3643050
4
+ data.tar.gz: ceaaa69cfa602b690ab20f48dbc98bc46a2fdcfaa52f36330e1fd698b37a6bbc
5
5
  SHA512:
6
- metadata.gz: 5f582b3622c904272fccad3c65ca34789fc16f6601825c11b62f63d46aefe2c820ed786038e69def7e278432fc7435ee4bfc80e2e5e04e095a7b6971fd0007da
7
- data.tar.gz: 2c1994bd77a4baadcc19fb75b87d99b872842cc0bee6e0d6f9a77ab52fd1aa0677ae976aeccc85f5fec463679106a30252c80efe0325a0cc5fd79a8b369c8bdc
6
+ metadata.gz: bb81cdc2713b7be7ab6fd06983769df7f62b966816a0b71c7a97454ffb511ea059e896aca2bd6397b0bebeb7250b37616ade6f43d5fb6f680192891a85a8fd22
7
+ data.tar.gz: 268a297b87ac353451fe91a9b2963acd200e5c1a6470ac610989b21f13683d2ca32a939eb14b10ea6f893f9210dbdd89af85ac0bd7377a3c226410d8101d3f68
@@ -2,6 +2,13 @@
2
2
 
3
3
  Notable changes to Pisoni will be tracked in this document.
4
4
 
5
+ ## 1.29.0 - 2020-03-17
6
+
7
+ ### Removed
8
+
9
+ - "Latest transactions" functionality
10
+ [#26](https://github.com/3scale/pisoni/pull/26)
11
+
5
12
  ## 1.28.0 - 2019-12-20
6
13
 
7
14
  ### Changed
@@ -24,7 +24,6 @@ require '3scale/core/errors'
24
24
  require '3scale/core/application_key'
25
25
  require '3scale/core/application_referrer_filter'
26
26
  require '3scale/core/service_error'
27
- require '3scale/core/transaction'
28
27
  require '3scale/core/utilization'
29
28
  require '3scale/core/service_token'
30
29
 
@@ -1,5 +1,5 @@
1
1
  module ThreeScale
2
2
  module Core
3
- VERSION = '1.28.0'
3
+ VERSION = '1.29.0'
4
4
  end
5
5
  end
@@ -53,8 +53,6 @@ module ThreeScale
53
53
  end
54
54
  end
55
55
  usage_limits.each { |limit| UsageLimit.save(limit) }
56
-
57
- Transaction.delete_all(service_id)
58
56
  end
59
57
 
60
58
  # This is a basic test that only checks the structure of the response.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pisoni
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.28.0
4
+ version: 1.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Martinez Ruiz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-20 00:00:00.000000000 Z
11
+ date: 2020-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -113,7 +113,6 @@ files:
113
113
  - lib/3scale/core/service.rb
114
114
  - lib/3scale/core/service_error.rb
115
115
  - lib/3scale/core/service_token.rb
116
- - lib/3scale/core/transaction.rb
117
116
  - lib/3scale/core/usage_limit.rb
118
117
  - lib/3scale/core/utilization.rb
119
118
  - lib/3scale/core/version.rb
@@ -128,12 +127,10 @@ files:
128
127
  - spec/metric_spec.rb
129
128
  - spec/private_endpoints/event.rb
130
129
  - spec/private_endpoints/service_error.rb
131
- - spec/private_endpoints/transaction.rb
132
130
  - spec/service_error_spec.rb
133
131
  - spec/service_spec.rb
134
132
  - spec/service_token_spec.rb
135
133
  - spec/spec_helper.rb
136
- - spec/transaction_spec.rb
137
134
  - spec/usagelimit_spec.rb
138
135
  - spec/utilization_spec.rb
139
136
  homepage: https://github.com/3scale/pisoni
@@ -169,11 +166,9 @@ test_files:
169
166
  - spec/metric_spec.rb
170
167
  - spec/private_endpoints/event.rb
171
168
  - spec/private_endpoints/service_error.rb
172
- - spec/private_endpoints/transaction.rb
173
169
  - spec/service_error_spec.rb
174
170
  - spec/service_spec.rb
175
171
  - spec/service_token_spec.rb
176
172
  - spec/spec_helper.rb
177
- - spec/transaction_spec.rb
178
173
  - spec/usagelimit_spec.rb
179
174
  - spec/utilization_spec.rb
@@ -1,26 +0,0 @@
1
- module ThreeScale
2
- module Core
3
- class Transaction < APIClient::Resource
4
- attributes :application_id, :usage, :timestamp
5
-
6
- default_uri '/internal/services/'
7
-
8
- def self.transactions_uri(service_id)
9
- "#{default_uri}#{service_id}/transactions/"
10
- end
11
- private_class_method :transactions_uri
12
-
13
- def self.load_all(service_id)
14
- result = api_do_get({}, { uri: transactions_uri(service_id),
15
- rprefix: :transactions }) do |res|
16
- return nil if res[:response].status == 404
17
- true
18
- end
19
-
20
- return nil if result.nil?
21
-
22
- APIClient::Collection.new(result[:attributes].map { |attrs| new attrs })
23
- end
24
- end
25
- end
26
- end
@@ -1,16 +0,0 @@
1
- module PrivateEndpoints
2
- module Transaction
3
- def save(service_id, transactions)
4
- api_create(transactions,
5
- { uri: transactions_uri(service_id),
6
- prefix: :transactions })
7
- end
8
-
9
- def delete_all(service_id)
10
- api_delete({}, uri: transactions_uri(service_id))
11
- end
12
- end
13
- end
14
-
15
- ThreeScale::Core::Transaction.extend PrivateEndpoints::Transaction
16
-
@@ -1,71 +0,0 @@
1
- require_relative './spec_helper'
2
- require_relative './private_endpoints/transaction'
3
-
4
- module ThreeScale
5
- module Core
6
- describe Transaction do
7
- before do
8
- Service.delete_by_id!(service_id)
9
- Service.save!(provider_key: 'foo_transaction_spec', id: service_id)
10
- end
11
-
12
- describe '.load_all' do
13
- let(:service_id) { '7575_transaction_spec' }
14
- let(:non_existing_service_id) { service_id.to_i.succ.to_s }
15
-
16
- before do
17
- Transaction.delete_all(service_id)
18
- end
19
-
20
- describe 'when there are transactions' do
21
- let(:first_transaction_time) { Time.new(2015, 1, 1) }
22
- let(:second_transaction_time) { Time.new(2015, 1, 2) }
23
- let(:test_transactions) do
24
- transactions = []
25
- transactions << { application_id: 'first_test_application',
26
- usage: 'first_usage',
27
- timestamp: first_transaction_time.to_s }
28
- transactions << { application_id: 'second_test_application',
29
- usage: 'second_usage',
30
- timestamp: second_transaction_time.to_s }
31
- end
32
-
33
- before do
34
- Transaction.save(service_id, test_transactions)
35
- end
36
-
37
- it 'returns a collection with the transactions' do
38
- transactions = Transaction.load_all(service_id)
39
-
40
- transactions.total.must_equal test_transactions.size
41
- transactions.size.must_equal test_transactions.size
42
-
43
- latest_transaction = transactions[0]
44
- latest_transaction.application_id.must_equal test_transactions[1][:application_id]
45
- latest_transaction.usage.must_equal test_transactions[1][:usage]
46
- latest_transaction.timestamp.must_equal second_transaction_time
47
-
48
- previous_transaction = transactions[1]
49
- previous_transaction.application_id.must_equal test_transactions[0][:application_id]
50
- previous_transaction.usage.must_equal test_transactions[0][:usage]
51
- previous_transaction.timestamp.must_equal first_transaction_time
52
- end
53
- end
54
-
55
- describe 'when there are no transactions' do
56
- it 'returns an empty collection' do
57
- transactions = Transaction.load_all(service_id)
58
- transactions.must_be_empty
59
- transactions.total.must_equal 0
60
- end
61
- end
62
-
63
- describe 'with an invalid service ID' do
64
- it 'returns nil' do
65
- Transaction.load_all(non_existing_service_id).must_be_nil
66
- end
67
- end
68
- end
69
- end
70
- end
71
- end