nylas 4.6.2 → 4.6.7
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.rb +19 -0
- data/lib/nylas/account.rb +1 -0
- data/lib/nylas/api.rb +10 -0
- data/lib/nylas/collection.rb +12 -7
- data/lib/nylas/constraints.rb +1 -0
- data/lib/nylas/deltas_collection.rb +2 -1
- data/lib/nylas/draft.rb +4 -0
- data/lib/nylas/errors.rb +6 -0
- data/lib/nylas/event.rb +14 -0
- data/lib/nylas/file.rb +5 -1
- data/lib/nylas/free_busy.rb +13 -0
- data/lib/nylas/free_busy_collection.rb +48 -0
- data/lib/nylas/http_client.rb +21 -5
- data/lib/nylas/logging.rb +0 -3
- data/lib/nylas/message.rb +20 -2
- data/lib/nylas/model.rb +20 -6
- data/lib/nylas/model/attribute_definition.rb +1 -0
- data/lib/nylas/model/transferable.rb +1 -0
- data/lib/nylas/native_authentication.rb +1 -0
- data/lib/nylas/new_message.rb +2 -1
- data/lib/nylas/physical_address.rb +1 -0
- data/lib/nylas/raw_message.rb +1 -0
- data/lib/nylas/registry.rb +1 -0
- data/lib/nylas/thread.rb +1 -1
- data/lib/nylas/time_slot.rb +14 -0
- data/lib/nylas/types.rb +2 -0
- data/lib/nylas/version.rb +1 -1
- metadata +32 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dd52077bca505902f8fe016a103318a1c426f74f01235a36c27a2463478f101
|
4
|
+
data.tar.gz: 91f2addf66e656561881e721402955080f6e040536c3168737f7b62a4b74a9dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed82717d82cdc4b5fed03a09e7ee1553ba16071e4603b8cedce2518871fc44e2b34c8bd0ce5d9e077bb492a1d216de577264da104014c75e9964b44f7a238e52
|
7
|
+
data.tar.gz: be58aff204cad1ce196f8fbeb766708d407d135a8247c484292a5a16fd821119727d21ded457b2b80650b58fc9c70d2a07c38dfc4beea94dc143454bc9377136
|
data/lib/nylas.rb
CHANGED
@@ -3,6 +3,21 @@
|
|
3
3
|
require "json"
|
4
4
|
require "rest-client"
|
5
5
|
|
6
|
+
# BUGFIX
|
7
|
+
# See https://github.com/sparklemotion/http-cookie/issues/27
|
8
|
+
# and https://github.com/sparklemotion/http-cookie/issues/6
|
9
|
+
#
|
10
|
+
# CookieJar uses unsafe class caching for dynamically loading cookie jars
|
11
|
+
# If 2 rest-client instances are instantiated at the same time, (in threads)
|
12
|
+
# non-deterministic behaviour can occur whereby the Hash cookie jar isn't
|
13
|
+
# properly loaded and cached.
|
14
|
+
# Forcing an instantiation of the jar onload will force the CookieJar to load
|
15
|
+
# before the system has a chance to spawn any threads.
|
16
|
+
# Note this should technically be fixed in rest-client itself however that
|
17
|
+
# library appears to be stagnant so we're forced to fix it here
|
18
|
+
# This object should get GC'd as it's not referenced by anything
|
19
|
+
HTTP::CookieJar.new
|
20
|
+
|
6
21
|
require "ostruct"
|
7
22
|
require "forwardable"
|
8
23
|
|
@@ -36,10 +51,13 @@ require_relative "nylas/timespan"
|
|
36
51
|
require_relative "nylas/web_page"
|
37
52
|
require_relative "nylas/nylas_date"
|
38
53
|
require_relative "nylas/when"
|
54
|
+
require_relative "nylas/free_busy"
|
55
|
+
require_relative "nylas/time_slot"
|
39
56
|
|
40
57
|
# Custom collection types
|
41
58
|
require_relative "nylas/search_collection"
|
42
59
|
require_relative "nylas/deltas_collection"
|
60
|
+
require_relative "nylas/free_busy_collection"
|
43
61
|
|
44
62
|
# Models supported by the API
|
45
63
|
require_relative "nylas/account"
|
@@ -89,4 +107,5 @@ module Nylas
|
|
89
107
|
Types.registry[:nylas_date] = NylasDateType.new
|
90
108
|
Types.registry[:contact_group] = Types::ModelType.new(model: ContactGroup)
|
91
109
|
Types.registry[:when] = Types::ModelType.new(model: When)
|
110
|
+
Types.registry[:time_slot] = Types::ModelType.new(model: TimeSlot)
|
92
111
|
end
|
data/lib/nylas/account.rb
CHANGED
data/lib/nylas/api.rb
CHANGED
@@ -4,6 +4,7 @@ module Nylas
|
|
4
4
|
# Methods to retrieve data from the Nylas API as Ruby objects
|
5
5
|
class API
|
6
6
|
attr_accessor :client
|
7
|
+
|
7
8
|
extend Forwardable
|
8
9
|
def_delegators :client, :execute, :get, :post, :put, :delete, :app_id
|
9
10
|
|
@@ -149,6 +150,15 @@ module Nylas
|
|
149
150
|
@webhooks ||= Collection.new(model: Webhook, api: as(client.app_secret))
|
150
151
|
end
|
151
152
|
|
153
|
+
def free_busy(emails:, start_time:, end_time:)
|
154
|
+
FreeBusyCollection.new(
|
155
|
+
api: self,
|
156
|
+
emails: emails,
|
157
|
+
start_time: start_time.to_i,
|
158
|
+
end_time: end_time.to_i
|
159
|
+
)
|
160
|
+
end
|
161
|
+
|
152
162
|
private
|
153
163
|
|
154
164
|
def prevent_calling_if_missing_access_token(method_name)
|
data/lib/nylas/collection.rb
CHANGED
@@ -4,6 +4,7 @@ module Nylas
|
|
4
4
|
# An enumerable for working with index and search endpoints
|
5
5
|
class Collection
|
6
6
|
attr_accessor :model, :api, :constraints
|
7
|
+
|
7
8
|
extend Forwardable
|
8
9
|
def_delegators :each, :map, :select, :reject, :to_a, :take
|
9
10
|
def_delegators :to_a, :first, :last, :[]
|
@@ -20,7 +21,7 @@ module Nylas
|
|
20
21
|
end
|
21
22
|
|
22
23
|
def create(**attributes)
|
23
|
-
instance = model.new(attributes.merge(api: api))
|
24
|
+
instance = model.new(**attributes.merge(api: api))
|
24
25
|
instance.save
|
25
26
|
instance
|
26
27
|
end
|
@@ -68,7 +69,7 @@ module Nylas
|
|
68
69
|
return enum_for(:each) unless block_given?
|
69
70
|
|
70
71
|
execute.each do |result|
|
71
|
-
yield(model.new(result.merge(api: api)))
|
72
|
+
yield(model.new(**result.merge(api: api)))
|
72
73
|
end
|
73
74
|
end
|
74
75
|
|
@@ -118,7 +119,7 @@ module Nylas
|
|
118
119
|
end
|
119
120
|
|
120
121
|
def find_raw(id)
|
121
|
-
api.execute(to_be_executed.merge(path: "#{resources_path}/#{id}")).to_s
|
122
|
+
api.execute(**to_be_executed.merge(path: "#{resources_path}/#{id}")).to_s
|
122
123
|
end
|
123
124
|
|
124
125
|
def resources_path
|
@@ -126,9 +127,13 @@ module Nylas
|
|
126
127
|
end
|
127
128
|
|
128
129
|
def find_model(id)
|
129
|
-
|
130
|
-
|
131
|
-
|
130
|
+
response = api.execute(
|
131
|
+
**to_be_executed.merge(
|
132
|
+
path: "#{resources_path}/#{id}",
|
133
|
+
query: {}
|
134
|
+
)
|
135
|
+
)
|
136
|
+
model.from_hash(response, api: api)
|
132
137
|
end
|
133
138
|
|
134
139
|
# @return [Hash] Specification for request to be passed to {API#execute}
|
@@ -140,7 +145,7 @@ module Nylas
|
|
140
145
|
# Retrieves the data from the API for the particular constraints
|
141
146
|
# @return [Hash,Array]
|
142
147
|
def execute
|
143
|
-
api.execute(to_be_executed)
|
148
|
+
api.execute(**to_be_executed)
|
144
149
|
end
|
145
150
|
end
|
146
151
|
end
|
data/lib/nylas/constraints.rb
CHANGED
@@ -4,6 +4,7 @@ module Nylas
|
|
4
4
|
# The constraints a particular GET request will include in their query params
|
5
5
|
class Constraints
|
6
6
|
attr_accessor :where, :limit, :offset, :view, :per_page, :accept
|
7
|
+
|
7
8
|
def initialize(where: {}, limit: nil, offset: 0, view: nil, per_page: 100, accept: "application/json")
|
8
9
|
self.where = where
|
9
10
|
self.limit = limit
|
@@ -4,6 +4,7 @@ module Nylas
|
|
4
4
|
# Special collection for delta objects
|
5
5
|
class DeltasCollection < Collection
|
6
6
|
attr_accessor :deltas
|
7
|
+
|
7
8
|
extend Forwardable
|
8
9
|
def_delegators :execute, :cursor_start, :cursor_end,
|
9
10
|
:count, :each, :to_h, :to_a, :empty?
|
@@ -33,7 +34,7 @@ module Nylas
|
|
33
34
|
# Retrieves the data from the API for the particular constraints
|
34
35
|
# @return [Detlas]
|
35
36
|
def execute
|
36
|
-
self.deltas ||= Deltas.new(api.execute(to_be_executed))
|
37
|
+
self.deltas ||= Deltas.new(**api.execute(**to_be_executed))
|
37
38
|
end
|
38
39
|
end
|
39
40
|
end
|
data/lib/nylas/draft.rb
CHANGED
@@ -33,9 +33,13 @@ module Nylas
|
|
33
33
|
attribute :folder, :folder
|
34
34
|
has_n_of_attribute :labels, :label
|
35
35
|
|
36
|
+
attribute :tracking, :message_tracking
|
37
|
+
|
36
38
|
transfer :api, to: %i[events files folder labels]
|
37
39
|
|
38
40
|
def send!
|
41
|
+
return execute(method: :post, path: "/send", payload: to_json) if tracking
|
42
|
+
|
39
43
|
save
|
40
44
|
execute(method: :post, path: "/send", payload: JSON.dump(draft_id: id, version: version))
|
41
45
|
end
|
data/lib/nylas/errors.rb
CHANGED
@@ -14,6 +14,8 @@ module Nylas
|
|
14
14
|
class ModelNotUpdatableError < ModelActionError; end
|
15
15
|
class ModelNotDestroyableError < ModelActionError; end
|
16
16
|
|
17
|
+
class JsonParseError < Error; end
|
18
|
+
|
17
19
|
# Raised when attempting to set a field that is not on a model with mass assignment
|
18
20
|
class ModelMissingFieldError < ModelActionError
|
19
21
|
def initialize(field, model)
|
@@ -48,6 +50,10 @@ module Nylas
|
|
48
50
|
ResourceNotFound = Class.new(APIError)
|
49
51
|
MethodNotAllowed = Class.new(APIError)
|
50
52
|
InvalidRequest = Class.new(APIError)
|
53
|
+
UnauthorizedRequest = Class.new(APIError)
|
54
|
+
ResourceRemoved = Class.new(APIError)
|
55
|
+
TeapotError = Class.new(APIError)
|
56
|
+
RequestTimedOut = Class.new(APIError)
|
51
57
|
MessageRejected = Class.new(APIError)
|
52
58
|
SendingQuotaExceeded = Class.new(APIError)
|
53
59
|
ServiceUnavailable = Class.new(APIError)
|
data/lib/nylas/event.rb
CHANGED
@@ -29,6 +29,8 @@ module Nylas
|
|
29
29
|
attribute :when, :when
|
30
30
|
attribute :original_start_time, :unix_timestamp
|
31
31
|
|
32
|
+
attr_accessor :notify_participants
|
33
|
+
|
32
34
|
def busy?
|
33
35
|
busy
|
34
36
|
end
|
@@ -42,5 +44,17 @@ module Nylas
|
|
42
44
|
event_id: id, account_id: account_id)
|
43
45
|
rsvp.save
|
44
46
|
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def query_params
|
51
|
+
if notify_participants.nil?
|
52
|
+
{}
|
53
|
+
else
|
54
|
+
{
|
55
|
+
notify_participants: notify_participants
|
56
|
+
}
|
57
|
+
end
|
58
|
+
end
|
45
59
|
end
|
46
60
|
end
|
data/lib/nylas/file.rb
CHANGED
@@ -18,8 +18,10 @@ module Nylas
|
|
18
18
|
attribute :content_type, :string
|
19
19
|
attribute :filename, :string
|
20
20
|
attribute :size, :integer
|
21
|
+
attribute :content_disposition, :string
|
21
22
|
|
22
23
|
attr_accessor :file
|
24
|
+
|
23
25
|
# Downloads and caches a local copy of the file.
|
24
26
|
# @return [Tempfile] - Local copy of the file
|
25
27
|
def download
|
@@ -56,7 +58,9 @@ module Nylas
|
|
56
58
|
def retrieve_file
|
57
59
|
response = api.get(path: "#{resource_path}/download")
|
58
60
|
filename = response.headers.fetch(:content_disposition, "").gsub("attachment; filename=", "")
|
59
|
-
|
61
|
+
# The returned filename can be longer than 256 chars which isn't supported by rb_sysopen.
|
62
|
+
# 128 chars here is more than enough given that TempFile ensure the filename will be unique.
|
63
|
+
temp_file = Tempfile.new(filename[0..127], encoding: "ascii-8bit")
|
60
64
|
temp_file.write(response.body)
|
61
65
|
temp_file.seek(0)
|
62
66
|
temp_file
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Nylas
|
4
|
+
# Query free/busy information for a calendar during a certain time period
|
5
|
+
# @see https://docs.nylas.com/reference#calendars-free-busy
|
6
|
+
class FreeBusy
|
7
|
+
include Model::Attributable
|
8
|
+
|
9
|
+
attribute :email, :string
|
10
|
+
attribute :object, :string
|
11
|
+
has_n_of_attribute :time_slots, :time_slot
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Nylas
|
4
|
+
# Helper to get and build `FreeBusy` objects
|
5
|
+
class FreeBusyCollection
|
6
|
+
extend Forwardable
|
7
|
+
def_delegators :each, :map, :select, :reject, :to_a, :take
|
8
|
+
def_delegators :to_a, :first, :last, :[]
|
9
|
+
|
10
|
+
def initialize(emails:, start_time:, end_time:, api:)
|
11
|
+
@api = api
|
12
|
+
@emails = emails
|
13
|
+
@start_time = start_time
|
14
|
+
@end_time = end_time
|
15
|
+
end
|
16
|
+
|
17
|
+
def each
|
18
|
+
return enum_for(:each) unless block_given?
|
19
|
+
|
20
|
+
execute.each do |result|
|
21
|
+
yield(FreeBusy.new(**result))
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
attr_reader :api, :emails, :start_time, :end_time
|
28
|
+
|
29
|
+
PATH = "/calendars/free-busy"
|
30
|
+
private_constant :PATH
|
31
|
+
|
32
|
+
def execute
|
33
|
+
api.execute(
|
34
|
+
method: :post,
|
35
|
+
path: PATH,
|
36
|
+
payload: payload
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
def payload
|
41
|
+
JSON.dump(
|
42
|
+
emails: emails,
|
43
|
+
start_time: start_time,
|
44
|
+
end_time: end_time
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/nylas/http_client.rb
CHANGED
@@ -1,20 +1,26 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Nylas
|
4
|
+
require "yajl"
|
5
|
+
|
4
6
|
# Plain HTTP client that can be used to interact with the Nylas API sans any type casting.
|
5
7
|
class HttpClient # rubocop:disable Metrics/ClassLength
|
6
8
|
HTTP_CODE_TO_EXCEPTIONS = {
|
7
9
|
400 => InvalidRequest,
|
10
|
+
401 => UnauthorizedRequest,
|
8
11
|
402 => MessageRejected,
|
9
12
|
403 => AccessDenied,
|
10
13
|
404 => ResourceNotFound,
|
11
14
|
405 => MethodNotAllowed,
|
15
|
+
410 => ResourceRemoved,
|
16
|
+
418 => TeapotError,
|
12
17
|
422 => MailProviderError,
|
13
18
|
429 => SendingQuotaExceeded,
|
14
19
|
500 => InternalError,
|
15
20
|
501 => EndpointNotYetImplemented,
|
16
21
|
502 => BadGateway,
|
17
|
-
503 => ServiceUnavailable
|
22
|
+
503 => ServiceUnavailable,
|
23
|
+
504 => RequestTimedOut
|
18
24
|
}.freeze
|
19
25
|
|
20
26
|
ENDPOINT_TIMEOUTS = {
|
@@ -80,7 +86,14 @@ module Nylas
|
|
80
86
|
timeout: timeout
|
81
87
|
)
|
82
88
|
rest_client_execute(**request) do |response, _request, result|
|
83
|
-
|
89
|
+
content_type = nil
|
90
|
+
|
91
|
+
if response.headers && response.headers[:content_type]
|
92
|
+
content_type = response.headers[:content_type].downcase
|
93
|
+
end
|
94
|
+
|
95
|
+
response = parse_response(response) if content_type == "application/json"
|
96
|
+
|
84
97
|
handle_failed_response(result: result, response: response)
|
85
98
|
response
|
86
99
|
end
|
@@ -130,9 +143,12 @@ module Nylas
|
|
130
143
|
end
|
131
144
|
|
132
145
|
def parse_response(response)
|
133
|
-
response.is_a?(Enumerable)
|
134
|
-
|
135
|
-
response
|
146
|
+
return response if response.is_a?(Enumerable)
|
147
|
+
|
148
|
+
json = StringIO.new(response)
|
149
|
+
Yajl::Parser.new(symbolize_names: true).parse(json)
|
150
|
+
rescue Yajl::ParseError
|
151
|
+
raise Nylas::JsonParseError
|
136
152
|
end
|
137
153
|
inform_on :parse_response, level: :debug, also_log: { result: true }
|
138
154
|
|
data/lib/nylas/logging.rb
CHANGED
@@ -1,12 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# We are explicitely choosing to allow clients to use or not use informed at their discretion
|
4
|
-
# rubocop:disable Lint/HandleExceptions
|
5
3
|
begin
|
6
4
|
require "informed"
|
7
5
|
rescue LoadError
|
8
6
|
end
|
9
|
-
# rubocop:enable Lint/HandleExceptions
|
10
7
|
|
11
8
|
module Nylas
|
12
9
|
# Exposes a shared logger for debugging purposes
|
data/lib/nylas/message.rb
CHANGED
@@ -56,7 +56,7 @@ module Nylas
|
|
56
56
|
allowed_attributes: UPDATABLE_ATTRIBUTES
|
57
57
|
).check
|
58
58
|
|
59
|
-
super(payload)
|
59
|
+
super(**payload)
|
60
60
|
end
|
61
61
|
|
62
62
|
def update_folder(folder_id)
|
@@ -66,8 +66,26 @@ module Nylas
|
|
66
66
|
def expanded
|
67
67
|
return self unless headers.nil?
|
68
68
|
|
69
|
-
assign(api.execute(method: :get, path: resource_path, query: { view: "expanded" }))
|
69
|
+
assign(**api.execute(method: :get, path: resource_path, query: { view: "expanded" }))
|
70
70
|
self
|
71
71
|
end
|
72
|
+
|
73
|
+
def save_call
|
74
|
+
handle_folder
|
75
|
+
|
76
|
+
execute(
|
77
|
+
method: :put,
|
78
|
+
payload: attributes.serialize(keys: allowed_keys_for_save),
|
79
|
+
path: resource_path
|
80
|
+
)
|
81
|
+
end
|
82
|
+
|
83
|
+
def handle_folder
|
84
|
+
return if folder.nil?
|
85
|
+
|
86
|
+
self.folder_id = folder.id if folder_id.nil? && !self.to_h.dig(:folder, :id).nil?
|
87
|
+
|
88
|
+
self.folder = nil
|
89
|
+
end
|
72
90
|
end
|
73
91
|
end
|
data/lib/nylas/model.rb
CHANGED
@@ -39,28 +39,38 @@ module Nylas
|
|
39
39
|
!id.nil?
|
40
40
|
end
|
41
41
|
|
42
|
-
def execute(method:, payload: nil, path:)
|
43
|
-
api.execute(method: method, payload: payload, path: path)
|
42
|
+
def execute(method:, payload: nil, path:, query: {})
|
43
|
+
api.execute(method: method, payload: payload, path: path, query: query)
|
44
44
|
end
|
45
45
|
|
46
46
|
def create
|
47
47
|
raise ModelNotCreatableError, self unless creatable?
|
48
48
|
|
49
|
-
execute(
|
49
|
+
execute(
|
50
|
+
method: :post,
|
51
|
+
payload: attributes.serialize,
|
52
|
+
path: resources_path,
|
53
|
+
query: query_params
|
54
|
+
)
|
50
55
|
end
|
51
56
|
|
52
57
|
def update(**data)
|
53
58
|
raise ModelNotUpdatableError, model_class unless updatable?
|
54
59
|
|
55
60
|
attributes.merge(**data)
|
56
|
-
execute(
|
61
|
+
execute(
|
62
|
+
method: :put,
|
63
|
+
payload: attributes.serialize(keys: data.keys),
|
64
|
+
path: resource_path,
|
65
|
+
query: query_params
|
66
|
+
)
|
57
67
|
true
|
58
68
|
rescue Registry::MissingKeyError => e
|
59
69
|
raise ModelMissingFieldError.new(e.key, self)
|
60
70
|
end
|
61
71
|
|
62
72
|
def reload
|
63
|
-
assign(execute(method: :get, path: resource_path))
|
73
|
+
assign(**execute(method: :get, path: resource_path))
|
64
74
|
true
|
65
75
|
end
|
66
76
|
|
@@ -75,7 +85,7 @@ module Nylas
|
|
75
85
|
def destroy
|
76
86
|
raise ModelNotDestroyableError, self unless destroyable?
|
77
87
|
|
78
|
-
execute(method: :delete, path: resource_path)
|
88
|
+
execute(method: :delete, path: resource_path, query: query_params)
|
79
89
|
end
|
80
90
|
|
81
91
|
# @return [String] JSON String of the model.
|
@@ -99,6 +109,10 @@ module Nylas
|
|
99
109
|
)
|
100
110
|
end
|
101
111
|
|
112
|
+
def query_params
|
113
|
+
{}
|
114
|
+
end
|
115
|
+
|
102
116
|
# Allows you to narrow in exactly what kind of model you're working with
|
103
117
|
module ClassMethods
|
104
118
|
attr_accessor :raw_mime_type, :creatable, :showable, :filterable, :searchable, :listable, :updatable,
|
data/lib/nylas/new_message.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Nylas
|
4
|
-
# Data structure for
|
4
|
+
# Data structure for sending a message via the Nylas API
|
5
5
|
class NewMessage
|
6
6
|
include Model
|
7
7
|
self.creatable = false
|
@@ -15,6 +15,7 @@ module Nylas
|
|
15
15
|
has_n_of_attribute :from, :email_address
|
16
16
|
has_n_of_attribute :cc, :email_address
|
17
17
|
has_n_of_attribute :bcc, :email_address
|
18
|
+
has_n_of_attribute :reply_to, :email_address
|
18
19
|
|
19
20
|
attribute :subject, :string
|
20
21
|
attribute :body, :string
|
data/lib/nylas/raw_message.rb
CHANGED
@@ -4,6 +4,7 @@ module Nylas
|
|
4
4
|
# Allows sending of email with nylas from an rfc822 compatible string
|
5
5
|
class RawMessage
|
6
6
|
attr_accessor :api, :mime_compatible_string
|
7
|
+
|
7
8
|
def initialize(mime_compatible_string, api:)
|
8
9
|
self.api = api
|
9
10
|
self.mime_compatible_string = mime_compatible_string
|
data/lib/nylas/registry.rb
CHANGED
data/lib/nylas/thread.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Nylas
|
4
|
+
# Query free/busy information for a calendar during a certain time period
|
5
|
+
# @see https://docs.nylas.com/reference#calendars-free-busy
|
6
|
+
class TimeSlot
|
7
|
+
include Model::Attributable
|
8
|
+
|
9
|
+
attribute :object, :string
|
10
|
+
attribute :status, :string
|
11
|
+
attribute :start_time, :unix_timestamp
|
12
|
+
attribute :end_time, :unix_timestamp
|
13
|
+
end
|
14
|
+
end
|
data/lib/nylas/types.rb
CHANGED
@@ -24,6 +24,7 @@ module Nylas
|
|
24
24
|
# {Model} or Model-like thing.
|
25
25
|
class ModelType
|
26
26
|
attr_accessor :model
|
27
|
+
|
27
28
|
def initialize(model:)
|
28
29
|
self.model = model
|
29
30
|
end
|
@@ -87,6 +88,7 @@ module Nylas
|
|
87
88
|
|
88
89
|
def serialize(object)
|
89
90
|
return nil if object.nil?
|
91
|
+
|
90
92
|
object.to_i
|
91
93
|
end
|
92
94
|
end
|
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: 4.6.
|
4
|
+
version: 4.6.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nylas, Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.3.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: jeweler
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '2.1'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '2.1'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: yard
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -240,7 +226,7 @@ dependencies:
|
|
240
226
|
requirements:
|
241
227
|
- - ">="
|
242
228
|
- !ruby/object:Gem::Version
|
243
|
-
version: '
|
229
|
+
version: '2.0'
|
244
230
|
- - "<"
|
245
231
|
- !ruby/object:Gem::Version
|
246
232
|
version: '3.0'
|
@@ -250,10 +236,30 @@ dependencies:
|
|
250
236
|
requirements:
|
251
237
|
- - ">="
|
252
238
|
- !ruby/object:Gem::Version
|
253
|
-
version: '
|
239
|
+
version: '2.0'
|
254
240
|
- - "<"
|
255
241
|
- !ruby/object:Gem::Version
|
256
242
|
version: '3.0'
|
243
|
+
- !ruby/object:Gem::Dependency
|
244
|
+
name: yajl-ruby
|
245
|
+
requirement: !ruby/object:Gem::Requirement
|
246
|
+
requirements:
|
247
|
+
- - "~>"
|
248
|
+
- !ruby/object:Gem::Version
|
249
|
+
version: '1.2'
|
250
|
+
- - ">="
|
251
|
+
- !ruby/object:Gem::Version
|
252
|
+
version: 1.2.1
|
253
|
+
type: :runtime
|
254
|
+
prerelease: false
|
255
|
+
version_requirements: !ruby/object:Gem::Requirement
|
256
|
+
requirements:
|
257
|
+
- - "~>"
|
258
|
+
- !ruby/object:Gem::Version
|
259
|
+
version: '1.2'
|
260
|
+
- - ">="
|
261
|
+
- !ruby/object:Gem::Version
|
262
|
+
version: 1.2.1
|
257
263
|
description: Gem for interacting with the Nylas API.
|
258
264
|
email: support@nylas.com
|
259
265
|
executables: []
|
@@ -280,6 +286,8 @@ files:
|
|
280
286
|
- lib/nylas/file.rb
|
281
287
|
- lib/nylas/filter_attributes.rb
|
282
288
|
- lib/nylas/folder.rb
|
289
|
+
- lib/nylas/free_busy.rb
|
290
|
+
- lib/nylas/free_busy_collection.rb
|
283
291
|
- lib/nylas/http_client.rb
|
284
292
|
- lib/nylas/im_address.rb
|
285
293
|
- lib/nylas/label.rb
|
@@ -305,13 +313,14 @@ files:
|
|
305
313
|
- lib/nylas/rsvp.rb
|
306
314
|
- lib/nylas/search_collection.rb
|
307
315
|
- lib/nylas/thread.rb
|
316
|
+
- lib/nylas/time_slot.rb
|
308
317
|
- lib/nylas/timespan.rb
|
309
318
|
- lib/nylas/types.rb
|
310
319
|
- lib/nylas/version.rb
|
311
320
|
- lib/nylas/web_page.rb
|
312
321
|
- lib/nylas/webhook.rb
|
313
322
|
- lib/nylas/when.rb
|
314
|
-
homepage:
|
323
|
+
homepage:
|
315
324
|
licenses:
|
316
325
|
- MIT
|
317
326
|
metadata:
|
@@ -321,7 +330,7 @@ metadata:
|
|
321
330
|
homepage_uri: https://www.nylas.com
|
322
331
|
source_code_uri: https://github.com/nylas/nylas-ruby
|
323
332
|
wiki_uri: https://github.com/nylas/nylas-ruby/wiki
|
324
|
-
post_install_message:
|
333
|
+
post_install_message:
|
325
334
|
rdoc_options: []
|
326
335
|
require_paths:
|
327
336
|
- lib
|
@@ -336,8 +345,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
336
345
|
- !ruby/object:Gem::Version
|
337
346
|
version: '0'
|
338
347
|
requirements: []
|
339
|
-
rubygems_version: 3.
|
340
|
-
signing_key:
|
348
|
+
rubygems_version: 3.1.2
|
349
|
+
signing_key:
|
341
350
|
specification_version: 4
|
342
351
|
summary: Gem for interacting with the Nylas API
|
343
352
|
test_files: []
|