Skip to content

Stack instance issue resolved #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions dist/nativescript/contentstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,6 @@ var Stack = function () {
this.config = _config2.default;
this.cachePolicy = _index2.default.policies.IGNORE_CACHE;
this.provider = _index2.default.providers('localstorage');
console.error(stack_arguments.length);

switch (stack_arguments.length) {
case 1:
Expand Down Expand Up @@ -632,39 +631,39 @@ var Stack = function () {
access_token: stack_arguments[1]
};
this.environment = stack_arguments[2];
return this;
} else {
console.error("Kindly provide valid string parameters.");
}
if (stack_arguments[3]) {
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
_config2.default['host'] = stack_arguments[0].region + "-" + "cdn.contentstack.com";
_config2.default['host'] = stack_arguments[3] + "-" + "cdn.contentstack.com";
} else if (_typeof(stack_arguments[3]) === 'object') {
this.fetchOptions = stack_arguments[3];
}
}
return this;
case 5:
if (typeof stack_arguments[0] === "string" && typeof stack_arguments[1] === "string" && typeof stack_arguments[2] === "string") {
this.headers = {
api_key: stack_arguments[0],
access_token: stack_arguments[1]
};
this.environment = stack_arguments[2];
return this;
} else {
console.error("Kindly provide valid string parameters.");
}

if (stack_arguments[3]) {
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
_config2.default['host'] = stack_arguments[0].region + "-" + "cdn.contentstack.com";
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us") {
_config2.default['host'] = stack_arguments[3] + "-" + "cdn.contentstack.com";
} else if (_typeof(stack_arguments[3]) === 'object') {
this.fetchOptions = stack_arguments[3];
}
}
if (stack_arguments[4] && _typeof(stack_arguments[4]) === 'object') {
this.fetchOptions = stack_arguments[3];
this.fetchOptions = stack_arguments[4];
}

return this;
default:
console.error("Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.");
}
Expand Down Expand Up @@ -1151,7 +1150,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
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; } }

//JS SDK version
var version = '3.9.0';
var version = '3.9.1';
var environment = void 0,
api_key = void 0;

Expand Down
17 changes: 8 additions & 9 deletions dist/node/contentstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,6 @@ var Stack = function () {
this.config = _config2.default;
this.cachePolicy = _index2.default.policies.IGNORE_CACHE;
this.provider = _index2.default.providers('localstorage');
console.error(stack_arguments.length);

switch (stack_arguments.length) {
case 1:
Expand Down Expand Up @@ -728,39 +727,39 @@ var Stack = function () {
access_token: stack_arguments[1]
};
this.environment = stack_arguments[2];
return this;
} else {
console.error("Kindly provide valid string parameters.");
}
if (stack_arguments[3]) {
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
_config2.default['host'] = stack_arguments[0].region + "-" + "cdn.contentstack.com";
_config2.default['host'] = stack_arguments[3] + "-" + "cdn.contentstack.com";
} else if (_typeof(stack_arguments[3]) === 'object') {
this.fetchOptions = stack_arguments[3];
}
}
return this;
case 5:
if (typeof stack_arguments[0] === "string" && typeof stack_arguments[1] === "string" && typeof stack_arguments[2] === "string") {
this.headers = {
api_key: stack_arguments[0],
access_token: stack_arguments[1]
};
this.environment = stack_arguments[2];
return this;
} else {
console.error("Kindly provide valid string parameters.");
}

if (stack_arguments[3]) {
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
_config2.default['host'] = stack_arguments[0].region + "-" + "cdn.contentstack.com";
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us") {
_config2.default['host'] = stack_arguments[3] + "-" + "cdn.contentstack.com";
} else if (_typeof(stack_arguments[3]) === 'object') {
this.fetchOptions = stack_arguments[3];
}
}
if (stack_arguments[4] && _typeof(stack_arguments[4]) === 'object') {
this.fetchOptions = stack_arguments[3];
this.fetchOptions = stack_arguments[4];
}

return this;
default:
console.error("Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.");
}
Expand Down Expand Up @@ -1650,7 +1649,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
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; } }

//JS SDK version
var version = '3.9.0';
var version = '3.9.1';
var environment = void 0,
api_key = void 0;

Expand Down
17 changes: 8 additions & 9 deletions dist/react-native/contentstack.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,6 @@ var Stack = function () {
this.config = _config2.default;
this.cachePolicy = _index2.default.policies.IGNORE_CACHE;
this.provider = _index2.default.providers('localstorage');
console.error(stack_arguments.length);

switch (stack_arguments.length) {
case 1:
Expand Down Expand Up @@ -632,39 +631,39 @@ var Stack = function () {
access_token: stack_arguments[1]
};
this.environment = stack_arguments[2];
return this;
} else {
console.error("Kindly provide valid string parameters.");
}
if (stack_arguments[3]) {
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
_config2.default['host'] = stack_arguments[0].region + "-" + "cdn.contentstack.com";
_config2.default['host'] = stack_arguments[3] + "-" + "cdn.contentstack.com";
} else if (_typeof(stack_arguments[3]) === 'object') {
this.fetchOptions = stack_arguments[3];
}
}
return this;
case 5:
if (typeof stack_arguments[0] === "string" && typeof stack_arguments[1] === "string" && typeof stack_arguments[2] === "string") {
this.headers = {
api_key: stack_arguments[0],
access_token: stack_arguments[1]
};
this.environment = stack_arguments[2];
return this;
} else {
console.error("Kindly provide valid string parameters.");
}

