Skip to content

Feat/taxonomy publishing#345

Merged
cs-raj merged 41 commits into
developmentfrom
feat/taxonomy-publishing
Jul 15, 2026
Merged

Feat/taxonomy publishing#345
cs-raj merged 41 commits into
developmentfrom
feat/taxonomy-publishing

Conversation

@harshitha-cstk

@harshitha-cstk harshitha-cstk commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for the published Taxonomy Content Delivery API (CDA) to the delivery SDK. Consumers can now fetch published taxonomies and terms, walk the term tree (ancestors/descendants), retrieve localized term versions, and query entries by taxonomy/term — all through a fluent, chainable API off the stack instance.

Note: These endpoints require the taxonomy_publish feature flag to be enabled on the stack's plan. If it is not enabled, the CDA returns 403 taxonomy.feature_disabled.

What's new

New classes wired into Stack:

Entry point Returns Purpose
stack.taxonomy() TaxonomyQuery List all taxonomies / query entries by taxonomy
stack.taxonomy(uid) Taxonomy A single taxonomy
stack.taxonomy(uid).term(termUid) Term A single term
stack.taxonomy(uid).term() TermQuery All terms in a taxonomy

Endpoint coverage

CDA endpoint SDK call
GET /taxonomies stack.taxonomy().find()
GET /taxonomies/:uid stack.taxonomy(uid).fetch()
GET /taxonomies/:uid/terms stack.taxonomy(uid).term().find()
GET /taxonomies/:uid/terms/:term stack.taxonomy(uid).term(term).fetch()
GET .../terms/:term/locales stack.taxonomy(uid).term(term).locales()
GET .../terms/:term/ancestors stack.taxonomy(uid).term(term).ancestors()
GET .../terms/:term/descendants stack.taxonomy(uid).term(term).descendants()

Query-parameter support

Chainable helpers to apply the common CDA query parameters:

  • Taxonomy: includeFallback(), includeBranch(), param(), addParams(), and a locale argument on fetch(locale?).
  • Term: depth(), includeFallback(), includeBranch(), param(), addParams(), and a locale argument on fetch(locale?); params are forwarded on fetch/locales/ancestors/descendants.
  • TermQuery: depth(), skip(), limit(), includeCount(), includeFallback(), includeBranch(), locale(), param(), addParams().

Types

  • BaseTaxonomy, BaseTerm response interfaces.
  • TaxonomyQueryOperation enum for tree operators ($above, $below, $eq_above, $eq_below) used in entry-by-taxonomy queries.

Usage

import contentstack from '@contentstack/delivery-sdk';

const stack = contentstack.stack({ apiKey, deliveryToken, environment });

// All taxonomies
const taxonomies = await stack.taxonomy().find();

// Single taxonomy (with locale fallback)
const taxonomy = await stack.taxonomy('categories').includeFallback().fetch('hi-in');

// All terms in a taxonomy, paginated with a count
const terms = await stack.taxonomy('regions').term()
  .limit(20).skip(0).includeCount().find();

// A single term and its tree
const term = await stack.taxonomy('regions').term('california').fetch();
const ancestors = await stack.taxonomy('regions').term('california').ancestors();
const descendants = await stack.taxonomy('regions').term('usa').depth(2).descendants();
const localized = await stack.taxonomy('regions').term('california').locales();

Testing

  • Unit tests (mocked) for Taxonomy, Term, TermQuery, and TaxonomyQuery, including assertions that the query parameters reach the request.
  • API/integration test suites for the taxonomy and term endpoints.

Notes / follow-ups

  • The /taxonomies/entries (entries-by-taxonomy) path is set on TaxonomyQuery but find() currently resolves to /taxonomies; wiring a dedicated call for entries-by-taxonomy with tree operators is a follow-up.
  • Term.locales() targets /taxonomies/:uid/terms/:uid/locales; confirm against the finalized CDA route (/taxonomy_definitions/... in the spec) before release.

harshitha-cstk and others added 28 commits October 13, 2025 14:00
feat: Add ancestors method to Term class and update related tests
feat: Add descendants method to Term class and update related tests
@harshitha-cstk harshitha-cstk requested a review from a team as a code owner March 12, 2026 07:39
@github-actions

Copy link
Copy Markdown

We regret to inform you that you are currently not able to merge your changes into the main branch due to restrictions applied by our SRE team. To proceed with merging your changes, we kindly request that you create a pull request from the development branch. Our team will then review the changes and work with you to ensure a successful merge into the main branch.

@harshithad0703 harshithad0703 requested a review from a team as a code owner March 12, 2026 07:47
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

1 similar comment
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

cs-raj and others added 2 commits July 15, 2026 15:57
Adds locale-aware retrieval for taxonomy and term CDA endpoints
(cdn.contentstack.io) to cover the localized-delivery flow (CD-11371).

- Taxonomy.fetch(locale?) — pass locale to GET /taxonomies/{uid}
- TermQuery.locale(code) + includeFallback() — chainable params on
  GET /taxonomies/{uid}/terms for locale and fallback filtering
- Term.fetch(locale?) — pass locale to GET /taxonomies/{uid}/terms/{uid}
- Fixed incorrect JSDoc on Term.fetch (copy-paste from descendants)
- Fixed broken test imports pointing to non-existent src/lib/* paths

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: add locale and includeFallback support to taxonomy CDA delivery
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

…rmQuery

Add chainable helpers so common CDA query params can be sent on the
published taxonomy/term endpoints, which previously issued requests with
no params at all:

- Term: depth(), includeFallback(), includeBranch(), param(), addParams()
  and locale support on fetch(); all request methods (fetch/locales/
  ancestors/descendants) now forward _queryParams.
- Taxonomy: includeFallback(), includeBranch(), param(), addParams(), and
  locale support on fetch() (fetch() now forwards _queryParams).
- TermQuery: depth(), skip(), limit(), includeCount(), includeFallback(),
  includeBranch(), locale(), param(), addParams().

Also fix broken unit-test imports (src/lib/* -> src/taxonomy/*, src/query/*)
so the taxonomy suites load, and add coverage asserting the params reach
the request.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

…m-query

Add mock fixtures and unit/API test cases exercising locale-based fetch
and query behavior across Taxonomy, Term, and TermQuery.
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

netrajpatel
netrajpatel previously approved these changes Jul 15, 2026
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@cs-raj cs-raj merged commit 5a8e9c0 into development Jul 15, 2026
10 checks passed
@cs-raj cs-raj deleted the feat/taxonomy-publishing branch July 15, 2026 14:06
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