nylas 4.6.5 → 4.6.6
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/account.rb +1 -0
- data/lib/nylas/api.rb +1 -0
- data/lib/nylas/collection.rb +1 -0
- data/lib/nylas/constraints.rb +1 -0
- data/lib/nylas/deltas_collection.rb +1 -0
- data/lib/nylas/event.rb +14 -0
- data/lib/nylas/file.rb +1 -0
- data/lib/nylas/logging.rb +0 -3
- data/lib/nylas/model.rb +19 -5
- 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/raw_message.rb +1 -0
- data/lib/nylas/registry.rb +1 -0
- data/lib/nylas/types.rb +2 -0
- data/lib/nylas/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baebc1d39fd0bc001c952f302dd417ac00399e139f90b6954080479c659d45ca
|
4
|
+
data.tar.gz: 554cf1807cb4432d1e7b75722c7da6846db751369085583adc08e09b0e1eaa9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e388d554f86e260cba3950dcd2e4ec559009af1e285c0cbc90c9b8111bed522016292dbf6e907b2a0da89dfedf98bd99d7bc67bab552c3368681b4c0224dc76
|
7
|
+
data.tar.gz: 947425b241a41b35904eba088d71c2ad6bbb2e0221eb36ba01ff215274e42e852db66c587e047076ab3a81e06d86fac0a98e327b799881097ba7a502ea9b939c
|
data/lib/nylas/account.rb
CHANGED
data/lib/nylas/api.rb
CHANGED
data/lib/nylas/collection.rb
CHANGED
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
|
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
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/model.rb
CHANGED
@@ -39,21 +39,31 @@ 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)
|
@@ -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/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/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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nylas, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|