nylas 6.9.0 → 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: dd4f82c67af569b7d104e68c7dc95e078b20e23dd13f773ba2b7ed2d1936e78b
4
- data.tar.gz: 644b49eb5d7f85fbc648185ce9c4b5a5606383d349cd7aca5f1f29abdb5240f3
3
+ metadata.gz: 4ff0837b04ea27eef880902f2967de6bbf45b9b61e2fe25a62acdfa4b9bbd20c
4
+ data.tar.gz: cc6ba9bcf584f4911e042b6928bfc99108df64d9fac3cdddbc7fa9f1fecd87c3
5
5
  SHA512:
6
- metadata.gz: 13043c7a48867fa7c6e640e2c599664ca5f4b7b368964593ae468fd49e5758db2bb603ad26e3b98f1c74a092d561ea0fa69273798026e8b75bdcb9249afcf340
7
- data.tar.gz: 0cacad52c7aaff32ca2c7cfeada427743a9ef6a85fe559c86b3ed1527688120918a3a0e159296ef21385137bc8027c5cf4d234ea6049acf6e5e9630cb346c035
6
+ metadata.gz: aa95b84bda5aab79c64b529f7bde85411c0d4652afb6635f55fa5c5fbef96da506ea7874d845fa9612d28c5cb8bfe6ef6c1c9a6218c9df0a164443811338ebe9
7
+ data.tar.gz: f0faf17e26fce6a49ee2da9387818aaa6fc65063738a8074580b6943d28b6c0a8096bad59443e2655316c0363d5a85ded00dbb5332f4806bfdbf4d9d7b2a64c1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
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
+
3
7
  ### [6.9.0] / 2026-10-26
4
8
  * Required HTTParty 0.24.0 or later to exclude versions affected by CVE-2025-68696 (potential SSRF and API key leakage)
5
9
  * Treat 207 Multi-Status responses as successful, so a response that carries partial results is returned instead of raising an error
@@ -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.
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.9.0"
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.9.0
4
+ version: 6.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nylas, Inc.