bunny_app 2.0.4 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bunny_app/client.rb +1 -1
- data/lib/bunny_app/feature_usage.rb +2 -0
- data/lib/bunny_app/platform.rb +2 -0
- data/lib/bunny_app/portal_session.rb +2 -0
- data/lib/bunny_app/subscription.rb +6 -3
- data/lib/bunny_app/tenant.rb +3 -0
- data/lib/bunny_app/version.rb +1 -1
- data/lib/bunny_app.rb +0 -1
- metadata +2 -3
- data/lib/bunny_app/tenant_metrics.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 713f2dd54e42a46e2bde441a09420de5e685a00f35f0683d156a0bc25e53b1a5
|
4
|
+
data.tar.gz: adf590d8fe14df2b06399e3d1c55e1dfe3866956f5e9ce8f3596e6f451ac6637
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31fd8695d7c7b5215ecfc7420304d5a8430c95a9880dab644cf421dc0e1efa5c9c929960c6510c58efb0a6a484b78b7fbd506baba50098245e505955c642fd4e
|
7
|
+
data.tar.gz: 9167b52dd6dea36438f5c05aa93de5cc554918b5baa43517c59ca213fb5bca61670d9ad1ab982832ae8c7c26e6b1e1d8d0c8e123ec99bbefdf32c95cc7f029e6
|
data/lib/bunny_app/client.rb
CHANGED
@@ -35,6 +35,8 @@ module BunnyApp
|
|
35
35
|
variables[:attributes][:usageAt] = usage_at unless usage_at.nil?
|
36
36
|
|
37
37
|
res = Client.new.query(@feature_usage_create_mutation, variables)
|
38
|
+
raise ResponseError, res['data']['featureUsageCreate']['errors'].join(',') if res['data']['featureUsageCreate']['errors']
|
39
|
+
|
38
40
|
res['data']['featureUsageCreate']['featureUsage']
|
39
41
|
end
|
40
42
|
end
|
data/lib/bunny_app/platform.rb
CHANGED
@@ -22,6 +22,8 @@ module BunnyApp
|
|
22
22
|
}
|
23
23
|
|
24
24
|
res = Client.new.query(@platform_create_mutation, variables)
|
25
|
+
raise ResponseError, res['data']['platformCreate']['errors'].join(',') if res['data']['platformCreate']['errors']
|
26
|
+
|
25
27
|
res['data']['platformCreate']['platform']
|
26
28
|
end
|
27
29
|
end
|
@@ -17,6 +17,8 @@ module BunnyApp
|
|
17
17
|
}
|
18
18
|
|
19
19
|
res = Client.new.query(@portal_session_create_mutation, variables)
|
20
|
+
raise ResponseError, res['data']['portalSessionCreate']['errors'].join(',') if res['data']['portalSessionCreate']['errors']
|
21
|
+
|
20
22
|
res['data']['portalSessionCreate']['token']
|
21
23
|
end
|
22
24
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module BunnyApp
|
2
2
|
class Subscription
|
3
|
-
@subscription_create_mutation = <<-
|
3
|
+
@subscription_create_mutation = <<-GRAPHQL
|
4
4
|
mutation subscriptionCreate ($attributes: SubscriptionAttributes!) {
|
5
5
|
subscriptionCreate (attributes: $attributes) {
|
6
6
|
subscription {
|
@@ -39,7 +39,7 @@ module BunnyApp
|
|
39
39
|
}
|
40
40
|
GRAPHQL
|
41
41
|
|
42
|
-
@subscription_cancel_mutation = <<-
|
42
|
+
@subscription_cancel_mutation = <<-GRAPHQL
|
43
43
|
mutation subscriptionCancel ($ids: [ID!]!) {
|
44
44
|
subscriptionCancel (ids: $ids) {
|
45
45
|
errors
|
@@ -78,6 +78,8 @@ module BunnyApp
|
|
78
78
|
end
|
79
79
|
|
80
80
|
res = Client.new.query(@subscription_create_mutation, variables)
|
81
|
+
raise ResponseError, res['data']['subscriptionCreate']['errors'].join(',') if res['data']['subscriptionCreate']['errors']
|
82
|
+
|
81
83
|
res['data']['subscriptionCreate']['subscription']
|
82
84
|
end
|
83
85
|
|
@@ -86,7 +88,8 @@ module BunnyApp
|
|
86
88
|
ids: [subscription_id]
|
87
89
|
}
|
88
90
|
|
89
|
-
Client.new.query(@subscription_cancel_mutation, variables)
|
91
|
+
res = Client.new.query(@subscription_cancel_mutation, variables)
|
92
|
+
raise ResponseError, res['data']['subscriptionCancel']['errors'].join(',') if res['data']['subscriptionCancel']['errors']
|
90
93
|
|
91
94
|
true
|
92
95
|
end
|
data/lib/bunny_app/tenant.rb
CHANGED
@@ -52,6 +52,8 @@ module BunnyApp
|
|
52
52
|
}
|
53
53
|
|
54
54
|
res = Client.new.query(@tenant_create_mutation, variables)
|
55
|
+
raise ResponseError, res['data']['tenantCreate']['errors'].join(',') if res['data']['tenantCreate']['errors']
|
56
|
+
|
55
57
|
res['data']['tenantCreate']['tenant']
|
56
58
|
end
|
57
59
|
|
@@ -61,6 +63,7 @@ module BunnyApp
|
|
61
63
|
}
|
62
64
|
|
63
65
|
res = Client.new.query(@tenant_query, variables)
|
66
|
+
|
64
67
|
res['data']['tenant']
|
65
68
|
end
|
66
69
|
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.0
|
4
|
+
version: 2.1.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:
|
12
|
+
date: 2024-01-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -144,7 +144,6 @@ 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
|
148
147
|
- lib/bunny_app/version.rb
|
149
148
|
- lib/bunny_app/webhook.rb
|
150
149
|
- lib/generators/bunny_app/install_generator.rb
|
@@ -1,26 +0,0 @@
|
|
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
|