nylas 6.6.0 → 6.7.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 +4 -4
- data/lib/nylas/handler/http_client.rb +8 -10
- data/lib/nylas/version.rb +1 -1
- metadata +3 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc90a16ef74fc2f47d6f35ada72d9cd80e3e842e08d9d5b1916a819ae36c0808
|
4
|
+
data.tar.gz: b2c8494899f1b2ff4620dfbcce0aeb52e037adfe97f1609bcaaf455bfb843745
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9cda94765c3957d6457071ac616dd12a3a807378773b566da0be82b39c5a89db370049f21744b91ed8f3a5abf211b6c75363f8df10f52d102007becfcd2a635
|
7
|
+
data.tar.gz: e50d00d31fdb2ae23058d146b38cc75a5a75f239ba19220b5c28280defe4624b4ab4d858ec3abd496555ab6b0f35033ac2c606ed2bc346572f0593df0cebb5cc
|
@@ -41,7 +41,8 @@ module Nylas
|
|
41
41
|
content_type = response.headers["content-type"].downcase
|
42
42
|
end
|
43
43
|
|
44
|
-
parsed_response = parse_json_evaluate_error(result.code.to_i, response.body, path, content_type
|
44
|
+
parsed_response = parse_json_evaluate_error(result.code.to_i, response.body, path, content_type,
|
45
|
+
response.headers)
|
45
46
|
# Include headers in the response
|
46
47
|
parsed_response[:headers] = response.headers unless parsed_response.nil?
|
47
48
|
parsed_response
|
@@ -311,37 +312,34 @@ module Nylas
|
|
311
312
|
end
|
312
313
|
|
313
314
|
# Parses the response from the Nylas API and evaluates for errors.
|
314
|
-
def parse_json_evaluate_error(http_code, response, path, content_type = nil)
|
315
|
+
def parse_json_evaluate_error(http_code, response, path, content_type = nil, headers = nil)
|
315
316
|
begin
|
316
317
|
response = parse_response(response) if content_type == "application/json"
|
317
318
|
rescue Nylas::JsonParseError
|
318
|
-
handle_failed_response(http_code, response, path)
|
319
|
+
handle_failed_response(http_code, response, path, headers)
|
319
320
|
raise
|
320
321
|
end
|
321
322
|
|
322
|
-
handle_failed_response(http_code, response, path)
|
323
|
+
handle_failed_response(http_code, response, path, headers)
|
323
324
|
response
|
324
325
|
end
|
325
326
|
|
326
327
|
# Handles failed responses from the Nylas API.
|
327
|
-
def handle_failed_response(http_code, response, path)
|
328
|
+
def handle_failed_response(http_code, response, path, headers = nil)
|
328
329
|
return if HTTP_SUCCESS_CODES.include?(http_code)
|
329
330
|
|
330
331
|
case response
|
331
332
|
when Hash
|
332
|
-
raise error_hash_to_exception(response, http_code, path)
|
333
|
+
raise error_hash_to_exception(response, http_code, path, headers)
|
333
334
|
else
|
334
335
|
raise NylasApiError.parse_error_response(response, http_code)
|
335
336
|
end
|
336
337
|
end
|
337
338
|
|
338
339
|
# Converts error hashes to exceptions.
|
339
|
-
def error_hash_to_exception(response, status_code, path)
|
340
|
+
def error_hash_to_exception(response, status_code, path, headers = nil)
|
340
341
|
return if !response || !response.key?(:error)
|
341
342
|
|
342
|
-
# Safely get headers without risking KeyError
|
343
|
-
headers = response.key?(:headers) ? response[:headers] : nil
|
344
|
-
|
345
343
|
if %W[#{api_uri}/v3/connect/token #{api_uri}/v3/connect/revoke].include?(path)
|
346
344
|
NylasOAuthError.new(response[:error], response[:error_description], response[:error_uri],
|
347
345
|
response[:error_code], status_code)
|
data/lib/nylas/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nylas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nylas, Inc.
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: base64
|
@@ -295,7 +294,6 @@ files:
|
|
295
294
|
- lib/nylas/resources/webhooks.rb
|
296
295
|
- lib/nylas/utils/file_utils.rb
|
297
296
|
- lib/nylas/version.rb
|
298
|
-
homepage:
|
299
297
|
licenses:
|
300
298
|
- MIT
|
301
299
|
metadata:
|
@@ -305,7 +303,6 @@ metadata:
|
|
305
303
|
homepage_uri: https://www.nylas.com
|
306
304
|
source_code_uri: https://github.com/nylas/nylas-ruby
|
307
305
|
github_repo: https://github.com/nylas/nylas-ruby
|
308
|
-
post_install_message:
|
309
306
|
rdoc_options: []
|
310
307
|
require_paths:
|
311
308
|
- lib
|
@@ -320,8 +317,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
320
317
|
- !ruby/object:Gem::Version
|
321
318
|
version: '0'
|
322
319
|
requirements: []
|
323
|
-
rubygems_version: 3.
|
324
|
-
signing_key:
|
320
|
+
rubygems_version: 3.7.2
|
325
321
|
specification_version: 4
|
326
322
|
summary: Gem for interacting with the Nylas API
|
327
323
|
test_files: []
|