Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major Refactor and API v3 base implementation #418

Merged

Conversation

agtang96
Copy link
Contributor

@agtang96 agtang96 commented May 31, 2023

Tickets Addressed

https://nylas.atlassian.net/browse/AV-1596
https://nylas.atlassian.net/browse/AV-1597
https://nylas.atlassian.net/browse/AV-1584
https://nylas.atlassian.net/browse/AV-1585
https://nylas.atlassian.net/browse/AV-1585
https://nylas.atlassian.net/browse/AV-1586
https://nylas.atlassian.net/browse/AV-1587
https://nylas.atlassian.net/browse/AV-1588
https://nylas.atlassian.net/browse/AV-1589
https://nylas.atlassian.net/browse/AV-1590
https://nylas.atlassian.net/browse/AV-1591
https://nylas.atlassian.net/browse/AV-1592
https://nylas.atlassian.net/browse/AV-1594
https://nylas.atlassian.net/browse/AV-1469
https://nylas.atlassian.net/browse/AV-1470
https://nylas.atlassian.net/browse/AV-1471
https://nylas.atlassian.net/browse/AV-1473
https://nylas.atlassian.net/browse/AV-1474
https://nylas.atlassian.net/browse/AV-1475
https://nylas.atlassian.net/browse/AV-1476
https://nylas.atlassian.net/browse/AV-1478
https://nylas.atlassian.net/browse/AV-1578
https://nylas.atlassian.net/browse/AV-1579
https://nylas.atlassian.net/browse/AV-1580
https://nylas.atlassian.net/browse/AV-1582
https://nylas.atlassian.net/browse/AV-1583
https://nylas.atlassian.net/browse/AV-1593

Description

This PR refactors the Ruby SDK to make it more intuitive and implements everything needed to make calls to API v3, including CRUD for auth, calendars, events, and webhooks.

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

@mrashed-dev mrashed-dev self-requested a review May 31, 2023 18:00

