Skip to content

DEV-7993: sync the catalog with the new Partner coupon and tag endpoints - #89

Merged
ariel-greenfeld merged 6 commits into
mainfrom
dev-7993-xyte-cli-sync-the-public-endpoint-catalog-with-the
Nov 23, 2026
Merged

ariel-greenfeld merged 6 commits into
mainfrom
dev-7993-xyte-cli-sync-the-public-endpoint-catalog-with-the

Conversation

@ariel-greenfeld

@ariel-greenfeld ariel-greenfeld commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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):

Key Method + path
partner.organizations.getOrganizations GET /core/v1/partner/organizations (name, tag, page)
partner.organizationTags.addOrganizationTag POST /core/v1/partner/organizations/:organization_id/tags
partner.organizationTags.removeOrganizationTag DELETE /core/v1/partner/organizations/:organization_id/tags/:tag_id
partner.organizationTags.getOrganizationTags GET /core/v1/partner/organization_tags (page)
partner.coupons.createCoupon POST /core/v1/partner/coupons
partner.coupons.getCoupons GET /core/v1/partner/coupons (page)
partner.coupons.updateCoupon PATCH /core/v1/partner/coupons/:id
partner.coupons.deleteCoupon DELETE /core/v1/partner/coupons/:id
partner.storeListings.getStoreListings GET /core/v1/partner/store_listings (page)
  • npm run skills:sync run; skills/xyte-cli/data/public-endpoints.json is byte-identical.
  • partner client namespace gets the nine methods (CLAUDE.md "client namespace").
  • Skill reference lists the keys and has one coupon example; CHANGELOG [Unreleased] entry.
  • No existing endpoint changed (checked by comparing every existing entry with origin/main: 0 changed, 9 added).
  • No new command or flow: the five writes are picked up by the existing method-based write handling (api call envelope guard.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-7991 head 5f55f31367 (server#9870):

  • per_page (1-500, default 500, 422 otherwise) added to getOrganizations, getOrganizationTags, getCoupons, getStoreListings.
  • Notes: the name filter for finding a customer, tags cannot be deleted (only removed), the end-of-day rule for ends_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:sync run again; the skills copy is byte-identical.

Tests

  • New: tests/endpoints.test.ts checks 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.ts checks 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.ts now expects per_page on the four lists).
  • Full loop: built CLI against a local hub on the DEV-7991 branch (own DB clone) with a seeded partner key: getCoupons (empty) → createCoupon → getCoupons shows it; getStoreListings, addOrganizationTag, getOrganizationTags, getOrganizations with tag filter, updateCoupon (inactive), deleteCoupon (204), removeOrganizationTag all returned the documented shapes.

Decided for you

  • Group names organizationTags, coupons, storeListings (from the Bruno folders) instead of shorter tags / store: they match hub's names.
  • Path params named exactly as Bruno (:id, :organization_id, :tag_id), although hub's route names the tag param :id: same URL, and the ticket asks for Bruno parity.
  • sourceFile is 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.
  • Notes keep only what a caller cannot guess (403 without Store plan / store coupons, per_page limits, dates, the free-price rule, used coupon cannot be deleted).
  • The resync is by hand, because the CLI catalog has no Bruno generator; the Create Coupon bodyExample stays faithful to hub, even though its ends_at (Apr 1 00:00Z) does not follow the new end-of-day rule. That is reported to hub, not changed here.
  • Bruno bodyExample placeholders (....-c3) kept verbatim; the skill doc example uses a code-based coupon so it works without ids.

Notes

  • DELETE requests are auto-retried by the existing transport, so a retried deleteCoupon / removeOrganizationTag can 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

ariel-greenfeld and others added 2 commits November 17, 2026 14:05
…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 xyte-genie left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread CHANGELOG.md Resolved
Comment thread skills/xyte-cli/references/endpoints.md Resolved
Comment thread skills/xyte-cli/references/endpoints.md Resolved
Comment thread src/api-catalog/public-endpoints.json Resolved
Comment thread src/api-catalog/public-endpoints.json Resolved
Comment thread src/api-catalog/public-endpoints.json Resolved
Comment thread src/api-catalog/public-endpoints.json Resolved
Comment thread tests/endpoints.test.ts Resolved
Comment thread tests/endpoints.test.ts Resolved
Comment thread tests/namespaces.test.ts Resolved
@xyte-genie

Copy link
Copy Markdown

AI: Review lenses for 404b655

Lens Status Why
cross-repo ran nine catalog entries hand-copied from hub Bruno at 5f55f31367; every path, param and note is a claim about hub that can be checked
correctness ran first catalog entries with two path params and underscore names; per_page pass-through and write handling are inferred, not changed
docs ran skill reference, CHANGELOG and shipped skill data are user-facing; the reference example body differs from the catalog bodyExample
spec-coverage ran new tests assert shape only; bodyExample validity, notes and sourceFile of the nine entries are unasserted
decisions ran PR body has a 'Decided for you' section (group names, Bruno param names, non-URL sourceFile, hand-sync) and ships entries for endpoints not yet in hub production
security-tenancy skipped no auth or scoping logic changes in the CLI; authScope is catalog data, verified by cross-repo
data-integrity skipped no writes, jobs or storage in the CLI change; coupon write semantics live in hub
migrations-rollout skipped no migrations, schema or feature flags; the publish-before-hub risk goes to decisions
performance skipped static JSON entries and nine pass-through methods; nothing runs in a loop or query
api-compat skipped no hub core/ or Bruno change in this PR; the catalog-vs-hub contract check is the cross-repo lens with hub-agent
backwards-compat skipped additive only — PR verified 0 existing entries changed and namespace methods are appended
errors-observability skipped no new raises, messages or logs
ui-ux-product skipped no web/ or jbuilder files; xyte-cli has no screen for this change
accessibility-i18n skipped no form controls, colours or user-facing UI text
readability skipped names are copied from hub Bruno; the naming choices are covered by decisions
over-engineering skipped 519 added lines are catalog data, two 9-line mapping lists and tests; no abstraction added
spec-vs-ticket skipped ticket asks for Bruno parity of the nine endpoints; cross-repo checks that parity directly
deps-infra skipped package.json, lockfile and infra untouched
skills-authoring skipped only skills/xyte-cli/references/endpoints.md and shipped data change, both covered by docs; no SKILL.md, AGENTS.md or CLAUDE.md edits

Comment thread skills/xyte-cli/references/endpoints.md Resolved
Comment thread src/api-catalog/public-endpoints.json Resolved
Comment thread src/api-catalog/public-endpoints.json Resolved
Comment thread src/api-catalog/public-endpoints.json Resolved
@xyte-genie xyte-genie added the awaiting-author Waiting on the author: the reviewer left comments to address label Nov 17, 2026
ariel-greenfeld and others added 2 commits November 17, 2026 18:44
…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
@ariel-greenfeld ariel-greenfeld assigned borisd and unassigned DorRaz103 Nov 17, 2026
@ariel-greenfeld
ariel-greenfeld marked this pull request as ready for review November 17, 2026 16:47
@ariel-greenfeld ariel-greenfeld added the awaiting-reviewer Waiting on the reviewer: a new PR, or the author has answered every comment label Nov 17, 2026
Copilot AI balanced review requested due to automatic review settings November 17, 2026 16:47
@ariel-greenfeld ariel-greenfeld removed the awaiting-author Waiting on the author: the reviewer left comments to address label Nov 17, 2026
@ariel-greenfeld

Copy link
Copy Markdown
Contributor Author

AI: Ready for review — the NC-Reviewer round is answered: 13 findings (all Low) and 3 decision threads.

Fixed (11):

  • CHANGELOG says the new endpoints need the hub release from server#9869 / server#9870 (older hubs return 404).
  • Catalog notes: createCoupon body rules, tag ordering (get the tag id first, then create the coupon), updateCoupon null rules, case-insensitive tag names and tag filter, re-adding a tag keeps its note.
  • Skill reference: coupon body-rules line and the four new list endpoints in the pagination table.
  • Tests: every bodyExample is valid JSON and every path template matches its path params; removeOrganizationTag write-profile columns; the DELETE URL the client builds.

Not changed (2):

  • The createCoupon example: it is valid under the hub rules (code is allowed, percent + percent_off is a valid pair).
  • sourceFile as a Bruno path: no public dev.xyte.io page exists yet, and nothing reads the field as a URL.

Decisions to weigh (3):

  • The catalog lists endpoints before the hub release that serves them; the guard is "merge and publish only after server#9870 is deployed".
  • Source references point at the hub Bruno files until the docs page ships.
  • Business rules (stacking, free-price 422, end-of-day expiry, used-coupon delete block) are repeated in the catalog notes, so a hub rule change needs a CLI resync.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 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
borisd previously requested changes Nov 18, 2026

@borisd borisd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI: Changes requested.

  • [Mid] src/api-catalog/public-endpoints.json:1522 — The updateCoupon notes were synced from hub 5f55f31; server#9870 is now at d2a420d and added two rules agents need: changing discount_type clears the other type's fields, and sending currency without amount_off keeps the number and changes the currency (5 USD → 5 JPY). Please resync from d2a420d (also picks up: organizations_count counts only partner-visible orgs; coupons_removed is empty when the org isn't store_visible).

@borisd borisd added awaiting-author Waiting on the author: the reviewer left comments to address and removed awaiting-reviewer Waiting on the reviewer: a new PR, or the author has answered every comment labels Nov 18, 2026
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
@ariel-greenfeld

Copy link
Copy Markdown
Contributor Author

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.

@ariel-greenfeld
ariel-greenfeld dismissed borisd’s stale review November 19, 2026 15:03

AI: All items addressed and replied to; re-requesting review.

@ariel-greenfeld ariel-greenfeld added awaiting-reviewer Waiting on the reviewer: a new PR, or the author has answered every comment and removed awaiting-author Waiting on the author: the reviewer left comments to address labels Nov 19, 2026

@borisd borisd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI: Approved.

@borisd borisd removed the awaiting-reviewer Waiting on the reviewer: a new PR, or the author has answered every comment label Nov 19, 2026
@ariel-greenfeld
ariel-greenfeld merged commit 5b676b2 into main Nov 23, 2026
15 of 16 checks passed
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.

5 participants