From 6eeb17e7765e0a44db72fa03b6e6aca38af6f873 Mon Sep 17 00:00:00 2001 From: "harshitha.d" Date: Fri, 28 Feb 2025 16:59:16 +0530 Subject: [PATCH 1/3] feat: add support for GCP EU region in host configuration --- src/lib/types.ts | 1 + test/unit/utils.spec.ts | 6 +++++- test/utils/constant.ts | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/types.ts b/src/lib/types.ts index 8d02cc6..3988f20 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -8,6 +8,7 @@ export enum Region { AZURE_NA = 'azure-na', AZURE_EU = 'azure-eu', GCP_NA = 'gcp-na', + GCP_EU = 'gcp-eu', } export interface StackConfig extends HttpClientParams { host?: string; diff --git a/test/unit/utils.spec.ts b/test/unit/utils.spec.ts index 63284a3..c654e09 100644 --- a/test/unit/utils.spec.ts +++ b/test/unit/utils.spec.ts @@ -1,6 +1,6 @@ import { Region } from '../../src/lib/types'; import { getHost } from '../../src/lib/utils'; -import { DUMMY_URL, HOST_EU_REGION, HOST_GCP_NA_REGION, HOST_URL, MOCK_CLIENT_OPTIONS } from '../utils/constant'; +import { DUMMY_URL, HOST_EU_REGION, HOST_GCP_NA_REGION, HOST_URL, MOCK_CLIENT_OPTIONS, HOST_GCP_EU_REGION } from '../utils/constant'; import { httpClient, AxiosInstance } from '@contentstack/core'; import MockAdapter from 'axios-mock-adapter'; import { assetQueryFindResponseDataMock } from '../utils/mocks'; @@ -22,6 +22,10 @@ describe('Utils', () => { const url = getHost(Region.GCP_NA); expect(url).toEqual(HOST_GCP_NA_REGION); }); + it('should return host when region or host is passed', () => { + const url = getHost(Region.GCP_EU); + expect(url).toEqual(HOST_GCP_EU_REGION); + }); it('should return proper US region when nothing is passed', () => { const url = getHost(); expect(url).toEqual(HOST_URL); diff --git a/test/utils/constant.ts b/test/utils/constant.ts index 866227d..6d58e0b 100644 --- a/test/utils/constant.ts +++ b/test/utils/constant.ts @@ -4,5 +4,6 @@ export const CUSTOM_HOST = 'example-cdn.csnonprod.com'; export const HOST_EU_REGION = 'eu-cdn.contentstack.com'; export const HOST_AZURE_NA_REGION = 'azure-na-cdn.contentstack.com'; export const HOST_GCP_NA_REGION = 'gcp-na-cdn.contentstack.com'; +export const HOST_GCP_EU_REGION = 'gcp-eu-cdn.contentstack.com'; export const DUMMY_URL = 'www.example.com'; export const MOCK_CLIENT_OPTIONS = { defaultHostname: HOST_URL, params: { environment: 'env' } }; From 4b5f6239967fa066ef4a4f63848190b2e436753c Mon Sep 17 00:00:00 2001 From: "harshitha.d" Date: Fri, 28 Feb 2025 17:00:22 +0530 Subject: [PATCH 2/3] chore: bump version to 4.6.0 in package.json and package-lock.json --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8cc7066..207ed8c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@contentstack/delivery-sdk", - "version": "4.5.1", + "version": "4.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@contentstack/delivery-sdk", - "version": "4.5.1", + "version": "4.6.0", "license": "MIT", "dependencies": { "@contentstack/core": "^1.1.4", diff --git a/package.json b/package.json index b73714d..55191a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@contentstack/delivery-sdk", - "version": "4.5.1", + "version": "4.6.0", "type": "module", "license": "MIT", "main": "./dist/legacy/index.cjs", From 3c6ca4978745af37427c7aceea679d4d75d21b96 Mon Sep 17 00:00:00 2001 From: "harshitha.d" Date: Fri, 28 Feb 2025 17:04:38 +0530 Subject: [PATCH 3/3] Update CHANGELOG for version 4.6.0 with GCP-EU support --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fafaca1..f114973 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### Version: 4.6.0 +#### Date: March-10-2025 +Enh: Added GCP-EU support + ### Version: 4.4.4 #### Date: January-06-2025 Enh: Include References on Entry UID