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

update response structure to echo schema expected from TS defs and v1 #90

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

courcelan
Copy link
Contributor

This updates the response structure to echo schema expected from TypeScript definitions and the same data schema/structure as return in buttercms-js version 1.

The response no longer returns the xsrfCookieName, xsrfHeaderName, and maxContentLength in response.config as they are not in use by native fetch. Additionally, response.config returns only the fully formed url (response.config.url) rather than breaking it down in discrete parts. If needed, please use the native URL API in your code to get similar datapoints.

This PR fixes the issues raised in #89.

bump package version to 2.1.0

@ViolanteCodes
Copy link
Contributor

ViolanteCodes commented Jul 26, 2024

@courcelan I'm wondering if maybe it would be good to get @zanderle as a second reviewer on this one (since Orly is out?) I'm not the best person to review these SDK changes and this SDK is pretty important.

However, I know that in order to get the autoversionining and CI/CD to deploy, the commit message has to start with fix: or feat: - https://github.com/ButterCMS/buttercms-js/blob/master/CONTRIBUTING.md - can you squash these and change the commit message? That should also fix the failing tests on the first commit since the unit-test fix will be in the same commit as the commit that causes the failure - WDYT?

@courcelan courcelan requested a review from zanderle July 26, 2024 13:13
…and v1

This updates the response structure to echo schema expected from TypeScript definitions and the same data schema/structure as return in buttercms-js version 1.

The response no longer returns the `xsrfCookieName`, `xsrfHeaderName`, and `maxContentLength` in `response.config` as they are not in use by native fetch. Additionally, `response.config` returns  only the fully formed `url` (`response.config.url`) rather than breaking it down in discrete parts. If needed, please use the native `URL` API in your code to get similar datapoints.

This PR fixes the issues raised in #89.

bump package version to 2.1.0
@courcelan courcelan force-pushed the update-response-structure branch from dbb1db2 to 1a748fa Compare July 26, 2024 13:15
@courcelan
Copy link
Contributor Author

squashed with the feat prefix and added @zanderle to review.

Copy link
Contributor

@marcinpece-apptension marcinpece-apptension left a comment

Choose a reason for hiding this comment

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

Copy link

@zanderle zanderle left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@ViolanteCodes ViolanteCodes merged commit 4dc8698 into master Jul 29, 2024
@ViolanteCodes ViolanteCodes deleted the update-response-structure branch July 29, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants