Skip to content

[66695] Refactor Restfulmodel#267

Merged
mrashed-dev merged 5 commits into
mostafarashed/ch66699/release-node-sdk-v6-0-0from
mostafarashed/ch66695/refactor-restfulmodel
Sep 3, 2021
Merged

[66695] Refactor Restfulmodel#267
mrashed-dev merged 5 commits into
mostafarashed/ch66699/release-node-sdk-v6-0-0from
mostafarashed/ch66695/refactor-restfulmodel

Conversation

@mrashed-dev
Copy link
Copy Markdown
Contributor

Description

As the SDK coverage grows, we need to decouple the standard functionality of a model from the specific functionality/structure of a "classic" Nylas API model. A "classic" Nylas API model is a model used for endpoints like Event, Calendar, Message, etc. where we expect the object to have an id, account_id, and object field. There are a lot of "dumb" models like Contact.Emails that would benefit from being cast as a basic model versus the current RestfulModel, as well as having the ability in the future for creating different types of models.

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.

Created two new "base" classes called `model` and `model-collection`. These two classes provide a way for creating models that are not the typical Nylas API models (Event, Calendar, etc.) but will still require similar functionality. Also not all models are "RESTful", `Contact.Email` for example does not.
@shortcut-integration
Copy link
Copy Markdown

This pull request has been linked to Clubhouse Story #66695: Refactor RestfulModel.

Comment thread src/models/attributes.ts
Comment thread src/models/model-collection.ts Outdated
Comment thread src/models/model.ts
Comment thread src/models/model.ts
Comment thread src/models/model.ts
Instead of `_[name]` notation
@mrashed-dev mrashed-dev merged commit 0edbc49 into mostafarashed/ch66699/release-node-sdk-v6-0-0 Sep 3, 2021
@mrashed-dev mrashed-dev deleted the mostafarashed/ch66695/refactor-restfulmodel branch September 3, 2021 14:15
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.

3 participants