def create(query_params: {}, request_body: nil)
post(
"#{host}/grants/#{path_params[:grant_id]}/#{resource_name}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is path_params set?

def hosted_auth(payload)
check_auth_credentials

credentials = "#{@api_client.client_id}:#{@api_client.client_secret}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is @api_client set?

get(
"#{host}/connect/providers/find",
query_params: { client_id: client_id },
api_key: api_key
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no api_key param defined it seems

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@mrashed-dev mrashed-dev changed the title Av 1475 implement new resources instead of collections Major Refactor and API v3 base implementation May 31, 2023
@mrashed-dev mrashed-dev merged commit 6ca084f into v3-skeleton May 31, 2023
@mrashed-dev mrashed-dev deleted the AV-1475-implement-new-resources-instead-of-collections branch May 31, 2023 20:21
mrashed-dev added a commit that referenced this pull request Feb 5, 2024
# Description
This PR is a culmination of all the PRs that contained v6-related development, with formal support for the Nylas API v3. This release is essentially the same as the v6.0.0.beta.4 release found on rubygems. Please refer to the readme for a quick start guide on using the new SDK, as well as links to the upgrade doc as well as the SDK reference docs.

# Changelog
* **BREAKING CHANGE**: Ruby SDK v6 supports the Nylas API v3 exclusively, dropping support for any endpoints that are not available in v3.
* **BREAKING CHANGE**: Officially support minimum Ruby v3
* **BREAKING CHANGE**: Removed all models and typing from the SDK
* **REMOVED**: Local Webhook development support is removed due to incompatibility
* Rewrote the majority of SDK to be more modular and efficient
* Created error classes for the different API errors as well as SDK-specific errors
* Added a configurable timeout for outgoing calls to the API

========================================================================================

* Major Refactor and API v3 base implementation (#418)

* AV-1468 Purge collections and models

* new design

* FIRST WORKING API CALL!!!

* update

* quik cfix

* testing file

* refactor http handling for resources

* node sdk parity

* refactor

* refactor

* application + redirect_uris

* scopes

* fix

* more fix

* fixes

* more fix

---------

Co-authored-by: Mostafa Rashed <17770919+mrashed-dev@users.noreply.github.com>

* Generate SDK references github action (#423)

* v3 Polish: Cleanup & documentation (#420)

This PR:

* adds Yard documentation
* cleans up typos and just code tidy
* Update dependencies and gemspec
* Update readme
* Repo cleanup
* Bug fixes

* v6.0.0.beta.1 Release (#425)

This PR is for releasing the first beta of v6 on RubyGems.

* Add better documentation, more errors, default timeout (#426)

This PR adds an upgrade doc, updates the readme, adds more error classes and a default timeout.

Co-authored-by: Lrubin <Lrubin@nylas.com>

* Add support for free-busy endpoint (#428)

* Add support for read, update, and delete for messages (#429)

* Update README for Hacktoberfest (#427)

add blurb on hacktoberfest guidelines

* Fix Rubocop complains

None of them related to my code, but everything is fixed and tested

* Remove hackathon blurb

---------

Co-authored-by: Mostafa Rashed <17770919+mrashed-dev@users.noreply.github.com>

* Add support for custom authentication, connectors, and credentials APIs (#431)

Adds support for custom authentication, the connectors API and the credentials API.

* Add Folders API support (#433)

This PR adds support for the Folders API

* Ruby SDK Messages, Threads, Drafts, and Send support (#432)

This PR adds support to messages, threads, drafts, and send.

* Ruby Attachments API support (#434)

This PR adds support for the Attachments API

* v6.0.0 beta 2 release (#436)

* Added additional error classes (#426)
* Added support for free/busy endpoint (#428)
* Added support for Messages, Drafts, and Smart Compose APIs (#432)
* Added support for custom authentication, connectors, and credentials APIs (#431)
* Added support for folders API (#433)
* Added support for attachments API (#434)
* Set default timeout to 30 seconds (#426)

* Fixed issue when sending message without attachments (#437)

This PR fixes a bug that arises when sending messages and creating or modifying drafts without any attachments present.

* Fix free-busy endpoint (#440)

The endpoint for free-busy was "availability" when it should be "free-busy"

* Add support for contacts API (#438)

This PR adds support for the contacts API.

* Update drafts.rb to include send

Adding "send" to the drafts endpoint

* Add missing webhooks (#445)

Added webhook triggers for:

* Message Opened
* Message Link Clicked
* Thread Replied

* Fix doc lines

* Added send-rsvp support for events api (#444)

Added send-rsvp support for events api

* Move `Grants` to `NylasClient` and custom authentication to `Auth` (#447)

* Move grants out of auth

* move grant create to custom auth

* Update CHANGELOG.md

* Fix OAuth URL building throwing an error (#449)

There is a syntax error when calling build_query.

* v6.0.0 beta 3 Release (#450)

* Update CHANGELOG.md

* linting

* bump ver

* Update CHANGELOG.md

* Fix List and Find Scheduled Messages (#451)

List and Find Scheduled messages are mixed up

* Fix incorrect PKCE code challenge generation (#452)

This PR fixes the PKCE code challenge generation; the correct method the API wants is for us to base64 encode the hex string as opposed to base64 encoding resulting hashed bytearray directly.

* Fixed incompatible types when building OAuth2 URL (#453)

We were encoding our URL prematurely, causing an error to be thrown when setting additional parameters (PKCE, etc.)

* Update contact_groups to list_groups (#455)

* Update connectors.rb (#454)

* Added v6 beta tests and fixes (#458)

Increase code coverage to ~100%. Fixes were also completed:
* **BREAKING CHANGE**: Renamed `Applications.info()` to `Applications.get_details()` for consistency
* **BREAKING CHANGE**: Changed return type of `Auth.url_for_oauth2_pkce()` from `OpenStruct` to a hash for consistency
* Added support for detecting providers
* Added enhanced support for the `Webhooks` API
* Default `client_secret` to the configured `api_key` for token exchange methods if not provided
* Fixed construction of query parameters
* Fixed construction of OAuth2 URL
* Fixed typo in paths for `Grants` class

* v6.0.0 beta 4 release (#459)

# Changelog
* **BREAKING CHANGE**: Renamed `Applications.info()` to `Applications.get_details()` for consistency
* **BREAKING CHANGE**: Changed return type of `Auth.url_for_oauth2_pkce()` from `OpenStruct` to a hash for consistency
* Added support for detecting providers
* Added enhanced support for the `Webhooks` API
* Default `client_secret` to the configured `api_key` for token exchange methods if not provided
* Fixed list and find scheduled messages
* Fixed incorrect PKCE code challenge generation
* Fixed incompatible types when building OAuth2 URL
* Fixed construction of query parameters
* Fixed construction of OAuth2 URL
* Fixed typo in paths for `Grants` class

* Update CHANGELOG.md

* remove unneded changes from v5

* cleanup references to beta

* add xml for simplecov for codecov support

---------

Co-authored-by: Albert T <agtang96@gmail.com>
Co-authored-by: Aaron de Mello <314152+AaronDDM@users.noreply.github.com>
Co-authored-by: Lrubin <Lrubin@nylas.com>
Co-authored-by: Blag <atejada@gmail.com>
Co-authored-by: YIFAN WU <14408339+yifanplanet@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants