From 535375d6c170007e3860b26c72e35a7eec41f385 Mon Sep 17 00:00:00 2001 From: "harshitha.d" Date: Fri, 28 Feb 2025 16:47:43 +0530 Subject: [PATCH] feat: update version to 3.25.0 and add GCP-EU support --- CHANGELOG.md | 6 ++++++ index.d.ts | 1 + package-lock.json | 4 ++-- package.json | 2 +- src/core/contentstackregion.js | 1 + test/typescript/stack.test.ts | 28 ++++++++++++++++++++++++++++ 6 files changed, 39 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 683b6cfa..11beff0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ ## Change log + +### Version: 3.25.0 +#### Date: March-10-2025 +##### Fix: + - Added GCP-EU support + ### Version: 3.24.3 #### Date: March-03-2025 ##### Fix: diff --git a/index.d.ts b/index.d.ts index a829b303..b4df3b24 100644 --- a/index.d.ts +++ b/index.d.ts @@ -25,6 +25,7 @@ export enum Region { AZURE_NA = "azure-na", AZURE_EU = "azure-eu", GCP_NA = "gcp-na", + GCP_EU = "gcp-eu" } //Enum for Contentstack CachePolicy diff --git a/package-lock.json b/package-lock.json index 2357221b..c0de69ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "contentstack", - "version": "3.24.3", + "version": "3.25.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "contentstack", - "version": "3.24.3", + "version": "3.25.0", "license": "MIT", "dependencies": { "@contentstack/utils": "^1.3.15", diff --git a/package.json b/package.json index cecc8176..c5d28589 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "contentstack", - "version": "3.24.3", + "version": "3.25.0", "description": "Contentstack Javascript SDK", "homepage": "https://www.contentstack.com/", "author": { diff --git a/src/core/contentstackregion.js b/src/core/contentstackregion.js index 785fbe40..715dae01 100644 --- a/src/core/contentstackregion.js +++ b/src/core/contentstackregion.js @@ -4,6 +4,7 @@ const ContentstackRegion = { AZURE_NA: "azure-na", AZURE_EU: "azure-eu", GCP_NA: "gcp-na", + GCP_EU: "gcp-eu" }; export default ContentstackRegion; \ No newline at end of file diff --git a/test/typescript/stack.test.ts b/test/typescript/stack.test.ts index 1e54e703..50c00bfe 100644 --- a/test/typescript/stack.test.ts +++ b/test/typescript/stack.test.ts @@ -196,6 +196,34 @@ describe('Stack tests', () => { done(); }); + test('Stack initialization with Contentstack Config with fetchOptions, GCP-EU region test', done => { + const config : Contentstack.Config = { + api_key: 'api_key', + delivery_token: 'delivery_token', + environment: 'environment', + region: Contentstack.Region.GCP_EU, + fetchOptions:{ + timeout: 2000, + retryLimit: 4, + retryDelay: 40, + logHandler: () => { + + } + } + }; + const stack = Contentstack.Stack(config); + + expect(stack.cachePolicy).toEqual(Contentstack.CachePolicy.IGNORE_CACHE); + expect(stack.environment).toEqual('environment'); + expect(stack.config.host).toEqual('gcp-eu-cdn.contentstack.com'); + expect(stack.config.port).toEqual(443); + expect(stack.config.version).toEqual("v3"); + expect(stack.fetchOptions.timeout).toEqual(2000); + expect(stack.fetchOptions.retryLimit).toEqual(4); + expect(stack.fetchOptions.retryDelay).toEqual(40); + done(); + }); + test('Stack initialization with region EU test', done => { const stack = Contentstack.Stack('api_key', 'delivery_token', 'environment', Contentstack.Region.AZURE_NA); expect(stack.cachePolicy).toEqual(Contentstack.CachePolicy.IGNORE_CACHE);