Skip to content

Commit 67a84e9

Browse files
authored
Merge pull request #32 from contentstack/automation
Stack instance issue resolved
2 parents 1a249d5 + 27e3390 commit 67a84e9

File tree

6 files changed

+38
-42
lines changed

6 files changed

+38
-42
lines changed

dist/nativescript/contentstack.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ var Stack = function () {
600600
this.config = _config2.default;
601601
this.cachePolicy = _index2.default.policies.IGNORE_CACHE;
602602
this.provider = _index2.default.providers('localstorage');
603-
console.error(stack_arguments.length);
604603

605604
switch (stack_arguments.length) {
606605
case 1:
@@ -632,39 +631,39 @@ var Stack = function () {
632631
access_token: stack_arguments[1]
633632
};
634633
this.environment = stack_arguments[2];
635-
return this;
636634
} else {
637635
console.error("Kindly provide valid string parameters.");
638636
}
639637
if (stack_arguments[3]) {
640638
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
641-
_config2.default['host'] = stack_arguments[0].region + "-" + "cdn.contentstack.com";
639+
_config2.default['host'] = stack_arguments[3] + "-" + "cdn.contentstack.com";
642640
} else if (_typeof(stack_arguments[3]) === 'object') {
643641
this.fetchOptions = stack_arguments[3];
644642
}
645643
}
644+
return this;
646645
case 5:
647646
if (typeof stack_arguments[0] === "string" && typeof stack_arguments[1] === "string" && typeof stack_arguments[2] === "string") {
648647
this.headers = {
649648
api_key: stack_arguments[0],
650649
access_token: stack_arguments[1]
651650
};
652651
this.environment = stack_arguments[2];
653-
return this;
654652
} else {
655653
console.error("Kindly provide valid string parameters.");
656654
}
655+
657656
if (stack_arguments[3]) {
658-
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
659-
_config2.default['host'] = stack_arguments[0].region + "-" + "cdn.contentstack.com";
657+
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us") {
658+
_config2.default['host'] = stack_arguments[3] + "-" + "cdn.contentstack.com";
660659
} else if (_typeof(stack_arguments[3]) === 'object') {
661660
this.fetchOptions = stack_arguments[3];
662661
}
663662
}
664663
if (stack_arguments[4] && _typeof(stack_arguments[4]) === 'object') {
665-
this.fetchOptions = stack_arguments[3];
664+
this.fetchOptions = stack_arguments[4];
666665
}
667-
666+
return this;
668667
default:
669668
console.error("Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.");
670669
}
@@ -1151,7 +1150,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11511150
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
11521151

11531152
//JS SDK version
1154-
var version = '3.9.0';
1153+
var version = '3.9.1';
11551154
var environment = void 0,
11561155
api_key = void 0;
11571156

