refactor(cli): send customerId on the card commands - #962
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
|
@greptile review |
|
|
|
||
| const params: Record<string, string | number | undefined> = { | ||
| cardholderId: options.cardholderId, | ||
| customerId: options.customerId, |
There was a problem hiding this comment.
Server rollout breaks commands
If this CLI change is merged or released before the server update, cards list --customer-id sends a query parameter the current server rejects, while cards create --customer-id sends customerId instead of the required cardholderId at line 121. Both commands therefore fail against the current server. Coordinate the server rollout or retain temporary compatibility until server support lands.
Knowledge Base Used:
Prompt To Fix With AI
This is a comment left during a code review.
Path: cli/src/commands/cards.ts
Line: 71
Comment:
**Server rollout breaks commands**
If this CLI change is merged or released before the server update, `cards list --customer-id` sends a query parameter the current server rejects, while `cards create --customer-id` sends `customerId` instead of the required `cardholderId` at line 121. Both commands therefore fail against the current server. Coordinate the server rollout or retain temporary compatibility until server support lands.
**Knowledge Base Used:**
- [Grid command-line client](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/grid-cli.md)
- [Client integration tooling](https://app.greptile.com/lightspark/-/custom-context/knowledge-base/lightsparkdev/grid-api/-/docs/client-integrations.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Jira: ENG-11658 under ENG-11645
What this does
The card endpoints used to call the cardholder
cardholderId. #937 renamed that tocustomerIdacross the spec and the docs.The Grid CLI was not part of that change. It still sends
cardholderIdand still spells the flag--cardholder-id, so the one executable client in this repo speaks a field name the spec no longer documents.This PR brings the CLI in line.
How it works
grid cards list --cardholder-idbecomesgrid cards list --customer-id.grid cards create --cardholder-idbecomesgrid cards create --customer-id.Cardinterface and both request bodies sendcustomerId.Breaking for anyone scripting the CLI. There is no alias, which matches how #937 handled the API itself.
Sequencing
The server has not caught up.
GridListCardsRequestArgsinlist_cards.pydeclarescardholder_idand setsextra="forbid", soGET /cards?customerId=returns a 400 until the server change lands.POST /cardsis the same: the generatedCardCreateRequeststill requirescardholderId.So this should merge with the webdev server change, not ahead of it. Holding it as its own PR keeps that decision separate from the funding-source work.
Tests
cd cli && npm testpasses 80 tests.Why it is its own PR
It was sitting inside #934, which is titled "bind one funding source per card". A breaking flag rename that belongs to a different ticket should not ride along inside that diff, so it was split out.