nylas 6.8.1 → 6.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 537c2669d5e30d03ad70d6acbd18c782865038fcff32779ffca36ece16234900
4
- data.tar.gz: bf78777657d01f6907505b473d5304419d95a8f8984455604fe59c86e5a1279b
3
+ metadata.gz: 4ff0837b04ea27eef880902f2967de6bbf45b9b61e2fe25a62acdfa4b9bbd20c
4
+ data.tar.gz: cc6ba9bcf584f4911e042b6928bfc99108df64d9fac3cdddbc7fa9f1fecd87c3
5
5
  SHA512:
6
- metadata.gz: bb7bca82b3c7dbb97b8365a4ef5882d86f41256952e17f854e03e1eff92d16a8cee53f57a971a8bc70209d26a7f5721915a6d458b8582adc24aaf9a055257469
7
- data.tar.gz: 52196420bcaeb94ea0b31c2a513b57dee5a8dd7eed2f5689564cba0d84e2b63b91751a0616881e0813b63a02a29cd16a1064d78f0a57b6e1e6c4ce31fa0e395f
6
+ metadata.gz: aa95b84bda5aab79c64b529f7bde85411c0d4652afb6635f55fa5c5fbef96da506ea7874d845fa9612d28c5cb8bfe6ef6c1c9a6218c9df0a164443811338ebe9
7
+ data.tar.gz: f0faf17e26fce6a49ee2da9387818aaa6fc65063738a8074580b6943d28b6c0a8096bad59443e2655316c0363d5a85ded00dbb5332f4806bfdbf4d9d7b2a64c1
data/CHANGELOG.md ADDED
@@ -0,0 +1,411 @@
1
+ # Changelog
2
+
3
+ ### [6.10.0] / 2026-11-04
4
+ * Added Events batch endpoint (Google and Microsoft). Supports create, update, and delete operations with ordered results, HTTP 207 responses, and retry safety metadata. ([#553](https://github.com/nylas/nylas-ruby/pull/553), [TT-5546](https://nylas.atlassian.net/browse/TT-5546))
5
+ * Validated batch grant identifiers and encoded them as a single URL path segment.
6
+
7
+ ### [6.9.0] / 2026-10-26
8
+ * Required HTTParty 0.24.0 or later to exclude versions affected by CVE-2025-68696 (potential SSRF and API key leakage)
9
+ * Treat 207 Multi-Status responses as successful, so a response that carries partial results is returned instead of raising an error
10
+ * Documented `tracking_options.domain_name` hash support for custom link and open tracking hostnames. See the [message tracking documentation](https://developer.nylas.com/docs/v3/email/message-tracking/)
11
+ * Documented Contact `metadata` and `metadata_pair` hashes, and added `contact.updated` and `contact.deleted` webhook trigger constants
12
+ * Updated CI runner images and SDK reference documentation deployment, made Ruby 3.0/3.1/3.2 versions explicit, and added gem builds to the Ruby test matrix
13
+ * Corrected gem metadata and SDK reference links, and included the changelog, README, and license in the gem package
14
+ * Updated the local test command to match the supported Ruby 3.0+ test suite
15
+ * Declared the RDoc development dependency so SDK reference documentation also builds on Ruby 4.0, and verified documentation output in CI
16
+ * Required YARD 0.9.44 or later for development to exclude known documentation server path traversal vulnerabilities
17
+ * Updated the coverage formatter for compatibility with current REXML releases
18
+
19
+ ### [6.8.1]
20
+ * Documented `tentative_as_busy` support in the `Calendars#get_free_busy` request body, consistent with other Nylas SDKs
21
+
22
+ ### [6.8.0]
23
+ * Added Policies resource for managing application policies
24
+ * Added Rules resource for managing inbox rules and listing rule evaluations
25
+ * Added Lists resource support for creating application lists
26
+ * Added Workspaces resource for managing workspaces, auto-grouping, manual assignment, `default`, `policy_id`, and `rule_ids`
27
+ * Added Domains resource and `ServiceAccountSigner` support for signed Service Account Manage Domains requests, including canonical signed bodies, encoded domain paths, info, and verify operations
28
+ * Added Applications update support (PATCH /v3/applications)
29
+ * Documented Applications update `callback_uris` ID preservation and Workspaces `auto_group` filters
30
+ * Corrected RedirectUris update verb from PUT to PATCH
31
+ * Fixed HTTParty content type issue when request body is nil - POST, PUT, PATCH, and DELETE now default to empty object to ensure Content-Type: application/json is sent (#536)
32
+ * Added support for request_body parameter on DELETE (e.g. cancellation_reason for bookings) (#536)
33
+
34
+ ### [6.7.1]
35
+ * Fix large attachment handling with string keys and custom content_ids
36
+
37
+ ### [6.7.0]
38
+ * Added access to response headers
39
+
40
+ ### [6.6.0]
41
+ * Added support for `single_level` query parameter in Folders API for Microsoft accounts
42
+ * Added support for `include_hidden_folders` query parameter in folders list endpoint for Microsoft accounts to control whether hidden folders are included in the response
43
+ * Added support for passing in string contents for multipart and base64 (<3MB) attachments (#528)
44
+ * Fixed HTTParty encoding compatibility issue with multipart requests (#528)
45
+
46
+ ### 6.5.0 / 2025-06-13
47
+ * Replaced `rest-client` dependency with `httparty` for improved maintainability and security
48
+ - `rest-client` is no longer actively maintained and has known security vulnerabilities
49
+ - `httparty` is actively maintained and provides better performance
50
+ - All existing functionality remains backwards compatible - no customer code changes required
51
+ - Removed workaround for `rest-client` cookie jar threading bug
52
+ * Added support for new `fields` query parameter values in Messages API:
53
+ - `include_tracking_options`: Returns messages and their tracking settings
54
+ - `raw_mime`: Returns the grant_id, object, id, and raw_mime fields only
55
+ * Added support for `tracking_options` field in message responses containing:
56
+ - `opens`: Boolean indicating if message open tracking is enabled
57
+ - `thread_replies`: Boolean indicating if thread replied tracking is enabled
58
+ - `links`: Boolean indicating if link clicked tracking is enabled
59
+ - `label`: String label describing the message tracking purpose
60
+ * Added support for `raw_mime` field in message responses containing Base64url-encoded message data
61
+ * Added `MessageFields` module with constants for all valid field values to improve developer experience
62
+ * Fixed multipart email sending bug where large attachments would fail due to multipart flag key mismatch (#525)
63
+ - `FileUtils.handle_message_payload` transforms keys to symbols (`:multipart`)
64
+ - `HttpClient.build_request` was only checking for string keys (`"multipart"`)
65
+ - Now checks for both string and symbol keys to maintain full backwards compatibility
66
+ - Prevents encoding errors when sending emails with attachments larger than 3MB
67
+
68
+ ### 6.4.0 / 2025-04-30
69
+ * Added support for Notetaker APIs
70
+ * Added support for Notetaker via the calendar and event APIs
71
+ * Added MESSAGE_BOUNCE_DETECTED to the webhook triggers
72
+ * Fixed issue to raise an explicit exception when the response lacks a JSON body (#520)
73
+
74
+ ### 6.3.0 / 2025-03-03
75
+ * Removed `file_path` from `File` object to match the Send API schema
76
+ * Added events import function to the RubySDK
77
+ * Added response headers to Ruby SDK
78
+
79
+ ### 6.2.3 / 2025-01-23
80
+ * Fixed issue where errors were not properly thrown due to an instance type of `String` instead of `Hash`
81
+
82
+ ### 6.2.2 / 2024-12-02
83
+ * Added support for private Scheduling configuration.
84
+ * Added ability to add optional `content_id` to support inline image on `send`.
85
+ * Added custom filename support for large attachments.
86
+ * Adjusted the gendoc to show that the `provider_error` is a Hash.
87
+
88
+ ### 6.2.1 / 2024-11-12
89
+ * Added support for scheduler APIs
90
+ * Added `query_params` field to `Folders` & `Threads` find
91
+ * Added custom filename support for attachments
92
+
93
+
94
+ ### 6.2.0 / 2024-09-24
95
+ * Added query support for folders
96
+ * Added dependency on `ostruct` gem
97
+ * Enable SDK to reattach large files to messages on retry
98
+ * Downgraded `rest-client` to `2.0` for better compatibility
99
+
100
+ ### 6.1.1 / 2024-08-20
101
+ * Fixed sending attachments less than 3MB
102
+
103
+ ### 6.1.0 / 2024-06-25
104
+ * Added query support for messages
105
+ * Added support for clean messages
106
+ * Added support for getting access token info
107
+ * Added new webhook triggers
108
+
109
+ ### 6.0.3 / 2024-03-05
110
+ * Improved message sending and draft create/update performance
111
+ * Change default timeout to match API (90 seconds)
112
+ * Fixed error when invoking `Auth.detect_provider`
113
+
114
+ ### 6.0.2 / 2024-02-27
115
+ * Fixed the HTTP operation of updating grants
116
+ * Fixed endpoint URL of rotating webhooks
117
+
118
+ ### 6.0.1 / 2024-02-12
119
+ * Fixed a bug during OAuth URL building
120
+ * Fixed a bug where the `next_cursor` field was omitted for list responses
121
+
122
+ ### 6.0.0 / 2024-02-05
123
+ * **BREAKING CHANGE**: Ruby SDK v6 supports the Nylas API v3 exclusively, dropping support for any endpoints that are not available in v3.
124
+ * **BREAKING CHANGE**: Officially support minimum Ruby v3
125
+ * **BREAKING CHANGE**: Removed all models and typing from the SDK
126
+ * **REMOVED**: Local Webhook development support is removed due to incompatibility
127
+ * Rewritten the majority of SDK to be more modular and efficient
128
+ * Created error classes for the different API errors as well as SDK-specific errors
129
+ * Added a configurable timeout for outgoing calls to the API
130
+
131
+ ### 5.17.0 / 2022-04-04
132
+ * Add support for verifying webhook signatures
133
+ * Add `event.updated_at`
134
+ * Allow native authentication to return the full response like the `exchange_code_for_token`
135
+
136
+ ### 5.16.0 / 2022-03-14
137
+ * Add missing `provider_id` attribute to `Label`
138
+ * Add `organizer_email` and `organizer_name` to `Event`
139
+ * Add missing job status webhook triggers
140
+ * Fix `MESSAGE_LINK_CLICKED` trigger
141
+
142
+ ### 5.15.0 / 2022-02-02
143
+ * Add local webhook testing support
144
+ * Add `tzinfo`, `faye-websocket`, `eventmachine` as runtime dependencies
145
+
146
+ ### 5.14.0 / 2022-12-16
147
+ * Added support for rate limit errors
148
+ * Added `disable_provider_selection` option for building auth URL
149
+ * Improved performance by skipping creating instance of StringIO before parsing JSON
150
+
151
+ ### 5.13.0 / 2022-10-21
152
+ * Add timezone fields to the `When` class
153
+ * Adds visibility attribute to `Event` class
154
+ * Add support for calendar colors (for Microsoft calendars)
155
+
156
+ ### 5.12.1 / 2022-08-12
157
+ * Add support for getting `ids` and `count` for collections not supported by the API
158
+ * Fix Ruby 3.x compatibility for expanding keyword arguments
159
+
160
+ ### 5.12.0 / 2022-07-29
161
+ * Add missing hosted authentication parameters
162
+ * Add `reply_to_message_id` field in `Messages`
163
+ * Fix calendar availability failing when `round_robin` is `nil`
164
+
165
+ ### 5.11.0 / 2022-07-08
166
+ * Add support for event reminders
167
+ * Add `metadata` field to `JobStatus`
168
+
169
+ ### 5.10.0 / 2022-05-10
170
+ * Support collective and group events
171
+ * Fix `ModelNotFilterableError` when querying for accounts with metadata
172
+
173
+ ### 5.9.2 / 2022-05-04
174
+ * Fix calendar availability not serializing `FreeBusy` and `OpenHours` properly
175
+ * Fix Authentication demo app using deprecated Google scopes
176
+
177
+ ### 5.9.1 / 2022-04-20
178
+ * Add missing `phone_number` field in `Participant`
179
+ * Fix `NoMethodError` when calling `NewMessage#send!`
180
+
181
+ ### 5.9.0 / 2022-04-07
182
+ * Add Outbox support
183
+ * Add new `authentication_type` field in Account
184
+ * Add support for basic authentication
185
+ * Enable Nylas API v2.5 support
186
+
187
+ ### 5.8.0 / 2022-03-18
188
+ * Improved support for `Webhook` objects
189
+ * Support `calendars` for availability methods
190
+ * Fix `interval_minutes` keyword for availability methods
191
+
192
+ ### 5.7.0 / 2022-01-21
193
+ * Add job status support
194
+ * Add `Event` to ICS support
195
+ * Add support for getting access token information
196
+ * Improved support for Application Details
197
+ * Enable ability to delete `Account` objects
198
+ * Fix saving and deleting `Folder` objects
199
+
200
+ ### 5.6.1 / 2021-12-13
201
+ * Enabled support for adding metadata to a `NewMessage`/`Draft`
202
+ * Fix bug where updating an Event results in an API error
203
+
204
+ ### 5.6.0 / 2021-11-22
205
+ * Add support for event notifications
206
+ * Add more Scheduler support
207
+ * Add metadata support for `Calendar`, `Message` and `Account`
208
+ * Modify `exchange_code_for_token` to allow returning a full body
209
+
210
+ ### 5.5.0 / 2021-10-28
211
+ * Add Component CRUD Support
212
+ * Add Scheduler support
213
+ * Add support for calendar availability
214
+ * Add support for `File` delete operation
215
+ * Fix issue where `file_ids` get reset to empty
216
+
217
+ ### 5.4.1 / 2021-09-27
218
+ * Fix draft send method to send existing draft when tracking is enabled
219
+
220
+ ### 5.4.0 / 2021-09-23
221
+ * Add support for Event Conferencing
222
+ * Fix update draft failing if version is not explicitly set
223
+ * Fix draft `.send` logic
224
+
225
+ ### 5.3.0 / 2021-08-18
226
+ * Add support for Neural API
227
+ * Fix issue where `Delta` did not have a header attribute for expanded headers
228
+ * Fix ArgumentError when calling `Nylas::API#send!` due to missing double splat (**)
229
+ * Fix issue where server errors are not reported if HTML is returned
230
+ * Fix issue where expanded `Thread` objects were not returning messages
231
+
232
+ ### 5.2.0 / 2021-06-07
233
+ * Add support for `Room Resource`
234
+ * Fix issue where "302 Redirect" response codes were treated as errors
235
+ * Fix issue where `api` value was overriden when calling `message.expanded`
236
+
237
+ ### 5.1.0 / 2021-06-07
238
+ * Add support for read only attributes
239
+ * Add `save_all_attributes` and `update_all_attributes` methods to support
240
+ nullifying attributes.
241
+ * Add support new `Event` metadata feature
242
+ * Fix attributes assignment for `Delta`
243
+ * Fix issue where files couldn't be attached to drafts
244
+ * Fix exception raise when content-type is not JSON
245
+ * Fix issue where draft version wouldn't update after `update` or `save`
246
+
247
+ ### 5.0.0 / 2021-05-07
248
+
249
+ * Send `Nylas-API-Version` header to API with latest supported version.
250
+ * Fix issue sending message using raw mime type.
251
+ * Support for `messages.expanded.find(id)` to return expanded message.
252
+ * Add support for hosted authentication
253
+ * Fix bug to not send `id`, `object` and `account_id` on events update call
254
+
255
+ ### 4.6.7 / 2021-04-22
256
+
257
+ * Support for Ruby 3.
258
+ * Add support for `/free-busy` endpoint
259
+ * Fix issue where download a file fetch via `find` failed,
260
+
261
+ ### 4.6.6 / 2021-04-06
262
+
263
+ * Add support for `notify_participants` when creating events
264
+ * Add provider attribute to account
265
+
266
+ ### 4.6.5 / 2021-02-22
267
+
268
+ * Add `content_disposition` field to File
269
+ * Fix thread-safety issue in HTTP::CookieJar loading
270
+
271
+ ### 4.6.4 / 2021-02-03
272
+
273
+ * fix failing http_client spec after merging main
274
+ * Skip parsing response if content is not JSON
275
+ * Add missing http status codes / errors.
276
+ * Add reply_to to NewMessage
277
+ * Add message tracking to drafts.
278
+ * Truncate the returned filename so it's less than 256 characters and compatible with rb_sysopen.
279
+ * Bump required rest client dep to >= 2.0, remove travis ci tests for rest client 1, ruby v2.3
280
+ * Use to_json helper instead of JSON.dump.
281
+
282
+ ### 4.6.3 / 2020-12-18
283
+
284
+ * Remove folder on message.save for updates
285
+ * Fix JSON parsing behavior
286
+ * Fix rubocop warnings for http_client and spec
287
+ * No longer rescue json parse errors, use Yajl instead of JSON for parsing responses (due to unicode issue).
288
+ * Add specs for changes to message.save
289
+ * Store folder id in folder_id and remove folder if present before saving.
290
+ * Adding secondary_address field to physical address model
291
+
292
+ ### 4.6.2 / 2020-09-08
293
+
294
+ * Add support to move `message` and `thread` between `folder`.
295
+ * Handle new attributes added to API gracefully
296
+ * Add is_primary and other new Calendar attributes
297
+
298
+ ### 4.6.1 / 2020-01-06
299
+
300
+ * Fix a bug with `when` blocks when creating events
301
+ * Add support for the Event.ical_uid field
302
+
303
+ ### 4.6.0 / 2019-09-25
304
+
305
+ * Add support for `/contacts/groups` endpoint.
306
+ * Fix issue when calling `.save` on `message` (https://github.com/nylas/nylas-ruby/pull/233)
307
+ * Add support for Rails 6.
308
+ * Fix issue for updating `message` with sending `label_ids` (https://github.com/nylas/nylas-ruby/pull/231)
309
+ * Support for `when` in `Nylas::Event` for more attributes.
310
+ * Add internal transfer api to support initialize related objects.
311
+ * Fix encoding issues when downloading attachments.
312
+
313
+ ### 4.5.0 / 2019-04-15
314
+
315
+ * Add support for `source` attribute in Contact model
316
+
317
+ ### 4.4.0 / 2019-04-05
318
+
319
+ * Add support for `/ip_addresses` endpoint
320
+ * Add optional argument for `Model#to_json`
321
+ * Reintroduce support for Ruby 2.3
322
+ * Add Rails 4 bundler support to setup script
323
+ * Specify gemfiles called in test script
324
+
325
+ ### 4.3.0 / 2019-03-18
326
+
327
+ * Drop support for Ruby 2.2 and 2.3: they have reached end-of-life
328
+ * Add support for Ruby 2.5 and 2.6
329
+ * Add `scopes` argument to `Nylas::API#authenticate` for
330
+ [selective sync](https://docs.nylas.com/docs/how-to-use-selective-sync)
331
+ * Add `Account#revoke_all`
332
+ * Add X-Nylas-Client-Id header for HTTP requests
333
+
334
+ ### 4.2.4 / 2018-08-07
335
+ * Enables silent addition of fields to API without impact to SDK
336
+ * Fixes api attribute breakage on enumeration (https://github.com/nylas/nylas-ruby/issues/188)
337
+
338
+ ### 4.0.0 / 2018-01-??
339
+ * Drop support for ruby 2.0 and below
340
+ * Add support for v2 of the Contacts API
341
+ * Switch to an ActiveModel/ActiveQuery compliant interface for interacting with
342
+ objects and APIs
343
+
344
+ ### 3.2.0 / 2017-11-16
345
+ * Add support for Ruby 2.4+
346
+ * Add support for Rails 4+
347
+ * Filters now work correctly for all models
348
+ * `.each` now pages requests
349
+ * Numerous other bug fixes
350
+
351
+ ### 3.1.1 / 2017-06-23
352
+ * Fix deleting event request (https://github.com/nylas/nylas-ruby/issues/101)
353
+
354
+ ### 3.1.0 / 2017-05-10
355
+ * Adds support for message tracking (https://github.com/cberkom)
356
+
357
+ ### 3.0.0 / 2016-11-04
358
+
359
+ * Removes `interpret_http_status` to be included in `interpret_response`
360
+ * Improve error handling
361
+ * Add native authentication example code
362
+ * Add webhooks example code
363
+ * Removes experimental JRuby support
364
+
365
+ [full changelog](https://github.com/nylas/nylas-ruby/compare/v2.0.1...v3.0.0)
366
+
367
+ ### 2.0.1 / 2016-02-12
368
+
369
+ * Fix folders and labels updates for threads and messages
370
+ * Revert pull request #71
371
+
372
+ [full changelog](https://github.com/nylas/nylas-ruby/compare/v2.0.0...v2.0.1)
373
+
374
+ ### 2.0.0 / 2016-02-05
375
+
376
+ * Remove get_cursor method that calls deprecated generate_cursor endpoint
377
+ * Modify `delta_stream method` to remove built-in `EventMachine.run` block and allow for multiple streams. `delta_stream` must now be called from inside an `EventMachine.run` block
378
+ * `url_for_authentication` now accepts a `:state` parameter (see https://nylas.com/docs#server_side_explicit_flow for more details)
379
+
380
+ [full changelog](https://github.com/nylas/nylas-ruby/compare/v1.3.0...v2.0.0)
381
+
382
+ ### 1.3.0 / 2015-12-07
383
+
384
+ * Deprecate the tags API
385
+ * Remove the archive!/unarchive! methods
386
+ * Expose `starred`, `unread`, `has_attachments` in Nylas::Thread
387
+
388
+ [full changelog](https://github.com/nylas/nylas-ruby/compare/v1.2.1...v1.3.0)
389
+
390
+ ### 1.2.0 / 2015-11-19
391
+
392
+ * Add `Messages#files?` [Issue #40](https://github.com/nylas/nylas-ruby/issues/40)
393
+ * Return an external Enumerator when no block given. [Issue #42](https://github.com/nylas/nylas-ruby/issues/42) ([Steven Harman](https://github.com/stevenharman))
394
+ * Expose `folders` in the Delta Stream API.
395
+ * Add `Inbox::Error` base class for all errors. ([Steven Harman](https://github.com/stevenharman))
396
+ * Expose `sync_state` on the `/account` API. ([Steven Harman](https://github.com/stevenharman))
397
+ * Return Enumerator for #deltas when no block given
398
+ * Ruby < 1.9.3 no longer supported
399
+ * Add travis support for Mac OS X
400
+
401
+ [full changelog](https://github.com/nylas/nylas-ruby/compare/v1.1.0...v1.2.0)
402
+
403
+
404
+ ### 1.1.0 / 2015-09-22
405
+
406
+ * `Message#expanded` returns an expanded version of a message
407
+ * Expose the `server_error` field when failing to send messages
408
+ * minor bug fixes
409
+ * various test cleanups ([Steven Harman](https://github.com/stevenharman))
410
+
411
+ [full changelog](https://github.com/nylas/nylas-ruby/compare/v1.0.0...v1.1.0)
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+ ----
3
+
4
+ Copyright (c) 2016 Nylas, Inc. and Contributors
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,185 @@
1
+ <div align="center">
2
+ <a href="https://www.nylas.com/">
3
+ <img width="100%" alt="Nylas" src="https://github.com/user-attachments/assets/137517ae-244d-47a5-8ca7-b12984971fc4" />
4
+ </a>
5
+
6
+ <h1>Nylas Ruby SDK</h1>
7
+
8
+ <p>
9
+ <strong>The official Ruby SDK for Nylas — the infrastructure that powers communications</strong>
10
+ </p>
11
+
12
+ <p>
13
+ <a href="https://rubygems.org/gems/nylas"><img src="https://img.shields.io/gem/v/nylas" alt="version" /></a>
14
+ <a href="https://codecov.io/gh/nylas/nylas-ruby"><img src="https://codecov.io/gh/nylas/nylas-ruby/branch/main/graph/badge.svg?token=IKH0YMH4KA" alt="code coverage" /></a>
15
+ <a href="https://rubygems.org/gems/nylas"><img src="https://img.shields.io/gem/dt/nylas" alt="downloads" /></a>
16
+ <a href="LICENSE.txt"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="license" /></a>
17
+ </p>
18
+
19
+ <p>
20
+ <a href="https://developer.nylas.com/docs/v3/sdks/ruby/">📖 SDK Guide</a> ·
21
+ <a href="https://developer.nylas.com/docs/api/v3/">📚 API Reference</a> ·
22
+ <a href="https://dashboard-v3.nylas.com/register">🚀 Sign up</a> ·
23
+ <a href="https://github.com/orgs/nylas-samples/repositories?q=ruby">💡 Samples</a> ·
24
+ <a href="https://forums.nylas.com">💬 Forum</a>
25
+ </p>
26
+ </div>
27
+
28
+ <br />
29
+
30
+ The official Ruby SDK for [Nylas](https://developer.nylas.com/docs/v3/) — the infrastructure that powers communications. Integrate with Gmail, Microsoft, IMAP, Zoom, and 250+ email, calendar, and meeting providers in 5 minutes. Covers [Email](https://developer.nylas.com/docs/v3/email/), [Calendar](https://developer.nylas.com/docs/v3/calendar/), [Contacts](https://developer.nylas.com/docs/v3/email/contacts/), [Scheduler](https://developer.nylas.com/docs/v3/scheduler/), [Notetaker](https://developer.nylas.com/docs/v3/notetaker/), and [Agent Accounts](https://developer.nylas.com/docs/v3/agent-accounts/).
31
+
32
+ This repository is for contributors and anyone installing the SDK from source. If you just want to use the SDK in your app, head straight to the **[Ruby SDK guide](https://developer.nylas.com/docs/v3/sdks/ruby/)** on developer.nylas.com.
33
+
34
+ ## Get started
35
+
36
+ 1. [Sign up for a free Nylas account](https://dashboard-v3.nylas.com/register).
37
+ 2. Follow the [getting started guide](https://developer.nylas.com/docs/v3/getting-started/) to provision an application and create your API key.
38
+ 3. Bootstrap a project with the Nylas CLI:
39
+
40
+ ```bash
41
+ brew install nylas/nylas-cli/nylas
42
+ nylas init
43
+ ```
44
+
45
+ ## ⚙️ Install
46
+
47
+ > **Requirements:** Ruby 3.0 or later.
48
+
49
+ Add the gem to your Gemfile:
50
+
51
+ ```ruby
52
+ gem "nylas"
53
+ ```
54
+
55
+ Then install:
56
+
57
+ ```bash
58
+ bundle install
59
+ ```
60
+
61
+ Or install it directly:
62
+
63
+ ```bash
64
+ gem install nylas
65
+ ```
66
+
67
+ ### Build from source
68
+
69
+ ```bash
70
+ git clone https://github.com/nylas/nylas-ruby.git
71
+ cd nylas-ruby
72
+ bundle install
73
+ ```
74
+
75
+ Run the test suite with `rspec spec`.
76
+
77
+ ## ⚡️ Usage
78
+
79
+ Initialize the client with your API key:
80
+
81
+ ```ruby
82
+ require "nylas"
83
+
84
+ nylas = Nylas::Client.new(
85
+ api_key: "NYLAS_API_KEY"
86
+ )
87
+ ```
88
+
89
+ Then make a request — for example, list a grant's calendars:
90
+
91
+ ```ruby
92
+ calendars, request_id, next_cursor = nylas.calendars.list(identifier: "GRANT_ID")
93
+ ```
94
+
95
+ Every SDK call returns a tuple. List endpoints return `[data, request_id, next_cursor, headers]`; single-record endpoints return `[data, request_id]`. Destructure the elements you need and ignore the rest with `_`. Use `next_cursor` to paginate:
96
+
97
+ ```ruby
98
+ cursor = nil
99
+ loop do
100
+ page, _request_id, cursor = nylas.calendars.list(
101
+ identifier: "GRANT_ID",
102
+ query_params: { page_token: cursor }
103
+ )
104
+ page.each { |calendar| puts calendar[:name] }
105
+ break unless cursor
106
+ end
107
+ ```
108
+
109
+ For step-by-step walkthroughs, see the developer guides:
110
+
111
+ - [Email](https://developer.nylas.com/docs/v3/email/)
112
+ - [Calendar](https://developer.nylas.com/docs/v3/calendar/)
113
+ - [Scheduler](https://developer.nylas.com/docs/v3/scheduler/)
114
+ - [Notetaker](https://developer.nylas.com/docs/v3/notetaker/)
115
+ - [Agent Accounts](https://developer.nylas.com/docs/v3/agent-accounts/)
116
+ - [Notifications & webhooks](https://developer.nylas.com/docs/v3/notifications/)
117
+
118
+ ### Error handling
119
+
120
+ The SDK raises typed errors you can rescue. API failures raise `Nylas::NylasApiError` (with `type`, `status_code`, `request_id`, `provider_error`, `headers`); OAuth failures raise `Nylas::NylasOAuthError`; request timeouts raise `Nylas::NylasSdkTimeoutError`.
121
+
122
+ ```ruby
123
+ begin
124
+ nylas.messages.find(identifier: "GRANT_ID", message_id: "MESSAGE_ID")
125
+ rescue Nylas::NylasApiError => e
126
+ warn "Nylas API error #{e.status_code} (#{e.type}): #{e.message}"
127
+ rescue Nylas::NylasSdkTimeoutError => e
128
+ warn "Request to #{e.url} timed out after #{e.timeout}s"
129
+ end
130
+ ```
131
+
132
+ ## 💡 Examples
133
+
134
+ - Local examples live in [`examples/`](examples/) (messages, events, folders, notetaker).
135
+ - The [Nylas Samples org](https://github.com/orgs/nylas-samples/repositories?q=ruby) has end-to-end Ruby apps you can clone and run.
136
+
137
+ ## 🤖 AI agents
138
+
139
+ [nylas/skills](https://github.com/nylas/skills) drops Nylas into Claude Code, Cursor, Codex, and other agents that support the skills format:
140
+
141
+ ```bash
142
+ npx skills add nylas/skills
143
+ /plugin marketplace add nylas/skills # Claude Code
144
+ ```
145
+
146
+ The CLI also installs an MCP server for Claude Desktop, Claude Code, Cursor, Windsurf, or VS Code:
147
+
148
+ ```bash
149
+ brew install nylas/nylas-cli/nylas
150
+ nylas mcp install
151
+ ```
152
+
153
+ Walkthrough: [give AI agents email access via MCP](https://cli.nylas.com/guides/give-ai-agents-email-access-via-mcp).
154
+
155
+ ## 📚 Reference
156
+
157
+ - [Ruby SDK guide](https://developer.nylas.com/docs/v3/sdks/ruby/)
158
+ - [API reference](https://developer.nylas.com/docs/api/v3/)
159
+ - [Getting started](https://developer.nylas.com/docs/v3/getting-started/)
160
+ - [Email](https://developer.nylas.com/docs/v3/email/) · [Calendar](https://developer.nylas.com/docs/v3/calendar/) · [Scheduler](https://developer.nylas.com/docs/v3/scheduler/) · [Notetaker](https://developer.nylas.com/docs/v3/notetaker/) · [Agent Accounts](https://developer.nylas.com/docs/v3/agent-accounts/) · [Notifications](https://developer.nylas.com/docs/v3/notifications/)
161
+ - [Data residency](https://developer.nylas.com/docs/dev-guide/platform/data-residency/)
162
+ - [Nylas CLI](https://cli.nylas.com)
163
+ - [Forum](https://forums.nylas.com)
164
+
165
+ ## ✨ Upgrading
166
+
167
+ See [CHANGELOG.md](CHANGELOG.md) for release notes, and [UPGRADE.md](UPGRADE.md) for the 5.x → 6.x migration guide. The 6.x line targets Nylas API v3; if you're still on v2.7 or earlier, stay on the 5.x SDK.
168
+
169
+ ## 💙 Contributing
170
+
171
+ Bug reports, questions, and pull requests are welcome. See [Contributing.md](Contributing.md) for the workflow, and the [Nylas Forum](https://forums.nylas.com) for broader discussion.
172
+
173
+ ## 🔒 Security
174
+
175
+ To report a security vulnerability, follow the [Nylas Vulnerability Disclosure Policy](https://www.nylas.com/security/vulnerability-disclosure-policy/). Please don't open a public GitHub issue for security reports.
176
+
177
+ ## 🔗 Other Nylas SDKs
178
+
179
+ - [nylas-nodejs](https://github.com/nylas/nylas-nodejs)
180
+ - [nylas-python](https://github.com/nylas/nylas-python)
181
+ - [nylas-java](https://github.com/nylas/nylas-java) (Java & Kotlin)
182
+
183
+ ## 📝 License
184
+
185
+ MIT — see [LICENSE.txt](LICENSE.txt).
data/lib/nylas/errors.rb CHANGED
@@ -83,5 +83,5 @@ module Nylas
83
83
  end
84
84
  end
85
85
 
86
- HTTP_SUCCESS_CODES = [200, 201, 202, 302].freeze
86
+ HTTP_SUCCESS_CODES = [200, 201, 202, 207, 302].freeze
87
87
  end
@@ -19,7 +19,7 @@ module Nylas
19
19
  # Get info about a specific token based on the identifier you include.
20
20
  # Use either the ID Token or Access Token.
21
21
  #
22
- # @param ID of the request.
22
+ # @param query_params [Hash, nil] Query parameters containing the token to inspect.
23
23
  # @return [Hash] Token Info.
24
24
  def access_token_info(query_params: nil)
25
25
  get(
@@ -14,7 +14,10 @@ module Nylas
14
14
  # Return all contacts.
15
15
  #
16
16
  # @param identifier [String] Grant ID or email account to query.
17
- # @param query_params [Hash, nil] Query params to pass to the request.
17
+ # @param query_params [Hash, nil] Query params to pass to the request. Use
18
+ # `metadata_pair: { key1: "value" }` to filter by one indexed metadata
19
+ # key (`key1` through `key5`). Metadata filters cannot be combined with
20
+ # provider-side contact filters.
18
21
  # @return [Array(Array(Hash), String, String)] The list of contacts, API Request ID, and next cursor.
19
22
  def list(identifier:, query_params: nil)
20
23
  get_list(
@@ -39,7 +42,8 @@ module Nylas
39
42
  # Create a contact.
40
43
  #
41
44
  # @param identifier [String] Grant ID or email account in which to create the object.
42
- # @param request_body [Hash] The values to create the contact with.
45
+ # @param request_body [Hash] The values to create the contact with. The
46
+ # optional `metadata` hash is stored by Nylas, not by the provider.
43
47
  # @return [Array(Hash, String)] The created contact and API Request ID.
44
48
  def create(identifier:, request_body:)
45
49
  post(
@@ -52,7 +56,9 @@ module Nylas
52
56
  #
53
57
  # @param identifier [String] Grant ID or email account in which to update an object.
54
58
  # @param contact_id [String] The id of the contact to update.
55
- # @param request_body [Hash] The values to update the contact with
59
+ # @param request_body [Hash] The values to update the contact with. Omitting
60
+ # `metadata` or setting it to `nil` preserves existing metadata, a hash
61
+ # replaces it, and an empty hash clears it.
56
62
  # @return [Array(Hash, String)] The updated contact and API Request ID.
57
63
  def update(identifier:, contact_id:, request_body:)
58
64
  put(
@@ -39,9 +39,12 @@ module Nylas
39
39
  #
40
40
  # @param identifier [String] Grant ID or email account in which to create the draft.
41
41
  # @param request_body [Hash] The values to create the message with.
42
+ # Use `:tracking_options` with `:links` or `:opens` enabled to track the draft. To use a custom
43
+ # tracking hostname, set `:domain_name` inside `:tracking_options` to an active hostname owned
44
+ # by your organization.
42
45
  # If you're attaching files, you must pass an array of [File] objects, or
43
46
  # you can pass in base64 encoded strings if the total attachment size is less than 3mb.
44
- # You can also use {FileUtils::attach_file_request_builder} to build each object attach.
47
+ # You can also use {Nylas::FileUtils.attach_file_request_builder} to build each attachment.
45
48
  # @return [Array(Hash, String)] The created draft and API Request ID.
46
49
  def create(identifier:, request_body:)
47
50
  payload, opened_files = FileUtils.handle_message_payload(request_body)
@@ -61,9 +64,12 @@ module Nylas
61
64
  # @param identifier [String] Grant ID or email account in which to update the draft.
62
65
  # @param draft_id [String] The id of the draft to update.
63
66
  # @param request_body [Hash] The values to create the message with.
67
+ # To replace the draft's custom tracking hostname, set `:tracking_options` with `:links` or
68
+ # `:opens` enabled and a `:domain_name`. Omit `:tracking_options` to preserve the draft's
69
+ # existing tracking settings.
64
70
  # If you're attaching files, you must pass an array of [File] objects, or
65
71
  # you can pass in base64 encoded strings if the total attachment size is less than 3mb.
66
- # You can also use {FileUtils::attach_file_request_builder} to build each object attach.
72
+ # You can also use {Nylas::FileUtils.attach_file_request_builder} to build each attachment.
67
73
  # @return [Array(Hash, String)] The updated draft and API Request ID.
68
74
  def update(identifier:, draft_id:, request_body:)
69
75
  payload, opened_files = FileUtils.handle_message_payload(request_body)
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative "resource"
4
4
  require_relative "../handler/api_operations"
5
+ require "uri"
5
6
 
6
7
  module Nylas
7
8
  # Nylas Events API
@@ -51,6 +52,45 @@ module Nylas
51
52
  )
52
53
  end
53
54
 
55
+ # Create, update, or delete events in one request (Google and Microsoft).
56
+ #
57
+ # Results follow the operation order. Both 200 and 207 responses return normally;
58
+ # inspect each result's status and error, even when every operation failed.
59
+ # The API validates the operations and batch size. No operations are retried automatically.
60
+ #
61
+ # @param identifier [String] Grant ID or email account in which to modify events.
62
+ # @param request_body [Hash] The batch request.
63
+ # @option request_body [Array<Hash>] :operations The event operations to execute.
64
+ # Each operation has a :method of "create", "update", or "delete".
65
+ # Create and update require :body, using the same event Hash as {#create} or {#update}.
66
+ # Update and delete require :event_id [String].
67
+ # @param query_params [Hash] Query parameters applied to every operation.
68
+ # @option query_params [String] :calendar_id The required calendar ID.
69
+ # @option query_params [Boolean] :notify_participants Defaults to true on the server.
70
+ # Microsoft does not support false.
71
+ # @option query_params [String] :grant_email Optional grant email.
72
+ # @option query_params [Boolean] :tentative_as_busy Whether tentative events count as busy.
73
+ # @option query_params [String] :select Comma-separated event fields to return.
74
+ # @return [Array(Array<Hash>, String, Hash)] Ordered results, API request ID, and response headers.
75
+ # Each result has :status [Integer], optional :data [Hash] with the event for a successful
76
+ # create or update, and optional :error [Hash] with :type [String], :message [String], and
77
+ # :provider_error [Hash]. A successful delete has no :data. Failed results may include
78
+ # :retry_after [Numeric] (seconds, including zero) and :provider_event_created [Boolean].
79
+ # Never retry an operation with :provider_event_created set to true; it would create a duplicate.
80
+ # @raise [ArgumentError] If the grant identifier is not a nonblank String or is a URL dot segment.
81
+ def batch(identifier:, request_body:, query_params:)
82
+ unless identifier.is_a?(String) && !identifier.strip.empty? && !%w[. ..].include?(identifier.strip)
83
+ raise ArgumentError, "Invalid grant identifier."
84
+ end
85
+
86
+ encoded_identifier = URI.encode_www_form_component(identifier).gsub("+", "%20")
87
+ post(
88
+ path: "#{api_uri}/v3/grants/#{encoded_identifier}/events/batch",
89
+ query_params: query_params,
90
+ request_body: request_body
91
+ )
92
+ end
93
+
54
94
  # Update an event.
55
95
  #
56
96
  # @param identifier [String] Grant ID or email account in which to update an object.
@@ -114,9 +114,14 @@ module Nylas
114
114
  #
115
115
  # @param identifier [String] Grant ID or email account from which to delete an object.
116
116
  # @param request_body [Hash] The values to create the message with.
117
+ # Use `:tracking_options` with `:links` or `:opens` enabled to track a message. To use a custom
118
+ # tracking hostname, set `:domain_name` inside `:tracking_options` to an active hostname owned
119
+ # by your organization. Omit `:domain_name` to use the default Nylas tracking hostname.
120
+ # Set `:send_at` to a Unix timestamp to schedule the message; custom tracking hostnames are
121
+ # validated when the send is scheduled and revalidated before delivery.
117
122
  # If you're attaching files, you must pass an array of [File] objects, or
118
123
  # you can pass in base64 encoded strings if the total attachment size is less than 3mb.
119
- # You can also use {FileUtils::attach_file_request_builder} to build each object attach.
124
+ # You can also use {Nylas::FileUtils.attach_file_request_builder} to build each attachment.
120
125
  # @return [Array(Hash, String)] The sent message and the API Request ID.
121
126
  def send(identifier:, request_body:)
122
127
  payload, opened_files = FileUtils.handle_message_payload(request_body)
@@ -5,11 +5,16 @@ require_relative "../handler/api_operations"
5
5
 
6
6
  module Nylas
7
7
  # Module representing the possible 'trigger' values in a Webhook.
8
+ # Native iCloud contacts support CONTACT_UPDATED and CONTACT_DELETED. Yahoo
9
+ # contacts support neither trigger, including for changes made through the
10
+ # Nylas API. There is no CONTACT_CREATED trigger.
8
11
  # @see https://developer.nylas.com/docs/api#post/a/client_id/webhooks
9
12
  module WebhookTrigger
10
13
  CALENDAR_CREATED = "calendar.created"
11
14
  CALENDAR_UPDATED = "calendar.updated"
12
15
  CALENDAR_DELETED = "calendar.deleted"
16
+ CONTACT_UPDATED = "contact.updated"
17
+ CONTACT_DELETED = "contact.deleted"
13
18
  EVENT_CREATED = "event.created"
14
19
  EVENT_UPDATED = "event.updated"
15
20
  EVENT_DELETED = "event.deleted"
data/lib/nylas/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nylas
4
- VERSION = "6.8.1"
4
+ VERSION = "6.10.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nylas
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.8.1
4
+ version: 6.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nylas, Inc.
@@ -29,14 +29,14 @@ dependencies:
29
29
  requirements:
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: '0.21'
32
+ version: '0.24'
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.21'
39
+ version: '0.24'
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: mime-types
42
42
  requirement: !ruby/object:Gem::Requirement
@@ -119,20 +119,40 @@ dependencies:
119
119
  - - ">="
120
120
  - !ruby/object:Gem::Version
121
121
  version: 1.3.0
122
+ - !ruby/object:Gem::Dependency
123
+ name: rdoc
124
+ requirement: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '6.3'
129
+ - - "<"
130
+ - !ruby/object:Gem::Version
131
+ version: '8.0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '6.3'
139
+ - - "<"
140
+ - !ruby/object:Gem::Version
141
+ version: '8.0'
122
142
  - !ruby/object:Gem::Dependency
123
143
  name: yard
124
144
  requirement: !ruby/object:Gem::Requirement
125
145
  requirements:
126
146
  - - "~>"
127
147
  - !ruby/object:Gem::Version
128
- version: 0.9.34
148
+ version: 0.9.44
129
149
  type: :development
130
150
  prerelease: false
131
151
  version_requirements: !ruby/object:Gem::Requirement
132
152
  requirements:
133
153
  - - "~>"
134
154
  - !ruby/object:Gem::Version
135
- version: 0.9.34
155
+ version: 0.9.44
136
156
  - !ruby/object:Gem::Dependency
137
157
  name: rubocop
138
158
  requirement: !ruby/object:Gem::Requirement
@@ -243,14 +263,14 @@ dependencies:
243
263
  requirements:
244
264
  - - "~>"
245
265
  - !ruby/object:Gem::Version
246
- version: 2.1.0
266
+ version: '3.2'
247
267
  type: :development
248
268
  prerelease: false
249
269
  version_requirements: !ruby/object:Gem::Requirement
250
270
  requirements:
251
271
  - - "~>"
252
272
  - !ruby/object:Gem::Version
253
- version: 2.1.0
273
+ version: '3.2'
254
274
  - !ruby/object:Gem::Dependency
255
275
  name: webrick
256
276
  requirement: !ruby/object:Gem::Requirement
@@ -277,6 +297,9 @@ executables: []
277
297
  extensions: []
278
298
  extra_rdoc_files: []
279
299
  files:
300
+ - CHANGELOG.md
301
+ - LICENSE.txt
302
+ - README.md
280
303
  - lib/nylas.rb
281
304
  - lib/nylas/client.rb
282
305
  - lib/nylas/config.rb
@@ -314,12 +337,13 @@ files:
314
337
  - lib/nylas/resources/workspaces.rb
315
338
  - lib/nylas/utils/file_utils.rb
316
339
  - lib/nylas/version.rb
340
+ homepage: https://www.nylas.com
317
341
  licenses:
318
342
  - MIT
319
343
  metadata:
320
344
  bug_tracker_uri: https://github.com/nylas/nylas-ruby/issues
321
- changelog_uri: https://github.com/nylas/nylas-ruby/blob/master/CHANGELOG.md
322
- documentation_uri: https://developer.nylas.com/docs/sdks/ruby/
345
+ changelog_uri: https://github.com/nylas/nylas-ruby/blob/main/CHANGELOG.md
346
+ documentation_uri: https://developer.nylas.com/docs/v3/sdks/ruby/
323
347
  homepage_uri: https://www.nylas.com
324
348
  source_code_uri: https://github.com/nylas/nylas-ruby
325
349
  github_repo: https://github.com/nylas/nylas-ruby
@@ -337,7 +361,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
337
361
  - !ruby/object:Gem::Version
338
362
  version: '0'
339
363
  requirements: []
340
- rubygems_version: 4.0.3
364
+ rubygems_version: 4.0.20
341
365
  specification_version: 4
342
366
  summary: Gem for interacting with the Nylas API
343
367
  test_files: []