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 diff --git a/package-lock.json b/package-lock.json index 462b0ae..fd3a27c 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.2.0", diff --git a/package.json b/package.json index 2cca7b6..c4e3c60 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", 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' } };