cronofy 0.31.0 → 0.31.1

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: 33f1ecf7569c8c425473149e5f926e64e9f1a09c194f2c77dfa092048e0a347a
4
- data.tar.gz: ca5415981d65cc82c9b53ea9886f8e1acdd299390f2db18a6f78b8203f680968
3
+ metadata.gz: 57b29b7a7d74bfeb8effadc79dc1b7db32c55666189bf3cd6a752ee472cf2fef
4
+ data.tar.gz: 944c20303ab4e950dd6a9fc69e087dff461f50be68a68a2ca97556821529113f
5
5
  SHA512:
6
- metadata.gz: 846e3d33bb4a9c7b72e51881df03d42176e51e190563603d589d036c8f1d29d5f36ff54f2a6abe906264f03928e9efca06035694f3a8207cbe790527323b2e41
7
- data.tar.gz: 064dbc5c4b14edb8917eeccefebf93ab82e94e6e2be751d82949f1ecd0c6a65f8f255a29c4910e9d219c21d30e774e816c784776d21349f48fc8ae73db9afc4a
6
+ metadata.gz: bd2f6482085df5c981a1a31ba9a816ec8cf36a7273c93eb27616a2613f16b9fd00b3803368d6aa9e8373b38eff1686429ce7274f5d30ebc306610f0a9d6ddfee
7
+ data.tar.gz: 452f25bfe0a6009428fd0ff7f52bd9191391349db2baee1ac325b9fbc76368619ad5f4c944d0cd20ceae7b7c4349441d6b04a67ecfb61a398a0be5a26afedf45
@@ -1,3 +1,7 @@
1
+ ## [0.31.1]
2
+
3
+ * No Authorization header for Real-Time Scheduling and Real-Time Sequencing [#72]
4
+
1
5
  ## [0.31.0]
2
6
 
3
7
  * Added support for Element Tokens [#69]
@@ -132,6 +136,7 @@
132
136
  [0.29.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.29.0
133
137
  [0.30.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.30.0
134
138
  [0.31.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.31.0
139
+ [0.31.1]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.31.1
135
140
 
136
141
  [#13]: https://github.com/cronofy/cronofy-ruby/pull/13
137
142
  [#16]: https://github.com/cronofy/cronofy-ruby/pull/16
@@ -165,3 +170,4 @@
165
170
  [#60]: https://github.com/cronofy/cronofy-ruby/pull/60
166
171
  [#62]: https://github.com/cronofy/cronofy-ruby/pull/62
167
172
  [#69]: https://github.com/cronofy/cronofy-ruby/pull/69
173
+ [#72]: https://github.com/cronofy/cronofy-ruby/pull/72
@@ -5,6 +5,7 @@ module Cronofy
5
5
  class Auth
6
6
  attr_reader :access_token
7
7
  attr_reader :api_key
8
+ attr_reader :api_client
8
9
 
9
10
  def initialize(options = {})
10
11
  access_token = options[:access_token]
@@ -1089,7 +1089,7 @@ module Cronofy
1089
1089
  translate_available_periods(availability[:available_periods])
1090
1090
  body[:availability] = availability
1091
1091
 
1092
- response = post("/v1/real_time_scheduling", body)
1092
+ response = raw_post("/v1/real_time_scheduling", body)
1093
1093
  parse_json(AddToCalendarResponse, nil , response)
1094
1094
  end
1095
1095
 
@@ -1175,7 +1175,7 @@ module Cronofy
1175
1175
 
1176
1176
  body[:availability] = availability
1177
1177
 
1178
- response = post("/v1/real_time_sequencing", body)
1178
+ response = raw_post("/v1/real_time_sequencing", body)
1179
1179
  parse_json(AddToCalendarResponse, nil , response)
1180
1180
  end
1181
1181
 
@@ -1539,6 +1539,10 @@ module Cronofy
1539
1539
  wrapped_request { access_token!.delete(url, json_request_args(body)) }
1540
1540
  end
1541
1541
 
1542
+ def raw_post(url, body)
1543
+ wrapped_request { @auth.api_client.request(:post, url, json_request_args(body)) }
1544
+ end
1545
+
1542
1546
  def wrapped_request
1543
1547
  yield
1544
1548
  rescue OAuth2::Error => e
@@ -1,3 +1,3 @@
1
1
  module Cronofy
2
- VERSION = "0.31.0".freeze
2
+ VERSION = "0.31.1".freeze
3
3
  end
@@ -59,7 +59,7 @@ describe Cronofy::Client do
59
59
  headers: correct_response_headers,
60
60
  body: correct_response_body.to_json)
61
61
 
62
- expect{ subject }.not_to raise_error
62
+ subject
63
63
  end
64
64
 
65
65
  it 'raises AuthenticationFailureError on 401s' do
@@ -1910,7 +1910,13 @@ describe Cronofy::Client do
1910
1910
  let(:request_url) { "https://api.cronofy.com/v1/real_time_scheduling" }
1911
1911
  let(:url) { URI("https://example.com") }
1912
1912
  let(:method) { :post }
1913
- let(:request_headers) { json_request_headers }
1913
+
1914
+ let(:request_headers) do
1915
+ {
1916
+ "User-Agent" => "Cronofy Ruby #{::Cronofy::VERSION}",
1917
+ "Content-Type" => "application/json; charset=utf-8",
1918
+ }
1919
+ end
1914
1920
 
1915
1921
  let(:location) { { :description => "Board room" } }
1916
1922
  let(:transparency) { nil }
@@ -1924,7 +1930,6 @@ describe Cronofy::Client do
1924
1930
  Cronofy::Client.new(
1925
1931
  client_id: client_id,
1926
1932
  client_secret: client_secret,
1927
- access_token: token,
1928
1933
  )
1929
1934
  end
1930
1935
 
@@ -2059,7 +2064,13 @@ describe Cronofy::Client do
2059
2064
  let(:request_url) { "https://api.cronofy.com/v1/real_time_sequencing" }
2060
2065
  let(:url) { URI("https://example.com") }
2061
2066
  let(:method) { :post }
2062
- let(:request_headers) { json_request_headers }
2067
+
2068
+ let(:request_headers) do
2069
+ {
2070
+ "User-Agent" => "Cronofy Ruby #{::Cronofy::VERSION}",
2071
+ "Content-Type" => "application/json; charset=utf-8",
2072
+ }
2073
+ end
2063
2074
 
2064
2075
  let(:location) { { :description => "Board room" } }
2065
2076
  let(:transparency) { nil }
@@ -2073,7 +2084,6 @@ describe Cronofy::Client do
2073
2084
  Cronofy::Client.new(
2074
2085
  client_id: client_id,
2075
2086
  client_secret: client_secret,
2076
- access_token: token,
2077
2087
  )
2078
2088
  end
2079
2089
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cronofy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.0
4
+ version: 0.31.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergii Paryzhskyi