if (stack_arguments[3]) {
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
_config2.default['host'] = stack_arguments[0].region + "-" + "cdn.contentstack.com";
if (typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us") {
_config2.default['host'] = stack_arguments[3] + "-" + "cdn.contentstack.com";
} else if (_typeof(stack_arguments[3]) === 'object') {
this.fetchOptions = stack_arguments[3];
}
}
if (stack_arguments[4] && _typeof(stack_arguments[4]) === 'object') {
this.fetchOptions = stack_arguments[3];
this.fetchOptions = stack_arguments[4];
}

return this;
default:
console.error("Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.");
}
Expand Down Expand Up @@ -1151,7 +1150,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
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; } }

//JS SDK version
var version = '3.9.0';
var version = '3.9.1';
var environment = void 0,
api_key = void 0;

Expand Down
2 changes: 1 addition & 1 deletion dist/web/contentstack.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "contentstack",
"version": "3.9.1",
"version": "3.9.2",
"description": "Contentstack Javascript SDK",
"homepage": "https://www.contentstack.com/",
"author": {
Expand All @@ -9,7 +9,7 @@
},
"main": "dist/node/contentstack.js",
"browser": "dist/web/contentstack.js",
"_id": "contentstack@3.9.1",
"_id": "contentstack@3.9.2",
"scripts": {
"test": "tape test/index.js | tap-html --out ./tap-html.html",
"automate": "node test.js",
Expand Down Expand Up @@ -44,14 +44,14 @@
],
"dist": {
"shasum": "a328ed07240476a26b31a23261355dc929e1da63",
"tarball": "https://registry.npmjs.org/contentstack/-/contentstack-3.9.1.tgz"
"tarball": "https://registry.npmjs.org/contentstack/-/contentstack-3.9.2.tgz"
},
"license": "MIT",
"directories": {},
"_resolved": "https://registry.npmjs.org/contentstack/-/contentstack-3.9.1.tgz",
"_resolved": "https://registry.npmjs.org/contentstack/-/contentstack-3.9.2.tgz",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/contentstack-3.9.1.tgz_1477830884275_0.9869455888401717"
"tmp": "tmp/contentstack-3.9.2.tgz_1477830884275_0.9869455888401717"
},
"devDependencies": {
"babel-core": "6.26.0",
Expand Down
17 changes: 8 additions & 9 deletions src/core/stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export default class Stack {
this.config = config;
this.cachePolicy = CacheProvider.policies.IGNORE_CACHE;
this.provider = CacheProvider.providers('localstorage');
console.error(stack_arguments.length);

switch (stack_arguments.length) {
case 1:
Expand Down Expand Up @@ -82,39 +81,39 @@ export default class Stack {
access_token: stack_arguments[1]
};
this.environment = stack_arguments[2];
return this;
} else {
console.error("Kindly provide valid string parameters.");
}
if (stack_arguments[3]) {
if (stack_arguments[3]) {
if(typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
config['host'] = stack_arguments[0].region+"-"+"cdn.contentstack.com";
config['host'] = stack_arguments[3]+"-"+"cdn.contentstack.com";
} else if (typeof stack_arguments[3] === 'object') {
this.fetchOptions = stack_arguments[3]
}
}
return this;
case 5:
if (typeof stack_arguments[0] === "string" && typeof stack_arguments[1] === "string" && typeof stack_arguments[2] === "string") {
this.headers = {
api_key: stack_arguments[0],
access_token: stack_arguments[1]
};
this.environment = stack_arguments[2];
return this;
} else {
console.error("Kindly provide valid string parameters.");
}

if (stack_arguments[3]) {
if(typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us" && stack_arguments[3].region === "eu") {
config['host'] = stack_arguments[0].region+"-"+"cdn.contentstack.com";
if(typeof stack_arguments[3] === "string" && stack_arguments[3].region !== "us") {
config['host'] = stack_arguments[3]+"-"+"cdn.contentstack.com";
} else if (typeof stack_arguments[3] === 'object') {
this.fetchOptions = stack_arguments[3]
}
}
if (stack_arguments[4] && typeof stack_arguments[4] === 'object') {
this.fetchOptions = stack_arguments[3]
this.fetchOptions = stack_arguments[4]
}

return this;
default:
console.error("Kindly provide valid parameters to initialize the Contentstack javascript-SDK Stack.");
}
Expand Down