jbr 1.0.7 → 1.1.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: 0e910cc53b4d0d49088e05481c72f0d828c97ecbea3e5c5a6a78da4d61988c7c
4
- data.tar.gz: 8f9945fe6d165a8d6837a567433472e244f25236db495b714269454efb85a662
3
+ metadata.gz: 2f297ed159c5c52e0623bd952d527e6c9f4f08096c3713e56c675d063ef22122
4
+ data.tar.gz: 3ee8802956955564d7a00d9fdecf62c4b118faf008a2aec8d6a705c938b16af1
5
5
  SHA512:
6
- metadata.gz: f4996c8bea8e6596863240cb7caee1d59e8ade0aeaba02c059ac0ff8e770e062a94dc2ca385a399033b36f4da9a6ba0fcc8ab5c81ccb3a576f471e6b0d9d6a76
7
- data.tar.gz: 0de414c6ece8eb9ce928c9431ed074472038efcf243d73af4262a43465fc1b128cb99f866f2d16956ff52f10a230cc05db3f54387e946f5d8fe4c01a02765d69
6
+ metadata.gz: db8bec452f365783476c24e942545d9569bd52cec31956e55e11f33965cb025c9e38da57ea385ab443a4951f711fa48d2fa66b192ee9b6f5e9a1d91a074d2522
7
+ data.tar.gz: 42fb80adcd5447e0a2771dd86410b722e9fd6eaba4ea2e0276bc2edb62b2a77413f420db2642c26d06ee93cb428c5c70e8ba96790cc1f58693f30bdca04efc68
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [1.1.0] - 2026-05-27
2
+
3
+ - [New] Add Jbr::Event.params_for
4
+
5
+ ## [1.0.8] - 2026-05-26
6
+
7
+ - [New] Add Jbr::OAuth.client_id and Jbr::OAuth.client_secret
8
+
1
9
  ## [1.0.7] - 2026-05-26
2
10
 
3
11
  - [New] Add Jbr::Event to parse webhook payloads
data/lib/jbr/event.rb CHANGED
@@ -13,5 +13,10 @@ module Jbr
13
13
 
14
14
  # @return [String] unique identifier of the event account.
15
15
  def account_id = @params.dig :data, :webHookEvent, :accountId
16
+
17
+ # @return [Hash] the shape of the payload send by Jobber to the callback URL.
18
+ def self.params_for(item_id:, account_id:)
19
+ { data: { webHookEvent: { itemId: item_id, accountId: account_id } } }
20
+ end
16
21
  end
17
22
  end
data/lib/jbr/oauth.rb CHANGED
@@ -44,6 +44,12 @@ module Jbr
44
44
  new(credentials).tap { |oauth| oauth.account_id = oauth.account.id }
45
45
  end
46
46
 
47
+ # @return [String, nil] The client ID to interact with the API.
48
+ def self.client_id = ENV['JOBBER_CLIENT_ID']
49
+
50
+ # @return [String, nil] The client secret to interact with the API.
51
+ def self.client_secret = ENV['JOBBER_CLIENT_SECRET']
52
+
47
53
  private
48
54
 
49
55
  def refresh
@@ -65,10 +71,6 @@ module Jbr
65
71
  expires_at: (Time.current + output.fetch('expires_in', 3600).to_i) }
66
72
  end
67
73
 
68
- def self.client_id = ENV['JOBBER_CLIENT_ID']
69
-
70
- def self.client_secret = ENV['JOBBER_CLIENT_SECRET']
71
-
72
74
  def client
73
75
  GraphQL::Client.new endpoint: 'https://api.getjobber.com/api/graphql', token: @access_token, headers: headers
74
76
  end
data/lib/jbr/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Jbr
4
- VERSION = '1.0.7'
4
+ VERSION = '1.1.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jbr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo