Skip to content

Commit

Permalink
Merge pull request #2 from Kajabi/update_nylas_namespace_v5.14
Browse files Browse the repository at this point in the history
nylas -> nylas_v2
  • Loading branch information
andrewdally authored May 28, 2024
2 parents b3b7a04 + 1d9359c commit 2a91764
Show file tree
Hide file tree
Showing 162 changed files with 646 additions and 648 deletions.
6 changes: 3 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ Metrics/BlockLength:
Metrics/ParameterLists:
Max: 8
Exclude:
- "lib/nylas/calendar_collection.rb"
- "lib/nylas_v2/calendar_collection.rb"

Metrics/MethodLength:
Exclude:
- "lib/nylas/calendar_collection.rb"
- "lib/nylas_v2/calendar_collection.rb"

Metrics/ModuleLength:
Exclude:
- "lib/nylas/model.rb"
- "lib/nylas_v2/model.rb"

Naming/FileName:
Exclude:
Expand Down
34 changes: 17 additions & 17 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ Gemspec/RequiredRubyVersion:
# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
Layout/EmptyLineBetweenDefs:
Exclude:
- 'lib/nylas/errors.rb'
- 'lib/nylas_v2/errors.rb'

# Offense count: 1
# Configuration parameters: AllowComments, AllowNil.
Lint/SuppressedException:
Exclude:
- 'lib/nylas/logging.rb'
- 'lib/nylas_v2/logging.rb'

# Offense count: 1
# Configuration parameters: IgnoredMethods.
Expand All @@ -42,68 +42,68 @@ Metrics/MethodLength:
# Configuration parameters: AllowConsecutiveOneLiners.
RSpec/EmptyLineAfterExample:
Exclude:
- 'spec/nylas/message_spec.rb'
- 'spec/nylas_v2/message_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: CustomTransform, IgnoredWords.
RSpec/ExampleWording:
Exclude:
- 'spec/nylas/http_client_spec.rb'
- 'spec/nylas_v2/http_client_spec.rb'

# Offense count: 8
RSpec/StubbedMock:
Exclude:
- 'spec/nylas/native_authentication_spec.rb'
- 'spec/nylas_v2/native_authentication_spec.rb'

# Offense count: 6
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: separated, grouped
Style/AccessorGrouping:
Exclude:
- 'lib/nylas/errors.rb'
- 'lib/nylas/http_client.rb'
- 'lib/nylas_v2/errors.rb'
- 'lib/nylas_v2/http_client.rb'

# Offense count: 1
# Configuration parameters: AllowedConstants.
Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'lib/nylas/http_client.rb'
- 'lib/nylas/when.rb'
- 'lib/nylas_v2/http_client.rb'
- 'lib/nylas_v2/when.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/ExplicitBlockArgument:
Exclude:
- 'lib/nylas/collection.rb'
- 'lib/nylas_v2/collection.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/GlobalStdStream:
Exclude:
- 'lib/nylas/logging.rb'
- 'lib/nylas_v2/logging.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/IfUnlessModifier:
Exclude:
- 'lib/nylas/model/attributable.rb'
- 'lib/nylas_v2/model/attributable.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/KeywordParametersOrder:
Exclude:
- 'lib/nylas/http_client.rb'
- 'lib/nylas/model.rb'
- 'lib/nylas_v2/http_client.rb'
- 'lib/nylas_v2/model.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantAssignment:
Exclude:
- 'lib/nylas/model.rb'
- 'lib/nylas_v2/model.rb'

# Offense count: 1
# Cop supports --auto-correct.
Expand All @@ -115,10 +115,10 @@ Style/RedundantBegin:
# Cop supports --auto-correct.
Style/RedundantSelf:
Exclude:
- 'lib/nylas/message.rb'
- 'lib/nylas_v2/message.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/StringConcatenation:
Exclude:
- 'spec/nylas/model_spec.rb'
- 'spec/nylas_v2/model_spec.rb'
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby 3.0.6
33 changes: 16 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
### 5.3.0 / 2021-08-18
* Add support for Neural API
* Fix issue where `Delta` did not have a header attribute for expanded headers
* Fix ArgumentError when calling `Nylas::API#send!` due to missing double splat (**)
* Fix ArgumentError when calling `NylasV2::API#send!` due to missing double splat (**)
* Fix issue where server errors are not reported if HTML is returned
* Fix issue where expanded `Thread` objects were not returning messages

