nylas 6.2.2 → 6.3.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/api_operations.rb +7 -6
- data/lib/nylas/handler/http_client.rb +21 -4
- data/lib/nylas/resources/events.rb +14 -0
- data/lib/nylas/utils/file_utils.rb +1 -0
- data/lib/nylas/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6aa010eb2b2938c69724103ee74d3a3898320bf31631e2d8838223ce4779a09
|
4
|
+
data.tar.gz: 0b91f115c36a87cab0ab5110eaffbe4a042168e5f2b152df4be16702a6040be9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 873debe33d40035191e712eb7239840e4343bc6180e657f25dac7c39b73dec6c597d57ce63e204358f8b266f237a2fa4b7a7f52766a07e6f2ef95f8f0cbeb8ff
|
7
|
+
data.tar.gz: efb90a1bd1930a0536b418c16de61d84bc6925e3f6fb5f9c39cde4dd77bb406dacd6fee2f7799257a3dd430e7ec9da23221ab9222d387bba75be96f806aec3e4
|
@@ -15,22 +15,23 @@ module Nylas
|
|
15
15
|
#
|
16
16
|
# @param path [String] Destination path for the call.
|
17
17
|
# @param query_params [Hash, {}] Query params to pass to the call.
|
18
|
-
# @return [Array([Hash, Array], String)] Nylas data object
|
18
|
+
# @return [Array([Hash, Array], String, Hash)] Nylas data object, API Request ID, and response headers.
|
19
19
|
def get(path:, query_params: {})
|
20
20
|
response = get_raw(path: path, query_params: query_params)
|
21
21
|
|
22
|
-
[response[:data], response[:request_id]]
|
22
|
+
[response[:data], response[:request_id], response[:headers]]
|
23
23
|
end
|
24
24
|
|
25
25
|
# Performs a GET call to the Nylas API for a list response.
|
26
26
|
#
|
27
27
|
# @param path [String] Destination path for the call.
|
28
28
|
# @param query_params [Hash, {}] Query params to pass to the call.
|
29
|
-
# @return [Array
|
29
|
+
# @return [Array<Array<Hash>, String, String, Hash>]
|
30
|
+
# Nylas data array, API Request ID, next cursor, and response headers.response headers.
|
30
31
|
def get_list(path:, query_params: {})
|
31
32
|
response = get_raw(path: path, query_params: query_params)
|
32
33
|
|
33
|
-
[response[:data], response[:request_id], response[:next_cursor]]
|
34
|
+
[response[:data], response[:request_id], response[:next_cursor], response[:headers]]
|
34
35
|
end
|
35
36
|
|
36
37
|
private
|
@@ -63,7 +64,7 @@ module Nylas
|
|
63
64
|
# @param query_params [Hash, {}] Query params to pass to the call.
|
64
65
|
# @param request_body [Hash, nil] Request body to pass to the call.
|
65
66
|
# @param headers [Hash, {}] Additional HTTP headers to include in the payload.
|
66
|
-
# @return Nylas data object
|
67
|
+
# @return [Array(Hash, String, Hash)] Nylas data object, API Request ID, and response headers.
|
67
68
|
def post(path:, query_params: {}, request_body: nil, headers: {})
|
68
69
|
response = execute(
|
69
70
|
method: :post,
|
@@ -75,7 +76,7 @@ module Nylas
|
|
75
76
|
timeout: timeout
|
76
77
|
)
|
77
78
|
|
78
|
-
[response[:data], response[:request_id]]
|
79
|
+
[response[:data], response[:request_id], response[:headers]]
|
79
80
|
end
|
80
81
|
end
|
81
82
|
|
@@ -40,7 +40,10 @@ module Nylas
|
|
40
40
|
content_type = response.headers[:content_type].downcase
|
41
41
|
end
|
42
42
|
|
43
|
-
parse_json_evaluate_error(result.code.to_i, response, path, content_type)
|
43
|
+
parsed_response = parse_json_evaluate_error(result.code.to_i, response, path, content_type)
|
44
|
+
# Include headers in the response
|
45
|
+
parsed_response[:headers] = response.headers unless parsed_response.nil?
|
46
|
+
parsed_response
|
44
47
|
end
|
45
48
|
rescue RestClient::Exceptions::OpenTimeout, RestClient::Exceptions::ReadTimeout
|
46
49
|
raise Nylas::NylasSdkTimeoutError.new(request[:path], timeout)
|
@@ -198,10 +201,24 @@ module Nylas
|
|
198
201
|
|
199
202
|
def throw_error(response, status_code)
|
200
203
|
error_obj = response[:error]
|
201
|
-
provider_error = error_obj.fetch(:provider_error, nil)
|
202
204
|
|
203
|
-
|
204
|
-
|
205
|
+
# If `error_obj` is just a string, turn it into a hash with default keys.
|
206
|
+
if error_obj.is_a?(String)
|
207
|
+
error_obj = {
|
208
|
+
type: "NylasApiError",
|
209
|
+
message: error_obj
|
210
|
+
}
|
211
|
+
end
|
212
|
+
|
213
|
+
provider_error = error_obj.fetch(:provider_error, nil) if error_obj.is_a?(Hash)
|
214
|
+
|
215
|
+
NylasApiError.new(
|
216
|
+
error_obj[:type],
|
217
|
+
error_obj[:message],
|
218
|
+
status_code,
|
219
|
+
provider_error,
|
220
|
+
response[:request_id]
|
221
|
+
)
|
205
222
|
end
|
206
223
|
|
207
224
|
# Adds query parameters to a URL.
|
@@ -94,5 +94,19 @@ module Nylas
|
|
94
94
|
request_body: request_body
|
95
95
|
)
|
96
96
|
end
|
97
|
+
|
98
|
+
# Returns a list of recurring events, recurring event exceptions, and single events
|
99
|
+
# from the specified calendar within a given time frame. This is useful when you
|
100
|
+
# want to import, store, and synchronize events from the time frame to your application
|
101
|
+
#
|
102
|
+
# @param identifier [String] Grant ID or email account to import events from.
|
103
|
+
# @param query_params [Hash] The query parameters to include in the request
|
104
|
+
# @return [(Array(Hash), String, String)] The list of events, API Request ID, and next cursor.
|
105
|
+
def list_import_events(identifier:, query_params:)
|
106
|
+
get_list(
|
107
|
+
path: "#{api_uri}/v3/grants/#{identifier}/events/import",
|
108
|
+
query_params: query_params
|
109
|
+
)
|
110
|
+
end
|
97
111
|
end
|
98
112
|
end
|
data/lib/nylas/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nylas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nylas, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: base64
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: mime-types
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -297,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
297
311
|
- !ruby/object:Gem::Version
|
298
312
|
version: '0'
|
299
313
|
requirements: []
|
300
|
-
rubygems_version: 3.
|
314
|
+
rubygems_version: 3.4.18
|
301
315
|
signing_key:
|
302
316
|
specification_version: 4
|
303
317
|
summary: Gem for interacting with the Nylas API
|