File tree Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Expand file tree Collapse file tree 4 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " contentstack" ,
3
- "version" : " 3.7.0 " ,
3
+ "version" : " 3.7.1 " ,
4
4
"description" : " Contentstack Javascript SDK" ,
5
5
"homepage" : " https://www.contentstack.com/" ,
6
6
"author" : {
Original file line number Diff line number Diff line change 1
1
import Stack from "./stack" ;
2
2
import CacheProvider from './cache-provider/index' ;
3
+ import ContentstackRegion from "./contentstackregion" ;
3
4
4
5
5
6
/**
@@ -23,6 +24,7 @@ class Contentstack {
23
24
* Contentstack.CachePolicy.CACHE_THEN_NETWORK
24
25
*/
25
26
this . CachePolicy = CacheProvider . policies ;
27
+ this . Region = ContentstackRegion ;
26
28
}
27
29
/**
28
30
Original file line number Diff line number Diff line change
1
+ const ContentstackRegion = {
2
+ EU : "eu" ,
3
+ US : "us"
4
+ } ;
5
+
6
+ export default ContentstackRegion ;
7
+ //module.exports = ContentstackRegion;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import Request from './lib/request';
8
8
import * as cache from './cache' ;
9
9
import CacheProvider from './cache-provider/index' ;
10
10
11
+
11
12
/**
12
13
* @class
13
14
Stack
@@ -26,11 +27,12 @@ import CacheProvider from './cache-provider/index';
26
27
*/
27
28
export default class Stack {
28
29
constructor ( ...stack_arguments ) {
29
-
30
+ if ( stack_arguments [ 0 ] . region && stack_arguments [ 0 ] . region != undefined && stack_arguments [ 0 ] . region != "us" ) {
31
+ config [ 'host' ] = stack_arguments [ 0 ] . region + "-" + "cdn.contentstack.com"
32
+ }
30
33
this . config = config ;
31
34
this . cachePolicy = CacheProvider . policies . IGNORE_CACHE ;
32
35
this . provider = CacheProvider . providers ( 'localstorage' ) ;
33
- //this.sync_cdn_api_key = stack_arguments[0].sync_cdn_api_key;
34
36
switch ( stack_arguments . length ) {
35
37
case 1 :
36
38
if ( typeof stack_arguments [ 0 ] === "object" && typeof stack_arguments [ 0 ] . api_key === "string" && typeof stack_arguments [ 0 ] . access_token === "string" && typeof stack_arguments [ 0 ] . environment === "string" ) {
You can’t perform that action at this time.
0 commit comments