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

feat: add client internal query params #349

Merged
merged 7 commits into from
Sep 17, 2024
Merged

Conversation

lihbr
Copy link
Member

@lihbr lihbr commented Aug 23, 2024

Resolves: N/A

Description

This pull request adds support for client internal query parameters for the API to use. For more context, see: https://prismic-team.slack.com/archives/C030DCL4JNR/p1724406092961109

  • x-d is forwarded when process.env.NODE_ENV === "development
  • x-c is forwarded with the attached client version

Checklist

  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

N/A

How to QA 1

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

@lihbr lihbr requested a review from angeloashmore August 23, 2024 13:37
@lihbr
Copy link
Member Author

lihbr commented Sep 4, 2024

Updated as per discussion 👌

src/buildQueryURL.ts Outdated Show resolved Hide resolved
src/buildQueryURL.ts Outdated Show resolved Hide resolved
src/createClient.ts Outdated Show resolved Hide resolved
test/client-buildQueryURL.test.ts Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (b8cf3e5) to head (4ff2bde).
Report is 14 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##            master      #349    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           70        61     -9     
  Lines         2550      1987   -563     
  Branches       516       382   -134     
==========================================
- Hits          2550      1987   -563     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lihbr
Copy link
Member Author

lihbr commented Sep 5, 2024

Refactored as per discussions! (thanks, it's much leaner like this 🙏)

Let me know about it and I'm happy to ship afterward :)

@lihbr lihbr changed the title feat: add client internal headers feat: add client internal params Sep 5, 2024
@lihbr lihbr changed the title feat: add client internal params feat: add client internal query params Sep 5, 2024
Copy link
Member

@angeloashmore angeloashmore left a comment

Choose a reason for hiding this comment

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

Looks good to me! I left two small suggestions, but feel free to merge with or without them. 🙂

test/buildQueryURL.test.ts Outdated Show resolved Hide resolved
test/client-buildQueryURL.test.ts Outdated Show resolved Hide resolved
lihbr and others added 2 commits September 17, 2024 08:49
@lihbr
Copy link
Member Author

lihbr commented Sep 17, 2024

Thanks, let's release that!

@lihbr lihbr merged commit 938d711 into master Sep 17, 2024
13 checks passed
@lihbr lihbr deleted the lh/client-internal-headers branch September 17, 2024 08:51
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