Repository navigation
DEV-7993: sync the catalog with the new Partner coupon and tag endpoints - #89
Conversation
…sting endpoints to the catalog Hand-synced from the hub Bruno collection (server#9869, server#9870); skill data resynced; partner namespace methods, tests and CHANGELOG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gv4JfVvyLFoFkYeLX9fAue
per_page on the four partner lists; end-date, single-best-coupon and free-price rules on create/update; tags can only be removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gv4JfVvyLFoFkYeLX9fAue
xyte-genie
left a comment
There was a problem hiding this comment.
AI: Adds the nine new Partner API calls for customer tags, coupons and store listings to the CLI, so scripts and AI agents can list customers, tag them, and manage coupons. Everything is additive; no existing call changes. It must not be published until the hub side is live in production.
reviewed@404b655317bb284db5d391a261d6919eaa1205c9
|
AI: Review lenses for 404b655
|
…se-insensitive notes, hub-release caveat Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gv4JfVvyLFoFkYeLX9fAue
…mns, catalog-wide bodyExample and path param check Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gv4JfVvyLFoFkYeLX9fAue
|
AI: Ready for review — the NC-Reviewer round is answered: 13 findings (all Low) and 3 decision threads. Fixed (11):
Not changed (2):
Decisions to weigh (3):
UI: no UI changes. Checks at dfc4cbf: npm test 1293 passed, typecheck clean, lint 0 errors. Do not merge or publish before server#9870 is deployed. |
There was a problem hiding this comment.
🔵 Needs a closer look
The referenced private hub PR returned 404, so a maintainer must confirm endpoint contract parity and the required production rollout before publication.
No open issues 🎉
What changed in this PR
Extends the CLI’s catalog and Partner client namespace with nine Hub endpoints for coupons, organization tags, organization discovery, and store listings, without adding new commands or flows.
Changes:
- Adds endpoint definitions, pagination parameters, and API usage notes.
- Updates client methods, types, bundled skill data, and documentation.
- Adds tests for endpoint contracts, namespace mappings, utility columns, and tag-removal URL rendering.
Publication must wait until Hub serves these endpoints in production.
| File | Description |
|---|---|
tests/namespaces.test.ts |
Verifies all nine Partner method mappings. |
tests/endpoints.test.ts |
Checks endpoint contracts, utility columns, and catalog integrity. |
tests/auth-and-client.test.ts |
Tests tag-removal URL construction and encoding. |
src/types/client.ts |
Declares the nine new Partner methods. |
src/client/namespaces/partner.ts |
Connects Partner methods to catalog keys. |
src/api-catalog/public-endpoints.json |
Adds endpoint definitions and usage constraints. |
skills/xyte-cli/references/endpoints.md |
Documents endpoint keys, pagination, and coupon creation. |
skills/xyte-cli/data/public-endpoints.json |
Mirrors the catalog in the shipped skill bundle. |
CHANGELOG.md |
Records the additions and Hub release dependency. |
Review effort: Balanced
borisd
left a comment
There was a problem hiding this comment.
AI: Changes requested.
- [Mid]
src/api-catalog/public-endpoints.json:1522— The updateCoupon notes were synced from hub5f55f31; server#9870 is now atd2a420dand added two rules agents need: changingdiscount_typeclears the other type's fields, and sendingcurrencywithoutamount_offkeeps the number and changes the currency (5 USD → 5 JPY). Please resync fromd2a420d(also picks up:organizations_countcounts only partner-visible orgs;coupons_removedis empty when the org isn'tstore_visible).
updateCoupon: currency-only change keeps the number; switching discount_type clears the other type's fields. getOrganizationTags: organizations_count is partner-visible orgs only. removeOrganizationTag: coupons_removed semantics. createCoupon example ends_at follows the last-millisecond rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gv4JfW87YbhDBAUKwKPuoY
|
AI: [Mid] updateCoupon resync — done in ce5d1c2, synced from hub server#9870 head (dae40bd, same Partner docs as d2a420d): currency without amount_off keeps the number (5 USD → 5 JPY), a discount_type switch clears the other type's fields, organizations_count is partner-visible orgs only, coupons_removed is empty when the org is not store_visible. Also moved the createCoupon example ends_at to the last-millisecond form hub now uses. |
AI: All items addressed and replied to; re-requesting review.
Linear: DEV-7993
What
Adds the nine new hub Partner API endpoints to the CLI catalog, hand-synced from the hub Bruno collection on the DEV-7991 branch (xyte-io/server#9869, xyte-io/server#9870):
partner.organizations.getOrganizationsGET /core/v1/partner/organizations(name,tag,page)partner.organizationTags.addOrganizationTagPOST /core/v1/partner/organizations/:organization_id/tagspartner.organizationTags.removeOrganizationTagDELETE /core/v1/partner/organizations/:organization_id/tags/:tag_idpartner.organizationTags.getOrganizationTagsGET /core/v1/partner/organization_tags(page)partner.coupons.createCouponPOST /core/v1/partner/couponspartner.coupons.getCouponsGET /core/v1/partner/coupons(page)partner.coupons.updateCouponPATCH /core/v1/partner/coupons/:idpartner.coupons.deleteCouponDELETE /core/v1/partner/coupons/:idpartner.storeListings.getStoreListingsGET /core/v1/partner/store_listings(page)npm run skills:syncrun;skills/xyte-cli/data/public-endpoints.jsonis byte-identical.partnerclient namespace gets the nine methods (CLAUDE.md "client namespace").origin/main: 0 changed, 9 added).api callenvelopeguard.allowWrite, utility action catalog).Do not publish before hub serves these endpoints in production.
Resync with the final hub branch (404b655)
Resynced from hub
dev-7991head5f55f31367(server#9870):per_page(1-500, default 500, 422 otherwise) added togetOrganizations,getOrganizationTags,getCoupons,getStoreListings.namefilter for finding a customer, tags cannot be deleted (only removed), the end-of-day rule forends_at, the free-price rule, create the coupon before adding the tag, a tag added with an API key shows no "added by" person.skills:syncrun again; the skills copy is byte-identical.Tests
tests/endpoints.test.tschecks each of the nine (method, path, path/query params, auth scope, body type) and that exactly the five writes are utility write actions;tests/namespaces.test.tschecks the nine namespace methods.npm run typecheck,npm run lint(0 errors, same 193 existing warnings),npm test(1290 passed, 2 skipped),npm run build: all green, re-run after the 404b655 resync (tests/endpoints.test.tsnow expectsper_pageon the four lists).getCoupons(empty) →createCoupon→getCouponsshows it;getStoreListings,addOrganizationTag,getOrganizationTags,getOrganizationswithtagfilter,updateCoupon(inactive),deleteCoupon(204),removeOrganizationTagall returned the documented shapes.Decided for you
organizationTags,coupons,storeListings(from the Bruno folders) instead of shortertags/store: they match hub's names.:id,:organization_id,:tag_id), although hub's route names the tag param:id: same URL, and the ticket asks for Bruno parity.sourceFileis the plain hub Bruno path, not a GitHub URL: xyte-io/server is private and the catalog ships in the public package; a dev.xyte.io page does not exist yet. Notes say "dev.xyte.io page pending". Swap to the docs URL once the partner docs publish it.per_pagelimits, dates, the free-price rule, used coupon cannot be deleted).bodyExamplestays faithful to hub, even though itsends_at(Apr 1 00:00Z) does not follow the new end-of-day rule. That is reported to hub, not changed here.bodyExampleplaceholders (....-c3) kept verbatim; the skill doc example uses a code-based coupon so it works without ids.Notes
deleteCoupon/removeOrganizationTagcan return 404 after the first attempt succeeded. Existing behaviour for all DELETEs; not changed here.🤖 Generated with Claude Code
https://claude.ai/code/session_01Gv4JfVvyLFoFkYeLX9fAue