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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0679df10d54f538c211fe1ed824c1b537d859f009ceb9131f2bb8165e14ebd8
4
- data.tar.gz: 40ebd43e2d84bd49d9f4c224dad09d48d6a5ba07b8a6c5a67d97d1ae27db0a66
3
+ metadata.gz: 713f2dd54e42a46e2bde441a09420de5e685a00f35f0683d156a0bc25e53b1a5
4
+ data.tar.gz: adf590d8fe14df2b06399e3d1c55e1dfe3866956f5e9ce8f3596e6f451ac6637
5
5
  SHA512:
6
- metadata.gz: f573c0bcb3569634e4cf14590bef2bf54d9630a4425392a11a1c12b3046c182a78bb4284410645d14866ce4bfa683eaf4eb41a92fca2ecc130d1a071dd58c185
7
- data.tar.gz: dd07c19832a5e5e81f9c4e562de088560e175214e41f2ed3bc09ac583336249fab5a3f4fc9da3d87a147df41ecb7246f5ac4f3888e5a130d9a36f62ffcfc10db
6
+ metadata.gz: 31fd8695d7c7b5215ecfc7420304d5a8430c95a9880dab644cf421dc0e1efa5c9c929960c6510c58efb0a6a484b78b7fbd506baba50098245e505955c642fd4e
7
+ data.tar.gz: 9167b52dd6dea36438f5c05aa93de5cc554918b5baa43517c59ca213fb5bca61670d9ad1ab982832ae8c7c26e6b1e1d8d0c8e123ec99bbefdf32c95cc7f029e6
@@ -92,7 +92,7 @@ module BunnyApp
92
92
  end
93
93
 
94
94
  def verify_ssl
95
- return true unless ENV['IGNORE_SSL']
95
+ true unless ENV['IGNORE_SSL']
96
96
  end
97
97
 
98
98
  def host_header
@@ -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
@@ -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 = <<-'GRAPHQL'
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 = <<-'GRAPHQL'
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
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BunnyApp
4
- VERSION = '2.0.4'
4
+ VERSION = '2.1.0'
5
5
  end
data/lib/bunny_app.rb CHANGED
@@ -7,7 +7,6 @@ require 'bunny_app/tenant'
7
7
  require 'bunny_app/subscription'
8
8
  require 'bunny_app/webhook'
9
9
  require 'bunny_app/portal_session'
10
- require 'bunny_app/tenant_metrics'
11
10
 
12
11
  module BunnyApp
13
12
  class << self
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
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: 2023-12-18 00:00:00.000000000 Z
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