dist/node/contentstack.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,6 @@ var Stack = function () {
696696
this.config = _config2.default;
697697
this.cachePolicy = _index2.default.policies.IGNORE_CACHE;
698698
this.provider = _index2.default.providers('localstorage');
699-
console.error(stack_arguments.length);
700699

701700
switch (stack_arguments.length) {
702701
case 1:
@@ -728,39 +727,39 @@ var Stack = function () {
728727
access_token: stack_arguments[1]
729728
};
730729
this.environment = stack_arguments[2];
731-
return this;
732730
} else {
733731
console.error("Kindly provide valid string parameters.");
734732
}
735733
if (stack_arguments[3]) {
736734
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
737-
_config2.default['host'] = stack_arguments[0].region + "-" + "cdn.contentstack.com";
735+
_config2.default['host'] = stack_arguments[3] + "-" + "cdn.contentstack.com";
738736
} else if (_typeof(stack_arguments[3]) === 'object') {
739737
this.fetchOptions = stack_arguments[3];
740738
}
741739
}
740+
return this;
742741
case 5:
743742
if (typeof stack_arguments[0] === "string" && typeof stack_arguments[1] === "string" && typeof stack_arguments[2] === "string") {
744743
this.headers = {
745744
api_key: stack_arguments[0],
746745
access_token: stack_arguments[1]
747746
};
748747
this.environment = stack_arguments[2];
749-
return this;
750748
} else {
751749
console.error("Kindly provide valid string parameters.");
752750
}
751+
753752
if (stack_arguments[3]) {
754-
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
755-
_config2.default['host'] = stack_arguments[0].region + "-" + "cdn.contentstack.com";
753+
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us") {
754+
_config2.default['host'] = stack_arguments[3] + "-" + "cdn.contentstack.com";
756755
} else if (_typeof(stack_arguments[3]) === 'object') {
757756
this.fetchOptions = stack_arguments[3];
758757
}
759758
}
760759
if (stack_arguments[4] && _typeof(stack_arguments[4]) === 'object') {
761-
this.fetchOptions = stack_arguments[3];
760+
this.fetchOptions = stack_arguments[4];
762761
}
763-
762+
return this;
764763
default:
765764
console.error("Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.");
766765
}
@@ -1650,7 +1649,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
16501649
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
16511650

16521651
//JS SDK version
1653-
var version = '3.9.0';
1652+
var version = '3.9.1';
16541653
var environment = void 0,
16551654
api_key = void 0;
16561655

dist/react-native/contentstack.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,6 @@ var Stack = function () {
600600
this.config = _config2.default;
601601
this.cachePolicy = _index2.default.policies.IGNORE_CACHE;
602602
this.provider = _index2.default.providers('localstorage');
603-
console.error(stack_arguments.length);
604603

605604
switch (stack_arguments.length) {
606605
case 1:
@@ -632,39 +631,39 @@ var Stack = function () {
632631
access_token: stack_arguments[1]
633632
};
634633
this.environment = stack_arguments[2];
635-
return this;
636634
} else {
637635
console.error("Kindly provide valid string parameters.");
638636
}
639637
if (stack_arguments[3]) {
640638
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
641-
_config2.default['host'] = stack_arguments[0].region + "-" + "cdn.contentstack.com";
639+
_config2.default['host'] = stack_arguments[3] + "-" + "cdn.contentstack.com";
642640
} else if (_typeof(stack_arguments[3]) === 'object') {
643641
this.fetchOptions = stack_arguments[3];
644642
}
645643
}
644+
return this;
646645
case 5:
647646
if (typeof stack_arguments[0] === "string" && typeof stack_arguments[1] === "string" && typeof stack_arguments[2] === "string") {
648647
this.headers = {
649648
api_key: stack_arguments[0],
650649
access_token: stack_arguments[1]
651650
};
652651
this.environment = stack_arguments[2];
653-
return this;
654652
} else {
655653
console.error("Kindly provide valid string parameters.");
656654
}
655+
657656
if (stack_arguments[3]) {
658-
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
659-
_config2.default['host'] = stack_arguments[0].region + "-" + "cdn.contentstack.com";
657+
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us") {
658+
_config2.default['host'] = stack_arguments[3] + "-" + "cdn.contentstack.com";
660659
} else if (_typeof(stack_arguments[3]) === 'object') {
661660
this.fetchOptions = stack_arguments[3];
662661
}
663662
}
664663
if (stack_arguments[4] && _typeof(stack_arguments[4]) === 'object') {
665-
this.fetchOptions = stack_arguments[3];
664+
this.fetchOptions = stack_arguments[4];
666665
}
667-
666+
return this;
668667
default:
669668
console.error("Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.");
670669
}
@@ -1151,7 +1150,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
11511150
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
11521151

11531152
//JS SDK version
1154-
var version = '3.9.0';
1153+
var version = '3.9.1';
11551154
var environment = void 0,
11561155
api_key = void 0;
11571156

