bunny_app 2.1.0 → 2.2.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 +4 -4
- data/README.md +5 -5
- data/lib/bunny_app/client.rb +1 -0
- data/lib/bunny_app/feature_usage.rb +4 -6
- data/lib/bunny_app/tenant_metrics.rb +26 -0
- data/lib/bunny_app/version.rb +1 -1
- data/lib/bunny_app.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df32cc341007dd7b79cd16df32165f963b8b2c564aec339b40263722379d8db8
|
4
|
+
data.tar.gz: af8134359490b8032fa3c8e358b49b0fd341132c89dab08ac3c2b81b4b99fd41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d718112141ebe74e575d77f49c8b9ac6d32d2bf561585ffd9e8d574c963a09bbba4567268d33c3e8bd2a186135e08b7af612a52b49f432c78f8bdd5d19f1bbd
|
7
|
+
data.tar.gz: d028771adc4bfd0924147fcc308bdcad1397c80acb7bca6cb2cead0fc0be7df5227f657c8308cf7fcd6f65a54a1a64518d35d925ad22b4ef80debf88d7c81630
|
data/README.md
CHANGED
@@ -4,10 +4,10 @@ Ruby SDK for Bunny
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
7
|
+
Run `bundle add bunny_app` or add this line to your application's Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem '
|
10
|
+
gem 'bunny_app'
|
11
11
|
```
|
12
12
|
|
13
13
|
And then execute:
|
@@ -19,7 +19,7 @@ $ bundle
|
|
19
19
|
Or install it yourself as:
|
20
20
|
|
21
21
|
```sh
|
22
|
-
$ gem install
|
22
|
+
$ gem install bunny_app
|
23
23
|
```
|
24
24
|
|
25
25
|
## Getting Started
|
@@ -153,9 +153,9 @@ This gem requires Ruby 2.5+
|
|
153
153
|
|
154
154
|
## Development
|
155
155
|
|
156
|
-
Run `
|
156
|
+
Run `bundle install` to install dependencies.
|
157
157
|
|
158
|
-
Run `rake spec` to run the tests.
|
158
|
+
Run `bundle exec rake spec` to run the tests.
|
159
159
|
|
160
160
|
You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
161
161
|
|
data/lib/bunny_app/client.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module BunnyApp
|
2
2
|
class FeatureUsage
|
3
|
-
@feature_usage_create_mutation = <<-
|
3
|
+
@feature_usage_create_mutation = <<-GRAPHQL
|
4
4
|
mutation featureUsageCreate ($attributes: FeatureUsageAttributes!) {
|
5
5
|
featureUsageCreate (attributes: $attributes) {
|
6
6
|
errors
|
@@ -8,10 +8,8 @@ module BunnyApp
|
|
8
8
|
id
|
9
9
|
quantity
|
10
10
|
usageAt
|
11
|
-
|
11
|
+
subscription {
|
12
12
|
id
|
13
|
-
code
|
14
|
-
name
|
15
13
|
}
|
16
14
|
feature {
|
17
15
|
id
|
@@ -23,12 +21,12 @@ module BunnyApp
|
|
23
21
|
}
|
24
22
|
GRAPHQL
|
25
23
|
|
26
|
-
def self.create(quantity:, feature_code:,
|
24
|
+
def self.create(quantity:, feature_code:, subscription_id:, usage_at: nil)
|
27
25
|
variables = {
|
28
26
|
attributes: {
|
29
27
|
quantity:,
|
30
28
|
featureCode: feature_code,
|
31
|
-
|
29
|
+
subscriptionId: subscription_id
|
32
30
|
}
|
33
31
|
}
|
34
32
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module BunnyApp
|
2
|
+
class TenantMetrics
|
3
|
+
@tenant_metrics_update_mutation = <<-'GRAPHQL'
|
4
|
+
mutation tenantMetricsUpdate ($code: String!, $attributes: TenantMetricsAttributes!) {
|
5
|
+
tenantMetricsUpdate (code: $code, attributes: $attributes) {
|
6
|
+
errors
|
7
|
+
}
|
8
|
+
}
|
9
|
+
GRAPHQL
|
10
|
+
|
11
|
+
def self.update(code:, last_login:, user_count:, utilization_metrics: {})
|
12
|
+
variables = {
|
13
|
+
code:,
|
14
|
+
attributes: {
|
15
|
+
lastLogin: last_login,
|
16
|
+
userCount: user_count,
|
17
|
+
utilizationMetrics: utilization_metrics
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
Client.new.query(@tenant_metrics_update_mutation, variables)
|
22
|
+
|
23
|
+
true
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/bunny_app/version.rb
CHANGED
data/lib/bunny_app.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bunny_app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bunny
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-04-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- lib/bunny_app/portal_session.rb
|
145
145
|
- lib/bunny_app/subscription.rb
|
146
146
|
- lib/bunny_app/tenant.rb
|
147
|
+
- lib/bunny_app/tenant_metrics.rb
|
147
148
|
- lib/bunny_app/version.rb
|
148
149
|
- lib/bunny_app/webhook.rb
|
149
150
|
- lib/generators/bunny_app/install_generator.rb
|