bunny_app 1.25.0 → 1.27.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: '019de290c7ea498f815013ec4361ed8d6f6b4282df2a569efbe2115d38767e1e'
4
- data.tar.gz: 53307b39bff195f94f016c5df7a7450be01dc81ce35d49e68a44fd9ad623f0b6
3
+ metadata.gz: d67f3187a50fd1d998075d81e8f345c78a5f231b1d907638284610509533ff05
4
+ data.tar.gz: 8f259894ea6e004c8c87de34372fb1a660377b2f2e4ec3ee873a3a0bdd8777b6
5
5
  SHA512:
6
- metadata.gz: 882dd75a55c66339e07d1cd5ad7cd35812ccd691be9930358e26700c67d441b096353bfb7b2baa274590086449da6efcc274d540a4d60a389204c6e2574c8d33
7
- data.tar.gz: 4c6021936e7628efb492179b0c4da2b24ae1b3606280b8627ddfc4ee496d4ae0189b291e05f56b799adc086996e915bbf45f2f271f2c2272479fa25c15912d7d
6
+ metadata.gz: 451b3e299194c86da0439f0ae1a736872d73a040849bf11cb7dab34dc67f765e7442b6e1468ec8ee09c8307f80d0704b42ecd8c3f30d706d44485a546eeb87d8
7
+ data.tar.gz: 88e7d2fbd433ef046a67e5b7c8d9ffb7579f2ea39a5a245266489cc9af4486b9bf7f312be331dc4f63a554b5a5d4921456ede28907ea667b9e9206c77929d028
data/README.md CHANGED
@@ -75,6 +75,14 @@ response = BunnyApp::Subscription.create(
75
75
  )
76
76
  ```
77
77
 
78
+ ### Get a portal session token for use with Bunny.js
79
+
80
+ ```ruby
81
+ response = BunnyApp::PortalSession.create(
82
+ tenant_code: "123456"
83
+ )
84
+ ```
85
+
78
86
  ### Track feature usage
79
87
 
80
88
  If you have usage based billing or just want to track feature usage then use this method.
@@ -0,0 +1,22 @@
1
+ module BunnyApp
2
+ class PortalSession
3
+ @portal_session_create_mutation = <<-'GRAPHQL'
4
+ mutation portalSessionCreate ($tenantCode: String!) {
5
+ portalSessionCreate (tenantCode: $tenantCode) {
6
+ token
7
+ errors
8
+ }
9
+ }
10
+ GRAPHQL
11
+
12
+ def self.create(tenant_code:, expiry_hours: 24, return_url: nil)
13
+ variables = {
14
+ tenantCode: tenant_code,
15
+ returnUrl: return_url,
16
+ expiry: expiry_hours
17
+ }
18
+
19
+ Client.new.query(@portal_session_create_mutation, variables)
20
+ end
21
+ end
22
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BunnyApp
4
- VERSION = '1.25.0'
4
+ VERSION = '1.27.0'
5
5
  end
data/lib/bunny_app.rb CHANGED
@@ -6,6 +6,7 @@ require 'bunny_app/platform'
6
6
  require 'bunny_app/tenant'
7
7
  require 'bunny_app/subscription'
8
8
  require 'bunny_app/webhook'
9
+ require 'bunny_app/portal_session'
9
10
 
10
11
  module BunnyApp
11
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: 1.25.0
4
+ version: 1.27.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-01-16 00:00:00.000000000 Z
12
+ date: 2023-06-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -140,6 +140,7 @@ files:
140
140
  - lib/bunny_app/client.rb
141
141
  - lib/bunny_app/errors.rb
142
142
  - lib/bunny_app/platform.rb
143
+ - lib/bunny_app/portal_session.rb
143
144
  - lib/bunny_app/subscription.rb
144
145
  - lib/bunny_app/tenant.rb
145
146
  - lib/bunny_app/usage.rb