Skip to content

[59076] Add read only fields and enable v2.2 API support#237

Merged
mrashed-dev merged 12 commits intomainfrom
mostafarashed/ch59076/add-read-only-fields-to-node-sdk
Jun 8, 2021
Merged

[59076] Add read only fields and enable v2.2 API support#237
mrashed-dev merged 12 commits intomainfrom
mostafarashed/ch59076/add-read-only-fields-to-node-sdk

Conversation

@mrashed-dev
Copy link
Copy Markdown
Contributor

Description

This PR was spawned by the need to add new read-only fields to the Room Resource object. We did not have support for read-only objects yet in this SDK, so this PR achieves the following:

  • Enabling v2.2 API support
  • Adding read-only field mechanism
  • Add new read-only Room Resource fields

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.

v2.2 just entails adding some extra read-only fields to the room resource object
This attribute is false by default. When invoking `toJSON` for sending a payload to the Nylas API, only the non-readonly attributes will be sent.
@shortcut-integration
Copy link
Copy Markdown

This pull request has been linked to Clubhouse Story #59076: Add read-only fields to Node SDK.

if `enforceReadOnly` is false it should bypass the `Attribute.readOnly` check
We no longer send read only variables such as id, object and account_id in our requests to the API
@mrashed-dev mrashed-dev requested a review from AaronDDM June 7, 2021 22:40
Comment thread src/models/webhook.ts
@mrashed-dev mrashed-dev requested a review from AaronDDM June 8, 2021 16:32
@mrashed-dev mrashed-dev merged commit 65a3a32 into main Jun 8, 2021
@mrashed-dev mrashed-dev deleted the mostafarashed/ch59076/add-read-only-fields-to-node-sdk branch June 8, 2021 16:35
mrashed-dev added a commit that referenced this pull request Jun 9, 2021
New `nylas` v5.5.0 release bringing in the following new features:
* Replaced deprecated `request` library with `node-fetch` (#234)
* Add custom error class `NylasApiError` to add more error details returned from the API (#236)
* Add support for read only fields (#237)
* Enabled Nylas API v2.2 support (#237)

The new release also fixes the following:
* Fix bug where saving a `draft` object with an undefined `filesIds` would throw an error (#230)
* Fix typings for classes that extend `RestfulModelCollection` or `RestfulModelInstance` (#238)
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