dist/web/contentstack.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "contentstack",
3-
"version": "3.9.1",
3+
"version": "3.9.2",
44
"description": "Contentstack Javascript SDK",
55
"homepage": "https://www.contentstack.com/",
66
"author": {
@@ -9,7 +9,7 @@
99
},
1010
"main": "dist/node/contentstack.js",
1111
"browser": "dist/web/contentstack.js",
12-
"_id": "[email protected].1",
12+
"_id": "[email protected].2",
1313
"scripts": {
1414
"test": "tape test/index.js | tap-html --out ./tap-html.html",
1515
"automate": "node test.js",
@@ -44,14 +44,14 @@
4444
],
4545
"dist": {
4646
"shasum": "a328ed07240476a26b31a23261355dc929e1da63",
47-
"tarball": "https://registry.npmjs.org/contentstack/-/contentstack-3.9.1.tgz"
47+
"tarball": "https://registry.npmjs.org/contentstack/-/contentstack-3.9.2.tgz"
4848
},
4949
"license": "MIT",
5050
"directories": {},
51-
"_resolved": "https://registry.npmjs.org/contentstack/-/contentstack-3.9.1.tgz",
51+
"_resolved": "https://registry.npmjs.org/contentstack/-/contentstack-3.9.2.tgz",
5252
"_npmOperationalInternal": {
5353
"host": "packages-18-east.internal.npmjs.com",
54-
"tmp": "tmp/contentstack-3.9.1.tgz_1477830884275_0.9869455888401717"
54+
"tmp": "tmp/contentstack-3.9.2.tgz_1477830884275_0.9869455888401717"
5555
},
5656
"devDependencies": {
5757
"babel-core": "6.26.0",

src/core/stack.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export default class Stack {
5050
this.config = config;
5151
this.cachePolicy = CacheProvider.policies.IGNORE_CACHE;
5252
this.provider = CacheProvider.providers('localstorage');
53-
console.error(stack_arguments.length);
5453

5554
switch (stack_arguments.length) {
5655
case 1:
@@ -82,39 +81,39 @@ export default class Stack {
8281
access_token: stack_arguments[1]
8382
};
8483
this.environment = stack_arguments[2];
85-
return this;
8684
} else {
8785
console.error("Kindly provide valid string parameters.");
8886
}
89-
if (stack_arguments[3]) {
87+
if (stack_arguments[3]) {
9088
if(typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
91-
config['host'] = stack_arguments[0].region+"-"+"cdn.contentstack.com";
89+
config['host'] = stack_arguments[3]+"-"+"cdn.contentstack.com";
9290
} else if (typeof stack_arguments[3] === 'object') {
9391
this.fetchOptions = stack_arguments[3]
9492
}
9593
}
94+
return this;
9695
case 5:
9796
if (typeof stack_arguments[0] === "string" && typeof stack_arguments[1] === "string" && typeof stack_arguments[2] === "string") {
9897
this.headers = {
9998
api_key: stack_arguments[0],
10099
access_token: stack_arguments[1]
101100
};
102101
this.environment = stack_arguments[2];
103-
return this;
104102
} else {
105103
console.error("Kindly provide valid string parameters.");
106104
}
105+
107106
if (stack_arguments[3]) {
108-
if(typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
109-
config['host'] = stack_arguments[0].region+"-"+"cdn.contentstack.com";
107+
if(typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us") {
108+
config['host'] = stack_arguments[3]+"-"+"cdn.contentstack.com";
110109
} else if (typeof stack_arguments[3] === 'object') {
111110
this.fetchOptions = stack_arguments[3]
112111
}
113112
}
114113
if (stack_arguments[4] && typeof stack_arguments[4] === 'object') {
115-
this.fetchOptions = stack_arguments[3]
114+
this.fetchOptions = stack_arguments[4]
116115
}
117-
116+
return this;
118117
default:
119118
console.error("Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.");
120119
}

0 commit comments

Comments
 (0)