Skip to content

Commit 09ac25e

Browse files
authored
Merge pull request #301 from contentstack/staging
DX | 10-03-2025 | Release
2 parents 1ba3514 + 26e4464 commit 09ac25e

File tree

6 files changed

+39
-3
lines changed

6 files changed

+39
-3
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
## Change log
2+
3+
### Version: 3.25.0
4+
#### Date: March-10-2025
5+
##### Fix:
6+
- Added GCP-EU support
7+
28
### Version: 3.24.3
39
#### Date: March-03-2025
410
##### Fix:

index.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export enum Region {
2525
AZURE_NA = "azure-na",
2626
AZURE_EU = "azure-eu",
2727
GCP_NA = "gcp-na",
28+
GCP_EU = "gcp-eu"
2829
}
2930

3031
//Enum for Contentstack CachePolicy

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "contentstack",
3-
"version": "3.24.3",
3+
"version": "3.25.0",
44
"description": "Contentstack Javascript SDK",
55
"homepage": "https://www.contentstack.com/",
66
"author": {

src/core/contentstackregion.js

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const ContentstackRegion = {
44
AZURE_NA: "azure-na",
55
AZURE_EU: "azure-eu",
66
GCP_NA: "gcp-na",
7+
GCP_EU: "gcp-eu"
78
};
89

910
export default ContentstackRegion;

test/typescript/stack.test.ts

+28
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,34 @@ describe('Stack tests', () => {
196196
done();
197197
});
198198

199+
test('Stack initialization with Contentstack Config with fetchOptions, GCP-EU region test', done => {
200+
const config : Contentstack.Config = {
201+
api_key: 'api_key',
202+
delivery_token: 'delivery_token',
203+
environment: 'environment',
204+
region: Contentstack.Region.GCP_EU,
205+
fetchOptions:{
206+
timeout: 2000,
207+
retryLimit: 4,
208+
retryDelay: 40,
209+
logHandler: () => {
210+
211+
}
212+
}
213+
};
214+
const stack = Contentstack.Stack(config);
215+
216+
expect(stack.cachePolicy).toEqual(Contentstack.CachePolicy.IGNORE_CACHE);
217+
expect(stack.environment).toEqual('environment');
218+
expect(stack.config.host).toEqual('gcp-eu-cdn.contentstack.com');
219+
expect(stack.config.port).toEqual(443);
220+
expect(stack.config.version).toEqual("v3");
221+
expect(stack.fetchOptions.timeout).toEqual(2000);
222+
expect(stack.fetchOptions.retryLimit).toEqual(4);
223+
expect(stack.fetchOptions.retryDelay).toEqual(40);
224+
done();
225+
});
226+
199227
test('Stack initialization with region EU test', done => {
200228
const stack = Contentstack.Stack('api_key', 'delivery_token', 'environment', Contentstack.Region.AZURE_NA);
201229
expect(stack.cachePolicy).toEqual(Contentstack.CachePolicy.IGNORE_CACHE);

0 commit comments

Comments
 (0)