Skip to content
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
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Change log


### Version: 3.13.2
#### Date: May-26-2021
##### Dependency:
- Update Utils SDK dependency version

### Version: 3.13.1
#### Date: Apr-16-2021
##### Bug fix:
Expand Down
6 changes: 3 additions & 3 deletions dist/nativescript/contentstack.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/node/contentstack.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/react-native/contentstack.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/node/contentstack-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ContentstackDemo {
*/
getEntries(contentTypeUid) {
contentTypeUid = contentTypeUid || 'source'
return this.Stack.ContentType('test').Query().includeContentType().toJSON().find()
return this.Stack.ContentType(contentTypeUid).Query().includeContentType().toJSON().find()
//return this.Stack.getContentTypes(contentTypeUid)

}
Expand Down
2 changes: 1 addition & 1 deletion examples/node/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict'

const ContentstackDemo = require('./contentstack-demo.js')
const Demo = new ContentstackDemo({ 'api_key': 'blt1b0a32d0c621f844', 'delivery_token': 'csaba2e2b6a51971b00ea373ea', 'environment': 'development', })
const Demo = new ContentstackDemo({ 'api_key': 'blt123something', 'delivery_token': 'blt123something', 'environment': 'development', })


//get all the entries
Expand Down
22 changes: 7 additions & 15 deletions js-sdk-reference/Stack.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h2>



<h4 class="name" id="Stack"><span class="type-signature"></span>new Stack<span class="signature">(api_key, delivery_token, environment, region, fetchOptions)</span><span class="type-signature"> &rarr; {<a href="Stack.html">Stack</a>}</span></h4>
<h4 class="name" id="Stack"><span class="type-signature"></span>new Stack<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Stack.html">Stack</a>}</span></h4>



Expand Down Expand Up @@ -105,7 +105,7 @@ <h5>Parameters:</h5>

<tr>

<td class="name"><code>api_key</code></td>
<td class="name"><code>stack.api_key</code></td>



Expand All @@ -119,7 +119,7 @@ <h5>Parameters:</h5>

<tr>

<td class="name"><code>delivery_token</code></td>
<td class="name"><code>stack.delivery_token</code></td>



Expand All @@ -133,7 +133,7 @@ <h5>Parameters:</h5>

<tr>

<td class="name"><code>environment</code></td>
<td class="name"><code>stack.environment</code></td>



Expand All @@ -147,7 +147,7 @@ <h5>Parameters:</h5>

<tr>

<td class="name"><code>region</code></td>
<td class="name"><code>stack.region</code></td>



Expand All @@ -161,7 +161,7 @@ <h5>Parameters:</h5>

<tr>

<td class="name"><code>fetchOptions</code></td>
<td class="name"><code>stack.fetchOptions</code></td>



Expand Down Expand Up @@ -333,7 +333,7 @@ <h6>Properties</h6>



<h5>Examples</h5>
<h5>Example</h5>

<pre class="prettyprint"><code>var Stack = Contentstack.Stack({
'api_key':'api_key',
Expand All @@ -345,14 +345,6 @@ <h5>Examples</h5>
}
});</code></pre>

<pre class="prettyprint"><code>var Stack = Contentstack.Stack('api_key', 'access_token', 'environment', {

});</code></pre>

<pre class="prettyprint"><code>// For Setting the European Region:
// If you want to set and use European region, refer to the code below:
const Stack = Contentstack.Stack("api_key", "delivery_token", "environment_name", Contentstack.Region.EU);</code></pre>




Expand Down
2 changes: 1 addition & 1 deletion js-sdk-reference/modules_assets.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ <h1 class="page-title">modules/assets.js</h1>
query: this._query
}
}
var options = Object.assign({}, this.fetchOptions, fetchOptions);
var options = Utils.mergeDeep({}, this.fetchOptions, fetchOptions);
return Utils.sendRequest(this, options);
} else {
console.error("Kindly provide an asset uid. e.g. .Assets('bltsomething123')");
Expand Down
2 changes: 1 addition & 1 deletion js-sdk-reference/modules_entry.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ <h1 class="page-title">modules/entry.js</h1>
query: this._query
}
};
var options = Object.assign({}, this.fetchOptions, fetchOptions);
var options = Utils.mergeDeep({}, this.fetchOptions, fetchOptions);
return Utils.sendRequest(this, options);
} else {
console.error("Kindly provide an entry uid. e.g. .Entry('bltsomething123')");
Expand Down
4 changes: 2 additions & 2 deletions js-sdk-reference/modules_query.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ <h1 class="page-title">modules/query.js</h1>
query: this._query
}
};
var options = Object.assign({}, this.fetchOptions, fetchOptions);
var options = Utils.mergeDeep({}, this.fetchOptions, fetchOptions);
return Utils.sendRequest(this, options);
}

Expand Down Expand Up @@ -839,7 +839,7 @@ <h1 class="page-title">modules/query.js</h1>
query: this._query
}
};
var options = Object.assign({}, this.fetchOptions);
var options = Utils.mergeDeep({}, this.fetchOptions);
return Utils.sendRequest(this, options);
}

