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 11{
22 "name" : " contentstack" ,
3- "version" : " 3.7.0 " ,
3+ "version" : " 3.7.1 " ,
44 "description" : " Contentstack Javascript SDK" ,
55 "homepage" : " https://www.contentstack.com/" ,
66 "author" : {
Original file line number Diff line number Diff line change 11import Stack from "./stack" ;
22import CacheProvider from './cache-provider/index' ;
3+ import ContentstackRegion from "./contentstackregion" ;
34
45
56 /**
@@ -23,6 +24,7 @@ class Contentstack {
2324 * Contentstack.CachePolicy.CACHE_THEN_NETWORK
2425 */
2526 this . CachePolicy = CacheProvider . policies ;
27+ this . Region = ContentstackRegion ;
2628 }
2729/**
2830
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';
88import * as cache from './cache' ;
99import CacheProvider from './cache-provider/index' ;
1010
11+
1112/**
1213 * @class
1314 Stack
@@ -26,11 +27,12 @@ import CacheProvider from './cache-provider/index';
2627 */
2728export default class Stack {
2829 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+ }
3033 this . config = config ;
3134 this . cachePolicy = CacheProvider . policies . IGNORE_CACHE ;
3235 this . provider = CacheProvider . providers ( 'localstorage' ) ;
33- //this.sync_cdn_api_key = stack_arguments[0].sync_cdn_api_key;
3436 switch ( stack_arguments . length ) {
3537 case 1 :
3638 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