nylas 5.12.0 → 5.12.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/calendar.rb +8 -2
- data/lib/nylas/collection.rb +17 -3
- data/lib/nylas/component.rb +6 -2
- data/lib/nylas/deltas.rb +1 -1
- data/lib/nylas/draft.rb +7 -1
- data/lib/nylas/event.rb +8 -2
- data/lib/nylas/file.rb +7 -1
- data/lib/nylas/folder.rb +2 -0
- data/lib/nylas/job_status.rb +1 -1
- data/lib/nylas/label.rb +2 -0
- data/lib/nylas/message.rb +7 -1
- data/lib/nylas/model.rb +21 -13
- data/lib/nylas/neural_categorizer.rb +1 -1
- data/lib/nylas/neural_clean_conversation.rb +1 -1
- data/lib/nylas/neural_ocr.rb +1 -1
- data/lib/nylas/neural_sentiment_analysis.rb +1 -1
- data/lib/nylas/room_resource.rb +1 -1
- data/lib/nylas/rsvp.rb +1 -1
- data/lib/nylas/scheduler.rb +6 -2
- data/lib/nylas/thread.rb +6 -1
- data/lib/nylas/version.rb +1 -1
- data/lib/nylas/webhook.rb +5 -2
- 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: c1e352b09e650aa0cbc5dff7363b8a0997aab35c94e73a5f4a77b5503de70448
|
4
|
+
data.tar.gz: a7830ea4cc6a9028669ca6c0e502cba4f2dfc70402a2c00f85cd1f6d315d0594
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aeed921859461105491d8394f845b79d6419ecc10a17ae0989f2239382cce8e4ad1fb3936bd7a4cebd730e40bac60b28dafe8e145e63a10d424a9e9b46915f0
|
7
|
+
data.tar.gz: 47fdeaa77f5e1037934fc421b7b869edc031f956aad054d2888d29aee0a75ecb537c063e4c89e3c30e4f14f2be2da0860b5ec546e39034590f137773b73ef3cc
|
data/lib/nylas/calendar.rb
CHANGED
@@ -6,8 +6,14 @@ module Nylas
|
|
6
6
|
class Calendar
|
7
7
|
include Model
|
8
8
|
self.resources_path = "/calendars"
|
9
|
-
|
10
|
-
|
9
|
+
self.creatable = true
|
10
|
+
self.listable = true
|
11
|
+
self.showable = true
|
12
|
+
self.filterable = true
|
13
|
+
self.updatable = true
|
14
|
+
self.destroyable = true
|
15
|
+
self.id_listable = true
|
16
|
+
self.countable = true
|
11
17
|
|
12
18
|
attribute :id, :string
|
13
19
|
attribute :account_id, :string
|
data/lib/nylas/collection.rb
CHANGED
@@ -17,7 +17,7 @@ module Nylas
|
|
17
17
|
|
18
18
|
# Instantiates a new model
|
19
19
|
def new(**attributes)
|
20
|
-
model.new(attributes.merge(api: api))
|
20
|
+
model.new(**attributes.merge(api: api))
|
21
21
|
end
|
22
22
|
|
23
23
|
def create(**attributes)
|
@@ -51,7 +51,14 @@ module Nylas
|
|
51
51
|
|
52
52
|
# @return [Integer]
|
53
53
|
def count
|
54
|
-
self.class.new(model: model, api: api, constraints: constraints
|
54
|
+
collection = self.class.new(model: model, api: api, constraints: constraints)
|
55
|
+
|
56
|
+
if model.countable
|
57
|
+
collection.constraints = collection.constraints.merge(view: "count")
|
58
|
+
collection.execute[:count]
|
59
|
+
else
|
60
|
+
collection.find_each.map.count
|
61
|
+
end
|
55
62
|
end
|
56
63
|
|
57
64
|
# @return [Collection<Model>]
|
@@ -61,7 +68,14 @@ module Nylas
|
|
61
68
|
|
62
69
|
# @return [Array<String>]
|
63
70
|
def ids
|
64
|
-
self.class.new(model: model, api: api, constraints: constraints
|
71
|
+
collection = self.class.new(model: model, api: api, constraints: constraints)
|
72
|
+
|
73
|
+
if model.id_listable
|
74
|
+
collection.constraints = collection.constraints.merge(view: "ids")
|
75
|
+
collection.execute
|
76
|
+
else
|
77
|
+
collection.find_each.map(&:id)
|
78
|
+
end
|
65
79
|
end
|
66
80
|
|
67
81
|
# Iterates over a single page of results based upon current pagination settings
|
data/lib/nylas/component.rb
CHANGED
@@ -4,8 +4,12 @@ module Nylas
|
|
4
4
|
# Structure to represent a the Component Schema.
|
5
5
|
class Component
|
6
6
|
include Model
|
7
|
-
|
8
|
-
|
7
|
+
self.creatable = true
|
8
|
+
self.listable = true
|
9
|
+
self.showable = true
|
10
|
+
self.filterable = true
|
11
|
+
self.updatable = true
|
12
|
+
self.destroyable = true
|
9
13
|
self.auth_method = HttpClient::AuthMethod::BASIC
|
10
14
|
|
11
15
|
attribute :id, :string, read_only: true
|
data/lib/nylas/deltas.rb
CHANGED
data/lib/nylas/draft.rb
CHANGED
@@ -6,7 +6,13 @@ module Nylas
|
|
6
6
|
class Draft
|
7
7
|
include Model
|
8
8
|
self.resources_path = "/drafts"
|
9
|
-
|
9
|
+
self.creatable = true
|
10
|
+
self.listable = true
|
11
|
+
self.showable = true
|
12
|
+
self.updatable = true
|
13
|
+
self.destroyable = true
|
14
|
+
self.id_listable = true
|
15
|
+
self.countable = true
|
10
16
|
|
11
17
|
attribute :id, :string
|
12
18
|
attribute :object, :string
|
data/lib/nylas/event.rb
CHANGED
@@ -6,8 +6,14 @@ module Nylas
|
|
6
6
|
class Event
|
7
7
|
include Model
|
8
8
|
self.resources_path = "/events"
|
9
|
-
|
10
|
-
|
9
|
+
self.creatable = true
|
10
|
+
self.listable = true
|
11
|
+
self.showable = true
|
12
|
+
self.filterable = true
|
13
|
+
self.updatable = true
|
14
|
+
self.destroyable = true
|
15
|
+
self.id_listable = true
|
16
|
+
self.countable = true
|
11
17
|
|
12
18
|
attribute :id, :string, read_only: true
|
13
19
|
attribute :object, :string, read_only: true
|
data/lib/nylas/file.rb
CHANGED
@@ -6,7 +6,13 @@ module Nylas
|
|
6
6
|
class File
|
7
7
|
include Model
|
8
8
|
self.resources_path = "/files"
|
9
|
-
|
9
|
+
self.creatable = true
|
10
|
+
self.listable = true
|
11
|
+
self.showable = true
|
12
|
+
self.filterable = true
|
13
|
+
self.destroyable = true
|
14
|
+
self.id_listable = true
|
15
|
+
self.countable = true
|
10
16
|
|
11
17
|
attribute :id, :string
|
12
18
|
attribute :account_id, :string
|
data/lib/nylas/folder.rb
CHANGED
data/lib/nylas/job_status.rb
CHANGED
data/lib/nylas/label.rb
CHANGED
data/lib/nylas/message.rb
CHANGED
@@ -7,7 +7,13 @@ module Nylas
|
|
7
7
|
include Model
|
8
8
|
self.raw_mime_type = "message/rfc822"
|
9
9
|
self.resources_path = "/messages"
|
10
|
-
|
10
|
+
self.listable = true
|
11
|
+
self.showable = true
|
12
|
+
self.filterable = true
|
13
|
+
self.updatable = true
|
14
|
+
self.searchable = true
|
15
|
+
self.id_listable = true
|
16
|
+
self.countable = true
|
11
17
|
UPDATABLE_ATTRIBUTES = %i[label_ids folder_id starred unread metadata].freeze
|
12
18
|
|
13
19
|
attribute :id, :string
|
data/lib/nylas/model.rb
CHANGED
@@ -20,8 +20,8 @@ module Nylas
|
|
20
20
|
model.extend(ClassMethods)
|
21
21
|
model.extend(Forwardable)
|
22
22
|
model.def_delegators :model_class, :creatable?, :filterable?, :listable?, :searchable?, :showable?,
|
23
|
-
:updatable?, :destroyable?
|
24
|
-
model.
|
23
|
+
:updatable?, :destroyable?, :id_listable?, :countable?
|
24
|
+
model.init_operations
|
25
25
|
end
|
26
26
|
|
27
27
|
def save
|
@@ -141,19 +141,19 @@ module Nylas
|
|
141
141
|
# Allows you to narrow in exactly what kind of model you're working with
|
142
142
|
module ClassMethods
|
143
143
|
attr_accessor :raw_mime_type, :creatable, :showable, :filterable, :searchable, :listable, :updatable,
|
144
|
-
:destroyable
|
144
|
+
:destroyable, :id_listable, :countable
|
145
145
|
attr_writer :resources_path, :auth_method
|
146
146
|
|
147
|
-
def
|
148
|
-
|
149
|
-
|
150
|
-
self.
|
151
|
-
self.
|
152
|
-
self.
|
153
|
-
self.
|
154
|
-
self.
|
155
|
-
self.
|
156
|
-
self.
|
147
|
+
def init_operations
|
148
|
+
self.creatable = false
|
149
|
+
self.showable = false
|
150
|
+
self.listable = false
|
151
|
+
self.filterable = false
|
152
|
+
self.searchable = false
|
153
|
+
self.updatable = false
|
154
|
+
self.destroyable = false
|
155
|
+
self.id_listable = false
|
156
|
+
self.countable = false
|
157
157
|
end
|
158
158
|
|
159
159
|
def creatable?
|
@@ -184,6 +184,14 @@ module Nylas
|
|
184
184
|
destroyable
|
185
185
|
end
|
186
186
|
|
187
|
+
def id_listable?
|
188
|
+
id_listable
|
189
|
+
end
|
190
|
+
|
191
|
+
def countable?
|
192
|
+
countable
|
193
|
+
end
|
194
|
+
|
187
195
|
def resources_path(*)
|
188
196
|
@resources_path
|
189
197
|
end
|
@@ -6,7 +6,7 @@ module Nylas
|
|
6
6
|
class NeuralCategorizer < Message
|
7
7
|
include Model
|
8
8
|
self.resources_path = "/neural/categorize"
|
9
|
-
|
9
|
+
self.listable = true
|
10
10
|
|
11
11
|
attribute :categorizer, :categorize
|
12
12
|
# Overrides Message's label attribute as currently categorize returns
|
data/lib/nylas/neural_ocr.rb
CHANGED
data/lib/nylas/room_resource.rb
CHANGED
data/lib/nylas/rsvp.rb
CHANGED
data/lib/nylas/scheduler.rb
CHANGED
@@ -6,8 +6,12 @@ module Nylas
|
|
6
6
|
class Scheduler
|
7
7
|
include Model
|
8
8
|
self.resources_path = "/manage/pages"
|
9
|
-
|
10
|
-
|
9
|
+
self.creatable = true
|
10
|
+
self.listable = true
|
11
|
+
self.showable = true
|
12
|
+
self.filterable = true
|
13
|
+
self.updatable = true
|
14
|
+
self.destroyable = true
|
11
15
|
|
12
16
|
attribute :id, :integer, read_only: true
|
13
17
|
attribute :app_client_id, :string
|
data/lib/nylas/thread.rb
CHANGED
@@ -5,7 +5,12 @@ module Nylas
|
|
5
5
|
# @see https://docs.nylas.com/reference#threads
|
6
6
|
class Thread
|
7
7
|
include Model
|
8
|
-
|
8
|
+
self.searchable = true
|
9
|
+
self.listable = true
|
10
|
+
self.filterable = true
|
11
|
+
self.updatable = true
|
12
|
+
self.id_listable = true
|
13
|
+
self.countable = true
|
9
14
|
|
10
15
|
self.resources_path = "/threads"
|
11
16
|
|
data/lib/nylas/version.rb
CHANGED
data/lib/nylas/webhook.rb
CHANGED
@@ -41,8 +41,11 @@ module Nylas
|
|
41
41
|
# @see https://docs.nylas.com/reference#webhooks
|
42
42
|
class Webhook
|
43
43
|
include Model
|
44
|
-
|
45
|
-
|
44
|
+
self.creatable = true
|
45
|
+
self.listable = true
|
46
|
+
self.showable = true
|
47
|
+
self.updatable = true
|
48
|
+
self.destroyable = true
|
46
49
|
self.auth_method = HttpClient::AuthMethod::BASIC
|
47
50
|
attribute :id, :string, read_only: true
|
48
51
|
attribute :application_id, :string, read_only: true
|
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: 5.12.
|
4
|
+
version: 5.12.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: 2022-
|
11
|
+
date: 2022-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|