Expand Down
49 changes: 20 additions & 29 deletions js-sdk-reference/stack.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,18 @@ <h1 class="page-title">stack.js</h1>
* @class
Stack
* @description Initialize an instance of ‘Stack’
* @param api_key - Stack API Key.
* @param delivery_token - Stack Delivery token.
* @param environment - Stack Environment name.
* @param region - DB region for Stack.
* @param fetchOptions - Custom setting for the request.
* @param fetchOptions.timeout - Set timeout for the request.
* @param fetchOptions.retryLimit - The number of retries before failure. Default is 5
* @param fetchOptions.retryDelay - The number of ms to use for operation retries. Default is 300ms
* @param fetchOptions.retryCondition - A function to determine if the error can be retried. Default retry is on status codes 408, 429.
* @param fetchOptions.retryDelayOptions.base - The base number of milliseconds to use in the exponential backoff for operation retries.
* @param fetchOptions.retryDelayOptions.customBackoff - A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds.

* @param {String} stack.api_key - Stack API Key.
* @param {String} stack.delivery_token - Stack Delivery token.
* @param {String} stack.environment - Stack Environment name.
* @param {String} stack.region - DB region for Stack.
* @param {Object} stack.fetchOptions - Custom setting for the request.
* @param {number} stack.fetchOptions.timeout - Set timeout for the request.
* @param {number} stack.fetchOptions.retryLimit - The number of retries before failure. Default is 5
* @param {number} stack.fetchOptions.retryDelay - The number of ms to use for operation retries. Default is 300ms
* @param {function} stack.fetchOptions.retryCondition - A function to determine if the error can be retried. Default retry is on status codes 408, 429.
* @param {function} stack.fetchOptions.retryDelayOptions.base - The base number of milliseconds to use in the exponential backoff for operation retries.
* @param {function} stack.fetchOptions.retryDelayOptions.customBackoff - A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds.
* @example
* var Stack = Contentstack.Stack({
* 'api_key':'api_key',
Expand All @@ -82,16 +83,6 @@ <h1 class="page-title">stack.js</h1>
* }
* });
*
* @example
* var Stack = Contentstack.Stack('api_key', 'access_token', 'environment', {
*
* });
*
* @example
* // For Setting the European Region:
* // If you want to set and use European region, refer to the code below:
* const Stack = Contentstack.Stack("api_key", "delivery_token", "environment_name", Contentstack.Region.EU);
*
* @returns {Stack}
* @instance
*/
Expand All @@ -106,14 +97,14 @@ <h1 class="page-title">stack.js</h1>
return false
}
};
this.config = Object.assign({}, config)
this.config = Utils.mergeDeep({}, config)

if(stack_arguments[0].region &amp;&amp; stack_arguments[0].region !== undefined &amp;&amp; stack_arguments[0].region !== "us") {
this.config['host'] = stack_arguments[0].region+"-"+"cdn.contentstack.com";
}

if (stack_arguments[0].fetchOptions &amp;&amp; stack_arguments[0].fetchOptions !== undefined) {
this.fetchOptions = Object.assign(this.fetchOptions, stack_arguments[0].fetchOptions);
this.fetchOptions = Utils.mergeDeep(this.fetchOptions, stack_arguments[0].fetchOptions);
}

this.cachePolicy = CacheProvider.policies.IGNORE_CACHE;
Expand Down Expand Up @@ -156,7 +147,7 @@ <h1 class="page-title">stack.js</h1>
if(typeof stack_arguments[3] === "string" &amp;&amp; stack_arguments[3] !== undefined &amp;&amp; stack_arguments[3] !== "us") {
this.config['host'] = stack_arguments[3]+"-"+"cdn.contentstack.com";
} else if (typeof stack_arguments[3] === 'object') {
this.fetchOptions = Object.assign(this.fetchOptions, stack_arguments[3]);
this.fetchOptions = Utils.mergeDeep(this.fetchOptions, stack_arguments[3]);
}
}
return this;
Expand All @@ -175,11 +166,11 @@ <h1 class="page-title">stack.js</h1>
if(typeof stack_arguments[3] === "string" &amp;&amp; stack_arguments[3] !== undefined &amp;&amp; stack_arguments[3] !== "us") {
this.config['host'] = stack_arguments[3]+"-"+"cdn.contentstack.com";
} else if (typeof stack_arguments[3] === 'object') {
this.fetchOptions = Object.assign(this.fetchOptions, stack_arguments[3]);
this.fetchOptions = Utils.mergeDeep(this.fetchOptions, stack_arguments[3]);
}
}
if (stack_arguments[4] &amp;&amp; typeof stack_arguments[4] === 'object') {
this.fetchOptions = Object.assign(this.fetchOptions, stack_arguments[4]);
this.fetchOptions = Utils.mergeDeep(this.fetchOptions, stack_arguments[4]);
}
return this;
default:
Expand Down Expand Up @@ -402,7 +393,7 @@ <h1 class="page-title">stack.js</h1>
environment: this.environment
}
};
var options = Object.assign({}, this.fetchOptions, fetchOptions);
var options = Utils.mergeDeep({}, this.fetchOptions, fetchOptions);
return Request(result, options);
}

Expand Down Expand Up @@ -546,7 +537,7 @@ <h1 class="page-title">stack.js</h1>

sync(params, fetchOptions) {
this._query = {};
this._query = Object.assign(this._query, params);
this._query = Utils.mergeDeep(this._query, params);
this.requestParams = {
method: 'POST',
headers: this.headers,
Expand All @@ -556,7 +547,7 @@ <h1 class="page-title">stack.js</h1>
query: this._query
}
}
var options = Object.assign({}, this.fetchOptions, fetchOptions);
var options = Utils.mergeDeep({}, this.fetchOptions, fetchOptions);
return Utils.sendRequest(this, options);
}

Expand Down
Loading