From 3a11480b249edfee4b4c2b1761987617ee5657a3 Mon Sep 17 00:00:00 2001 From: Nadeem Patwekar Date: Thu, 11 Dec 2025 20:24:48 +0530 Subject: [PATCH 1/2] fix: service key for getContentstackEndpoint method --- lib/contentstack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/contentstack.js b/lib/contentstack.js index 85398c9f..9d377999 100644 --- a/lib/contentstack.js +++ b/lib/contentstack.js @@ -172,7 +172,7 @@ import { getContentstackEndpoint } from '@contentstack/utils' */ export function client (params = {}) { let defaultHostName = params.region - ? getContentstackEndpoint(params.region.toUpperCase(), 'management', true) + ? getContentstackEndpoint(params.region.toUpperCase(), 'contentManagement', true) : getContentstackEndpoint('NA', 'contentManagement', true) if (params.host) { From 0cfbff4b525048f04cd3e8d45303d34d19007fcc Mon Sep 17 00:00:00 2001 From: "harshitha.d" Date: Thu, 11 Dec 2025 21:16:22 +0530 Subject: [PATCH 2/2] fix: update user-test to correctly handle invalid region errors --- test/sanity-check/api/user-test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/sanity-check/api/user-test.js b/test/sanity-check/api/user-test.js index 080b8f09..65806d84 100644 --- a/test/sanity-check/api/user-test.js +++ b/test/sanity-check/api/user-test.js @@ -136,11 +136,11 @@ describe('Contentstack User Session api Test', () => { // The new implementation uses getContentstackEndpoint which handles region validation // It should not throw an error, but will use whatever getContentstackEndpoint returns try { - const client = contentstack.client({ region: 'DUMMYREGION' }) - expect(client).to.not.equal(null, 'Client should be created even with invalid region') - done() + contentstack.client({ region: 'DUMMYREGION' }) + done(new Error('Expected an error to be thrown for invalid region')) } catch (error) { - done(error) + expect(error.message).to.include('Invalid region') + done() } }) })