Expand Down Expand Up @@ -160,10 +160,10 @@
### 4.6.0 / 2019-09-25

* Add support for `/contacts/groups` endpoint.
* Fix issue when calling `.save` on `message` (https://github.com/nylas/nylas-ruby/pull/233)
* Fix issue when calling `.save` on `message` (https://github.com/nylas_v2/nylas-ruby/pull/233)
* Add support for Rails 6.
* Fix issue for updating `message` with sending `label_ids` (https://github.com/nylas/nylas-ruby/pull/231)
* Support for `when` in `Nylas::Event` for more attributes.
* Fix issue for updating `message` with sending `label_ids` (https://github.com/nylas_v2/nylas-ruby/pull/231)
* Support for `when` in `NylasV2::Event` for more attributes.
* Add internal transfer api to support initialize related objects.
* Fix encoding issues when downloading attachments.

Expand All @@ -183,14 +183,14 @@

* Drop support for Ruby 2.2 and 2.3: they have reached end-of-life
* Add support for Ruby 2.5 and 2.6
* Add `scopes` argument to `Nylas::API#authenticate` for
* Add `scopes` argument to `NylasV2::API#authenticate` for
[selective sync](https://docs.nylas.com/docs/how-to-use-selective-sync)
* Add `Account#revoke_all`
* Add X-Nylas-Client-Id header for HTTP requests

### 4.2.4 / 2018-08-07
* Enables silent addition of fields to API without impact to SDK
* Fixes api attribute breakage on enumeration (https://github.com/nylas/nylas-ruby/issues/188)
* Fixes api attribute breakage on enumeration (https://github.com/nylas_v2/nylas-ruby/issues/188)

### 4.0.0 / 2018-01-??
* Drop support for ruby 2.0 and below
Expand All @@ -206,7 +206,7 @@
* Numerous other bug fixes

### 3.1.1 / 2017-06-23
* Fix deleting event request (https://github.com/nylas/nylas-ruby/issues/101)
* Fix deleting event request (https://github.com/nylas_v2/nylas-ruby/issues/101)

### 3.1.0 / 2017-05-10
* Adds support for message tracking (https://github.com/cberkom)
Expand All @@ -219,43 +219,43 @@
* Add webhooks example code
* Removes experimental JRuby support

[full changelog](https://github.com/nylas/nylas-ruby/compare/v2.0.1...v3.0.0)
[full changelog](https://github.com/nylas_v2/nylas-ruby/compare/v2.0.1...v3.0.0)

### 2.0.1 / 2016-02-12

* Fix folders and labels updates for threads and messages
* Revert pull request #71

[full changelog](https://github.com/nylas/nylas-ruby/compare/v2.0.0...v2.0.1)
[full changelog](https://github.com/nylas_v2/nylas-ruby/compare/v2.0.0...v2.0.1)

### 2.0.0 / 2016-02-05

* Remove get_cursor method that calls deprecated generate_cursor endpoint
* 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
* `url_for_authentication` now accepts a `:state` parameter (see https://nylas.com/docs#server_side_explicit_flow for more details)

[full changelog](https://github.com/nylas/nylas-ruby/compare/v1.3.0...v2.0.0)
[full changelog](https://github.com/nylas_v2/nylas-ruby/compare/v1.3.0...v2.0.0)

### 1.3.0 / 2015-12-07

* Deprecate the tags API
* Remove the archive!/unarchive! methods
* Expose `starred`, `unread`, `has_attachments` in Nylas::Thread
* Expose `starred`, `unread`, `has_attachments` in NylasV2::Thread

[full changelog](https://github.com/nylas/nylas-ruby/compare/v1.2.1...v1.3.0)
[full changelog](https://github.com/nylas_v2/nylas-ruby/compare/v1.2.1...v1.3.0)

### 1.2.0 / 2015-11-19

* Add `Messages#files?` [Issue #40](https://github.com/nylas/nylas-ruby/issues/40)
* Return an external Enumerator when no block given. [Issue #42](https://github.com/nylas/nylas-ruby/issues/42) ([Steven Harman](https://github.com/stevenharman))
* Add `Messages#files?` [Issue #40](https://github.com/nylas_v2/nylas-ruby/issues/40)
* Return an external Enumerator when no block given. [Issue #42](https://github.com/nylas_v2/nylas-ruby/issues/42) ([Steven Harman](https://github.com/stevenharman))
* Expose `folders` in the Delta Stream API.
* Add `Inbox::Error` base class for all errors. ([Steven Harman](https://github.com/stevenharman))
* Expose `sync_state` on the `/account` API. ([Steven Harman](https://github.com/stevenharman))
* Return Enumerator for #deltas when no block given
* Ruby < 1.9.3 no longer supported
* Add travis support for Mac OS X

[full changelog](https://github.com/nylas/nylas-ruby/compare/v1.1.0...v1.2.0)
[full changelog](https://github.com/nylas_v2/nylas-ruby/compare/v1.1.0...v1.2.0)


### 1.1.0 / 2015-09-22
Expand All @@ -265,5 +265,4 @@
* minor bug fixes
* various test cleanups ([Steven Harman](https://github.com/stevenharman))

[full changelog](https://github.com/nylas/nylas-ruby/compare/v1.0.0...v1.1.0)

[full changelog](https://github.com/nylas_v2/nylas-ruby/compare/v1.0.0...v1.1.0)
10 changes: 5 additions & 5 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ The following is a set of guidelines for contributing to the Nylas Ruby SDK; the

# How to Ask a Question

If you have a question about how to use the Ruby SDK, please [create an issue](https://github.com/nylas/nylas-ruby/issues) and label it as a question. If you have more general questions about the Nylas Communications Platform, or the Nylas Email, Calendar, and Contacts API, please reach out to [email protected] to get help.
If you have a question about how to use the Ruby SDK, please [create an issue](https://github.com/nylas_v2/nylas-ruby/issues) and label it as a question. If you have more general questions about the Nylas Communications Platform, or the Nylas Email, Calendar, and Contacts API, please reach out to [email protected] to get help.

# How To Contribute
## Report a Bug or Request a Feature

If you encounter any bugs while using this software, or want to request a new feature or enhancement, please [create an issue to report it](https://github.com/nylas/nylas-ruby/issues), and make sure you add a label to indicate what type of issue it is.
If you encounter any bugs while using this software, or want to request a new feature or enhancement, please [create an issue to report it](https://github.com/nylas_v2/nylas-ruby/issues), and make sure you add a label to indicate what type of issue it is.

## Contribute Code

Pull requests are welcome for bug fixes. If you want to implement something new, [please request a feature first so we can discuss it](https://github.com/nylas/nylas-ruby/issues).
Pull requests are welcome for bug fixes. If you want to implement something new, [please request a feature first so we can discuss it](https://github.com/nylas_v2/nylas-ruby/issues).

While writing your code contribution, make sure you follow the testing conventions found in the [spec](https://github.com/nylas/nylas-ruby/tree/master/spec/nylas) [directory](https://github.com/nylas/nylas-ruby/tree/master/spec/nylas) for any components that you add.
While writing your code contribution, make sure you follow the testing conventions found in the [spec](https://github.com/nylas_v2/nylas-ruby/tree/master/spec/nylas) [directory](https://github.com/nylas_v2/nylas-ruby/tree/master/spec/nylas) for any components that you add.

- Pull requests may be submitted before they are feature complete to get feedback and thoughts from the core team.
- Pull requests should pass tests across the supported versions of Ruby, as defined in .travis.yml. To do so, run bin/test.
Expand All @@ -26,4 +26,4 @@ While writing your code contribution, make sure you follow the testing conventio

Before you submit any code, we need you to sign our [Contributor License Agreement](https://docs.google.com/forms/d/e/1FAIpQLSdCnXWsaTkw5jhJ8DMtMu5TUI9Q-El_rCuGzkdBvnNJr8oDWQ/viewform); this ensures we can continue to protect your contributions under an open source license well into the future.

Please follow [best practices](https://github.com/trein/dev-best-practices/wiki/Git-Commit-Best-Practices) for creating git commits. When your code is ready to be submitted, you can [submit a pull request](https://help.github.com/articles/creating-a-pull-request/) to begin the code review process.
Please follow [best practices](https://github.com/trein/dev-best-practices/wiki/Git-Commit-Best-Practices) for creating git commits. When your code is ready to be submitted, you can [submit a pull request](https://help.github.com/articles/creating-a-pull-request/) to begin the code review process.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

source "https://rubygems.org"

gemspec name: "nylas"
gemspec name: "nylas_v2"
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

# Nylas Ruby SDK

[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/nylas/nylas-ruby/CI)](https://github.com/nylas/nylas-ruby/actions/workflows/rspec.yml)
[![codecov](https://codecov.io/gh/nylas/nylas-ruby/branch/main/graph/badge.svg?token=IKH0YMH4KA)](https://codecov.io/gh/nylas/nylas-ruby)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/nylas_v2/nylas-ruby/CI)](https://github.com/nylas_v2/nylas-ruby/actions/workflows/rspec.yml)
[![codecov](https://codecov.io/gh/nylas_v2/nylas-ruby/branch/main/graph/badge.svg?token=IKH0YMH4KA)](https://codecov.io/gh/nylas_v2/nylas-ruby)

The Nylas Communications Platform allows developers to quickly build features that connect to every inbox, calendar, and contacts book in the world. Nylas makes it easy to build an integration that can be completed in days, and provides pre-built security and compliance features, and a 99.9% guaranteed uptime. Integrations with the Nylas Communications Platform are secure, reliable, and easy to use and maintain.

Expand All @@ -27,7 +27,7 @@ If you have a question that needs an answer, please reach out to [email protected]
- Ruby 2.3 or above.
- Ruby Frameworks: `rest-client`, `json`, `yajl-ruby`.

We support Rails 4.2 and above. A more detailed compatibility list can be found in our [list of Gemfiles](https://github.com/nylas/nylas-ruby/tree/master/gemfiles).
We support Rails 4.2 and above. A more detailed compatibility list can be found in our [list of Gemfiles](https://github.com/nylas_v2/nylas-ruby/tree/master/gemfiles).

### Install

Expand All @@ -52,7 +52,7 @@ gem install nylas
To install the SDK from source, clone this repo and install with bundle.

```bash
git clone https://github.com/nylas/nylas-ruby.git && cd nylas-ruby
git clone https://github.com/nylas_v2/nylas-ruby.git && cd nylas-ruby
bundle install
```

Expand All @@ -76,7 +76,7 @@ You can run tests locally using ```rspec```:
```shell
rspec spec
```

### MacOS 10.11 (El Capitan) Note

Apple stopped bundling OpenSSL with MacOS 10.11. However, one of the dependencies of this gem (EventMachine) requires it. If you're on El Capitan and are unable to install the gem, try running the following commands in a terminal:
Expand All @@ -99,7 +99,7 @@ All of the functionality of the Nylas Communications Platform is available throu
```ruby
require 'nylas'

nylas = Nylas::API.new(
nylas = NylasV2::API.new(
app_id: CLIENT_ID,
app_secret: CLIENT_SECRET,
access_token: ACCESS_TOKEN
Expand All @@ -122,4 +122,4 @@ Please refer to [Contributing](Contributing.md) for information about how to mak

## 📝 License

This project is licensed under the terms of the MIT license. Please refer to [LICENSE](LICENSE.txt) for the full terms.
This project is licensed under the terms of the MIT license. Please refer to [LICENSE](LICENSE.txt) for the full terms.
2 changes: 1 addition & 1 deletion bin/release
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

bin/test
SDK_VERSION=`ruby -e "require './lib/nylas/version' ; puts Nylas::VERSION"`
SDK_VERSION=`ruby -e "require './lib/nylas_v2/version' ; puts NylasV2::VERSION"`
echo "Going to release version $SDK_VERSION of the SDK!"

gem build nylas.gemspec
Expand Down
2 changes: 1 addition & 1 deletion examples/authentication/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
send(method, "/auth/:provider/callback") do
auth_hash = env['omniauth.auth'] # => OmniAuth::AuthHash

api = Nylas::API.new(app_id: ENV['NYLAS_APP_ID'], app_secret: ENV['NYLAS_APP_SECRET'])
api = NylasV2::API.new(app_id: ENV['NYLAS_APP_ID'], app_secret: ENV['NYLAS_APP_SECRET'])
nylas_token = api.authenticate(name: auth_hash[:info][:name], email_address: auth_hash[:info][:email],
provider: :gmail,
settings: { google_client_id: ENV['GOOGLE_CLIENT_ID'],
Expand Down
2 changes: 1 addition & 1 deletion examples/listening-for-webhooks/demo-app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
json = request.body.read
logger.info ["json", json]
data = JSON.parse(json, symbolize_names: true)
deltas = Nylas::Deltas.new(**data)
deltas = NylasV2::Deltas.new(**data)
deltas.map do |delta|
logger.info ["delta", delta.to_h]
logger.info ["instance", delta.instance.class, delta.instance.to_h]
Expand Down
2 changes: 1 addition & 1 deletion examples/plain-ruby/accounts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# An executable specification that demonstrates how to use the Nylas Ruby SDK to interact with the API. It
# follows the rough structure of the [Nylas API Reference](https://docs.nylas.com/reference).
api = Nylas::API.new(app_id: ENV['NYLAS_APP_ID'], app_secret: ENV['NYLAS_APP_SECRET'],
api = NylasV2::API.new(app_id: ENV['NYLAS_APP_ID'], app_secret: ENV['NYLAS_APP_SECRET'],
access_token: ENV['NYLAS_ACCESS_TOKEN'])

# Retrieving the account information for given access token
Expand Down
2 changes: 1 addition & 1 deletion examples/plain-ruby/calendars.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# An executable specification that demonstrates how to use the Nylas Ruby SDK to interact with the Nylas
# Calendar API.
# See https://docs.nylas.com/reference#calendars
api = Nylas::API.new(app_id: ENV['NYLAS_APP_ID'], app_secret: ENV['NYLAS_APP_SECRET'],
api = NylasV2::API.new(app_id: ENV['NYLAS_APP_ID'], app_secret: ENV['NYLAS_APP_SECRET'],
access_token: ENV['NYLAS_ACCESS_TOKEN'])


Expand Down
4 changes: 2 additions & 2 deletions examples/plain-ruby/components.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# An executable specification that demonstrates how to use the Nylas Ruby SDK to interact with the API. It
# follows the rough structure of the [Nylas API Reference](https://docs.nylas.com/reference).
api = Nylas::API.new(app_id: ENV['NYLAS_APP_ID'], app_secret: ENV['NYLAS_APP_SECRET'])
api = NylasV2::API.new(app_id: ENV['NYLAS_APP_ID'], app_secret: ENV['NYLAS_APP_SECRET'])

# Create a component
# NOTE: you will need to set the account_id and the access_token
Expand All @@ -23,4 +23,4 @@
demonstrate { example_component.name }

# Delete a component
demonstrate { example_component.destroy }
demonstrate { example_component.destroy }
Loading

0 comments on commit 2a91764

Please sign in to comment.