nylas 6.0.0.beta.4 → 6.0.1
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 +30 -8
- data/lib/nylas/resources/auth.rb +1 -1
- data/lib/nylas/resources/calendars.rb +2 -2
- data/lib/nylas/resources/contacts.rb +4 -4
- data/lib/nylas/resources/drafts.rb +2 -2
- data/lib/nylas/resources/events.rb +2 -2
- data/lib/nylas/resources/folders.rb +2 -2
- data/lib/nylas/resources/messages.rb +3 -3
- data/lib/nylas/resources/threads.rb +2 -2
- data/lib/nylas/version.rb +1 -1
- metadata +4 -5
- data/lib/nylas/test.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bc9d352821f8cde06dbc037ea67f17ed9a74f8dea1f9af98ebd4d03bc931e05
|
4
|
+
data.tar.gz: 8a172bc12ea5c467442079dc27f557034ef33924de9222275cde90eb6fafd49a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e18c1c89f5bacace76a182d5a2f33215625855d64ba2d5ec406c6529c1d9eee41d54921accf73879dc89db8374ef9d08d85c9ea0939d9fe1efb7e1c92eb5c770
|
7
|
+
data.tar.gz: 2a0faa22fdc201dfc556cb65acd0305dbc83c601d649771dad6b7dd5ce15c94b8dc060cfdb2d49ee2a8bb6ba3a86a61fd86d72cbd74a5323793035312f8d38f0
|
@@ -11,13 +11,37 @@ module Nylas
|
|
11
11
|
protected
|
12
12
|
|
13
13
|
include HttpClient
|
14
|
-
# Performs a GET call to the Nylas API.
|
14
|
+
# Performs a GET call to the Nylas API for a single item response.
|
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 Nylas data object and API Request ID.
|
18
|
+
# @return [Array([Hash, Array], String)] Nylas data object and API Request ID.
|
19
19
|
def get(path:, query_params: {})
|
20
|
-
response =
|
20
|
+
response = get_raw(path: path, query_params: query_params)
|
21
|
+
|
22
|
+
[response[:data], response[:request_id]]
|
23
|
+
end
|
24
|
+
|
25
|
+
# Performs a GET call to the Nylas API for a list response.
|
26
|
+
#
|
27
|
+
# @param path [String] Destination path for the call.
|
28
|
+
# @param query_params [Hash, {}] Query params to pass to the call.
|
29
|
+
# @return [Array(Array(Hash), String, String)] Nylas data array, API Request ID, and next cursor.
|
30
|
+
def get_list(path:, query_params: {})
|
31
|
+
response = get_raw(path: path, query_params: query_params)
|
32
|
+
|
33
|
+
[response[:data], response[:request_id], response[:next_cursor]]
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
# Performs a GET call to the Nylas API.
|
39
|
+
#
|
40
|
+
# @param path [String] Destination path for the call.
|
41
|
+
# @param query_params [Hash, {}] Query params to pass to the call.
|
42
|
+
# @return [Hash] The JSON response from the Nylas API.
|
43
|
+
def get_raw(path:, query_params: {})
|
44
|
+
execute(
|
21
45
|
method: :get,
|
22
46
|
path: path,
|
23
47
|
query: query_params,
|
@@ -25,8 +49,6 @@ module Nylas
|
|
25
49
|
api_key: api_key,
|
26
50
|
timeout: timeout
|
27
51
|
)
|
28
|
-
|
29
|
-
[response[:data], response[:request_id]]
|
30
52
|
end
|
31
53
|
end
|
32
54
|
|
@@ -39,7 +61,7 @@ module Nylas
|
|
39
61
|
#
|
40
62
|
# @param path [String] Destination path for the call.
|
41
63
|
# @param query_params [Hash, {}] Query params to pass to the call.
|
42
|
-
# @param request_body [
|
64
|
+
# @param request_body [Hash, nil] Request body to pass to the call.
|
43
65
|
# @param headers [Hash, {}] Additional HTTP headers to include in the payload.
|
44
66
|
# @return Nylas data object and API Request ID.
|
45
67
|
def post(path:, query_params: {}, request_body: nil, headers: {})
|
@@ -66,7 +88,7 @@ module Nylas
|
|
66
88
|
#
|
67
89
|
# @param path [String] Destination path for the call.
|
68
90
|
# @param query_params [Hash, {}] Query params to pass to the call.
|
69
|
-
# @param request_body [
|
91
|
+
# @param request_body [Hash, nil] Request body to pass to the call.
|
70
92
|
# @param headers [Hash, {}] Additional HTTP headers to include in the payload.
|
71
93
|
# @return Nylas data object and API Request ID.
|
72
94
|
def put(path:, query_params: {}, request_body: nil, headers: {})
|
@@ -93,7 +115,7 @@ module Nylas
|
|
93
115
|
#
|
94
116
|
# @param path [String] Destination path for the call.
|
95
117
|
# @param query_params [Hash, {}] Query params to pass to the call.
|
96
|
-
# @param request_body [
|
118
|
+
# @param request_body [Hash, nil] Request body to pass to the call.
|
97
119
|
# @param headers [Hash, {}] Additional HTTP headers to include in the payload.
|
98
120
|
# @return Nylas data object and API Request ID.
|
99
121
|
def patch(path:, query_params: {}, request_body: nil, headers: {})
|
data/lib/nylas/resources/auth.rb
CHANGED
@@ -151,7 +151,7 @@ module Nylas
|
|
151
151
|
def url_auth_builder(config)
|
152
152
|
builder = URI.parse(api_uri)
|
153
153
|
builder.path = "/v3/connect/auth"
|
154
|
-
builder.query = URI.encode_www_form(build_query(config)).gsub
|
154
|
+
builder.query = URI.encode_www_form(build_query(config)).gsub(/\+/, "%20")
|
155
155
|
|
156
156
|
builder
|
157
157
|
end
|
@@ -15,9 +15,9 @@ module Nylas
|
|
15
15
|
#
|
16
16
|
# @param identifier [String] Grant ID or email account to query.
|
17
17
|
# @param query_params [Hash, nil] Query params to pass to the request.
|
18
|
-
# @return [Array(Array(Hash), String)] The list of calendars
|
18
|
+
# @return [Array(Array(Hash), String, String)] The list of calendars, API Request ID, and next cursor.
|
19
19
|
def list(identifier:, query_params: nil)
|
20
|
-
|
20
|
+
get_list(
|
21
21
|
path: "#{api_uri}/v3/grants/#{identifier}/calendars",
|
22
22
|
query_params: query_params
|
23
23
|
)
|
@@ -15,9 +15,9 @@ module Nylas
|
|
15
15
|
#
|
16
16
|
# @param identifier [String] Grant ID or email account to query.
|
17
17
|
# @param query_params [Hash, nil] Query params to pass to the request.
|
18
|
-
# @return [Array(Array(Hash), String)] The list of contacts
|
18
|
+
# @return [Array(Array(Hash), String, String)] The list of contacts, API Request ID, and next cursor.
|
19
19
|
def list(identifier:, query_params: nil)
|
20
|
-
|
20
|
+
get_list(
|
21
21
|
path: "#{api_uri}/v3/grants/#{identifier}/contacts",
|
22
22
|
query_params: query_params
|
23
23
|
)
|
@@ -78,9 +78,9 @@ module Nylas
|
|
78
78
|
#
|
79
79
|
# @param identifier [String] Grant ID or email account to query.
|
80
80
|
# @param query_params [Hash, nil] Query params to pass to the request.
|
81
|
-
# @return [Array(Array(Hash), String)] The list of contact groups and API Request ID.
|
81
|
+
# @return [Array(Array(Hash), String, String)] The list of contact groups and API Request ID.
|
82
82
|
def list_groups(identifier:, query_params: nil)
|
83
|
-
|
83
|
+
get_list(
|
84
84
|
path: "#{api_uri}/v3/grants/#{identifier}/contacts/groups",
|
85
85
|
query_params: query_params
|
86
86
|
)
|
@@ -16,9 +16,9 @@ module Nylas
|
|
16
16
|
#
|
17
17
|
# @param identifier [String] Grant ID or email account to query.
|
18
18
|
# @param query_params [Hash, nil] Query params to pass to the request.
|
19
|
-
# @return [Array(Array(Hash), String)] The list of drafts
|
19
|
+
# @return [Array(Array(Hash), String, String)] The list of drafts, API Request ID, and next cursor.
|
20
20
|
def list(identifier:, query_params: nil)
|
21
|
-
|
21
|
+
get_list(
|
22
22
|
path: "#{api_uri}/v3/grants/#{identifier}/drafts",
|
23
23
|
query_params: query_params
|
24
24
|
)
|
@@ -15,9 +15,9 @@ module Nylas
|
|
15
15
|
#
|
16
16
|
# @param identifier [String] Grant ID or email account to query.
|
17
17
|
# @param query_params [Hash] Query params to pass to the request.
|
18
|
-
# @return [Array(Array(Hash), String)] The list of events
|
18
|
+
# @return [Array(Array(Hash), String, String)] The list of events, API Request ID, and next cursor.
|
19
19
|
def list(identifier:, query_params:)
|
20
|
-
|
20
|
+
get_list(
|
21
21
|
path: "#{api_uri}/v3/grants/#{identifier}/events",
|
22
22
|
query_params: query_params
|
23
23
|
)
|
@@ -14,9 +14,9 @@ module Nylas
|
|
14
14
|
# Return all folders.
|
15
15
|
#
|
16
16
|
# @param identifier [String] Grant ID or email account to query.
|
17
|
-
# @return [Array(Array(Hash), String)] The list of folders
|
17
|
+
# @return [Array(Array(Hash), String, String)] The list of folders, API Request ID, and next cursor.
|
18
18
|
def list(identifier:)
|
19
|
-
|
19
|
+
get_list(
|
20
20
|
path: "#{api_uri}/v3/grants/#{identifier}/folders"
|
21
21
|
)
|
22
22
|
end
|
@@ -26,9 +26,9 @@ module Nylas
|
|
26
26
|
#
|
27
27
|
# @param identifier [String] Grant ID or email account to query.
|
28
28
|
# @param query_params [Hash, nil] Query params to pass to the request.
|
29
|
-
# @return [Array(Array(Hash), String)] The list of messages
|
29
|
+
# @return [Array(Array(Hash), String, String)] The list of messages, API Request ID, and next cursor.
|
30
30
|
def list(identifier:, query_params: nil)
|
31
|
-
|
31
|
+
get_list(
|
32
32
|
path: "#{api_uri}/v3/grants/#{identifier}/messages",
|
33
33
|
query_params: query_params
|
34
34
|
)
|
@@ -94,7 +94,7 @@ module Nylas
|
|
94
94
|
# Retrieve your scheduled messages.
|
95
95
|
#
|
96
96
|
# @param identifier [String] Grant ID or email account from which to find the scheduled message from.
|
97
|
-
# @return [Array(Hash, String)] The list of scheduled messages and the API Request ID.
|
97
|
+
# @return [Array(Array(Hash), String)] The list of scheduled messages and the API Request ID.
|
98
98
|
def list_scheduled_messages(identifier:)
|
99
99
|
get(
|
100
100
|
path: "#{api_uri}/v3/grants/#{identifier}/messages/schedules"
|
@@ -14,9 +14,9 @@ module Nylas
|
|
14
14
|
#
|
15
15
|
# @param identifier [String] Grant ID or email account to query.
|
16
16
|
# @param query_params [Hash] Query params to pass to the request.
|
17
|
-
# @return [Array(Array(Hash), String)] The list of threads
|
17
|
+
# @return [Array(Array(Hash), String, String)] The list of threads, API Request ID, and next cursor.
|
18
18
|
def list(identifier:, query_params: nil)
|
19
|
-
|
19
|
+
get_list(
|
20
20
|
path: "#{api_uri}/v3/grants/#{identifier}/threads",
|
21
21
|
query_params: query_params
|
22
22
|
)
|
data/lib/nylas/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nylas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nylas, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mime-types
|
@@ -251,7 +251,6 @@ files:
|
|
251
251
|
- lib/nylas/resources/smart_compose.rb
|
252
252
|
- lib/nylas/resources/threads.rb
|
253
253
|
- lib/nylas/resources/webhooks.rb
|
254
|
-
- lib/nylas/test.rb
|
255
254
|
- lib/nylas/utils/file_utils.rb
|
256
255
|
- lib/nylas/version.rb
|
257
256
|
homepage:
|
@@ -275,9 +274,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
275
274
|
version: '3.0'
|
276
275
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
277
276
|
requirements:
|
278
|
-
- - "
|
277
|
+
- - ">="
|
279
278
|
- !ruby/object:Gem::Version
|
280
|
-
version:
|
279
|
+
version: '0'
|
281
280
|
requirements: []
|
282
281
|
rubygems_version: 3.4.10
|
283
282
|
signing_key:
|
data/lib/nylas/test.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "nylas"
|
4
|
-
|
5
|
-
nylas = Nylas::Client.new(api_key: "abc123")
|
6
|
-
config = {
|
7
|
-
client_id: ENV["V3_CLIENT"],
|
8
|
-
provider: "google",
|
9
|
-
redirect_uri: "http://localhost:4567/oauth/exchange",
|
10
|
-
login_hint: "atejada@gmail.com"
|
11
|
-
}
|
12
|
-
|
13
|
-
auth_data = nylas.auth.url_for_oauth2_pkce(config)
|
14
|
-
puts auth_data
|