fix(nextjs): mock removed Narev balance/credit-topup endpoints - #261
Closed
audrzejq wants to merge 1 commit into
Closed
fix(nextjs): mock removed Narev balance/credit-topup endpoints#261audrzejq wants to merge 1 commit into
audrzejq wants to merge 1 commit into
Conversation
fetchPolarUsage, fetchStripeUsage, fetchTopUpConfig, and createCheckout called Narev endpoints (GET /v1/balance, GET/POST /v1/credit) that no longer exist, returning 404s and breaking the billing UI package and chatbot examples. Replace these four nextjs server actions with deterministic, typed mock data instead of calling getNarevClient. createCheckout now safely returns the passed-in successUrl. Public exports and TypeScript contracts are unchanged. Unrelated Narev pricing/reference integrations (createOpenAIWithBilling & friends, fetchModelPricing, createChatRouter) are untouched and still call the live Narev API. - Add packages/nextjs/src/mock-billing-data.ts with shared fixtures. - Rewrite the four colocated Vitest suites to assert on mock result shapes and that getNarevClient is not called. - Update packages/nextjs/README.md and examples/utils/chatbot-minimal/.env.example to drop the now inaccurate NAREV_API_KEY requirement for the mocked billing UI/config calls, while keeping the still-needed model pricing NAREV_API_KEY documented. - Add a patch changeset for @ai-billing/nextjs.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Approve tool call: github__addPullRequestComment
Answer by mentioning me in a reply, e.g. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
|
I can’t inspect the current check results or post the CI-fix status comment in this run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fetchPolarUsage, fetchStripeUsage, fetchTopUpConfig, and createCheckout called Narev endpoints (GET /v1/balance, GET/POST /v1/credit) that no longer exist, returning 404s and breaking the billing UI package and chatbot examples.
Replace these four nextjs server actions with deterministic, typed mock data instead of calling getNarevClient. createCheckout now safely returns the passed-in successUrl. Public exports and TypeScript contracts are unchanged. Unrelated Narev pricing/reference integrations (createOpenAIWithBilling & friends, fetchModelPricing, createChatRouter) are untouched and still call the live Narev API.