Skip to content

feat: add support for branch settings#522

Merged
naman-contentstack merged 4 commits intodevelopmentfrom
feat/DX-5442
Mar 13, 2026
Merged

feat: add support for branch settings#522
naman-contentstack merged 4 commits intodevelopmentfrom
feat/DX-5442

Conversation

@naman-contentstack
Copy link
Contributor

Add updateSettings method to Branch SDK

The CMA REST API supports updating branch-level settings via POST /stacks/branches/{branch_uid}/settings, but the SDK had no corresponding method.

Changes

  • lib/stack/branch/index.js — added updateSettings(payload) to the Branch object (available when a branch UID is provided)
  • types/stack/branch/index.d.ts — added typed interfaces: IBranchSettings, IBranchSettingsData, ILinkedWorkspace, and IBranchSettingsResponse
  • test/unit/branch-test.js — added unit test covering the new method

Usage

client.stack({ api_key: 'api_key' }).branch('main').updateSettings({
  branch: {
    settings: {
      am_v2: {
        linked_workspaces: [
          { uid: 'main', space_uid: 'space_uid', is_default: true }
        ]
      }
    }
  }
})
.then((response) => console.log(response.notice))

@naman-contentstack naman-contentstack self-assigned this Mar 13, 2026
@naman-contentstack naman-contentstack requested a review from a team as a code owner March 13, 2026 08:33
@github-actions
Copy link

🔒 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

github-actions bot commented Mar 13, 2026

Coverage report for commit: 3f57891
File: coverage/clover.xml

Cover ┌─────────────────────────┐ Freq.
   0% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  10% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  20% │ ██░░░░░░░░░░░░░░░░░░░░░ │  2.2%
  30% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  40% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  50% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  60% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  70% │ ██████░░░░░░░░░░░░░░░░░ │  8.7%
  80% │ ███████████████████████ │ 39.1%
  90% │ █████████████░░░░░░░░░░ │ 21.7%
 100% │ █████████████████░░░░░░ │ 28.3%
      └─────────────────────────┘
 *Legend:* █ = Current Distribution 
Summary - Lines: 82.37% | Methods: 95.91% | Branches: 65.48%
FilesLinesMethodsBranches
lib
   contentstack.js100.00%100.00%100.00%
   contentstackClient.js83.02%92.86%69.49%
   contentstackCollection.js94.12%100.00%86.96%
   entity.js76.22%100.00%61.34%
lib/core
   Util.js77.68%94.44%61.65%
   concurrency-queue.js71.84%72.22%62.02%
   contentstackError.js100.00%100.00%100.00%
   contentstackHTTPClient.js85.71%92.31%80.00%
   errorMessages.js100.00%100.00%71.43%
   oauthHandler.js90.85%100.00%67.14%
   pkceStorage.js100.00%100.00%94.12%
lib/organization
   index.js72.73%100.00%48.68%
lib/organization/teams
   index.js89.47%100.00%61.11%
lib/organization/teams/stackRoleMappings
   index.js78.57%100.00%47.50%
lib/organization/teams/teamUsers
   index.js100.00%100.00%87.50%
lib/query
   index.js73.91%100.00%56.25%
lib/stack/asset/folders
   index.js100.00%100.00%94.44%
lib/stack/asset
   index.js86.42%100.00%72.34%
lib/stack/auditlog
   index.js91.67%100.00%69.70%
lib/stack/branch
   compare.js68.18%100.00%56.67%
   index.js91.11%100.00%68.18%
   mergeQueue.js83.33%100.00%57.89%
lib/stack/branchAlias
   index.js79.31%100.00%58.54%
lib/stack/contentType/entry
   index.js83.04%100.00%57.43%
lib/stack/contentType/entry/variants
   index.js79.31%100.00%58.97%
lib/stack/contentType
   index.js84.85%100.00%67.57%
lib/stack/deliveryToken
   index.js95.24%80.00%85.00%
lib/stack/deliveryToken/previewToken
   index.js21.43%25.00%7.14%
lib/stack/environment
   index.js100.00%100.00%94.74%
lib/stack/extension
   index.js93.88%100.00%80.95%
lib/stack/globalField
   index.js91.67%100.00%80.77%
lib/stack
   index.js80.66%92.86%67.74%
lib/stack/label
   index.js100.00%100.00%93.33%
lib/stack/locale
   index.js100.00%100.00%94.74%
lib/stack/managementToken
   index.js100.00%100.00%89.47%
lib/stack/release
   index.js80.00%100.00%58.33%
lib/stack/roles
   index.js100.00%100.00%94.12%
lib/stack/taxonomy
   index.js80.60%100.00%54.76%
lib/stack/taxonomy/terms
   index.js78.57%100.00%56.41%
lib/stack/variantGroup
   index.js81.58%100.00%57.14%
lib/stack/variantGroup/variants
   index.js77.50%100.00%52.00%
lib/stack/variants
   index.js76.32%100.00%50.00%
lib/stack/webhook
   index.js84.48%100.00%63.64%
lib/stack/workflow
   index.js83.64%100.00%66.10%
lib/stack/workflow/publishRules
   index.js100.00%100.00%94.74%
lib/user
   index.js91.43%100.00%73.08%

🤖 comment via lucassabreu/comment-coverage-clover

@github-actions
Copy link

🔒 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

Copy link

@harshitha-cstk harshitha-cstk left a comment

Choose a reason for hiding this comment

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

version bump and changelog update

Copy link
Contributor

@sunil-lakshman sunil-lakshman left a comment

Choose a reason for hiding this comment

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

@naman-contentstack Please add release version bump & changelog

@github-actions
Copy link

🔒 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

🔒 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

@naman-contentstack naman-contentstack merged commit e9e7595 into development Mar 13, 2026
13 checks passed
@naman-contentstack naman-contentstack deleted the feat/DX-5442 branch March 13, 2026 09:41
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.

3 participants