Skip to content

Commit 02a67e6

Browse files
updated the sync Api method and testcases of sync
1 parent eb92c4e commit 02a67e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+25457
-1
lines changed

config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const config = {
22
protocol: "https",
3-
host: "dev-new-api.contentstack.io",
3+
host: "dev-cdn.contentstack.io",
44
port: 443,
55
version: "v3",
66
urls: {

js-sdk-reference.zip

604 KB
Binary file not shown.

js-sdk-reference_old/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Generating Contentstack SDK Docs
2+
To generate api reference documentation use the following command under the root directory.
3+
## Prerequisite
4+
JSDoc supports Node.js 4.2.0 and later. You can install JSDoc globally or in your project's node_modules folder.
5+
To install the latest version on npm globally (may require sudo; learn how to fix this):
6+
7+
```npm install -g jsdoc```
8+
9+
To install the latest version on npm locally and save it in your package's package.json file:
10+
11+
```npm install --save-dev jsdoc```
12+
13+
## Generate documentation
14+
15+
```jsdoc -c path/to/config/file```

js-sdk-reference_old/Result.html

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Result - Documentation</title>
6+
7+
<script src="scripts/prettify/prettify.js"></script>
8+
<script src="scripts/prettify/lang-css.js"></script>
9+
<!--[if lt IE 9]>
10+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11+
<![endif]-->
12+
<link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
13+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
14+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
15+
</head>
16+
<body>
17+
18+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
19+
<label for="nav-trigger" class="navicon-button x">
20+
<div class="navicon"></div>
21+
</label>
22+
23+
<label for="nav-trigger" class="overlay"></label>
24+
25+
<nav>
26+
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Result.html">Result</a></li></ul><h3>Global</h3><ul><li><a href="global.html#Contentstack">Contentstack</a></li><li><a href="global.html#CachePolicy">CachePolicy</a></li><li><a href="global.html#Stack">Stack</a></li><li><a href="global.html#setPort">setPort</a></li><li><a href="global.html#setProtocol">setProtocol</a></li><li><a href="global.html#setHost">setHost</a></li><li><a href="global.html#setCachePolicy">setCachePolicy</a></li><li><a href="global.html#setCacheProvider">setCacheProvider</a></li><li><a href="global.html#getCacheProvider">getCacheProvider</a></li><li><a href="global.html#ContentType">ContentType</a></li><li><a href="global.html#Entry">Entry</a></li><li><a href="global.html#Assets">Assets</a></li><li><a href="global.html#Query">Query</a></li><li><a href="global.html#imageTransform">imageTransform</a></li><li><a href="global.html#only">only</a></li><li><a href="global.html#toJSON">toJSON</a></li><li><a href="global.html#AddParam">AddParam</a></li><li><a href="global.html#fetch">fetch</a></li><li><a href="global.html#except">except</a></li><li><a href="global.html#includeReference">includeReference</a></li><li><a href="global.html#language">language</a></li><li><a href="global.html#addQuery">addQuery</a></li><li><a href="global.html#includeSchema">includeSchema</a></li><li><a href="global.html#includeContentType">includeContentType</a></li><li><a href="global.html#includeOwner">includeOwner</a></li><li><a href="global.html#lessThan">lessThan</a></li><li><a href="global.html#lessThanOrEqualTo">lessThanOrEqualTo</a></li><li><a href="global.html#greaterThan">greaterThan</a></li><li><a href="global.html#greaterThanOrEqualTo">greaterThanOrEqualTo</a></li><li><a href="global.html#notEqualTo">notEqualTo</a></li><li><a href="global.html#containedIn">containedIn</a></li><li><a href="global.html#notContainedIn">notContainedIn</a></li><li><a href="global.html#exists">exists</a></li><li><a href="global.html#notExists">notExists</a></li><li><a href="global.html#ascending">ascending</a></li><li><a href="global.html#descending">descending</a></li><li><a href="global.html#skip">skip</a></li><li><a href="global.html#limit">limit</a></li><li><a href="global.html#or">or</a></li><li><a href="global.html#and">and</a></li><li><a href="global.html#whereequalTo">where</a></li><li><a href="global.html#count">count</a></li><li><a href="global.html#query">query</a></li><li><a href="global.html#tags">tags</a></li><li><a href="global.html#includeCount">includeCount</a></li><li><a href="global.html#getQuery">getQuery</a></li><li><a href="global.html#regex">regex</a></li><li><a href="global.html#search">search</a></li><li><a href="global.html#find">find</a></li><li><a href="global.html#findOne">findOne</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#getDownloadUrl">getDownloadUrl</a></li></ul>
27+
</nav>
28+
29+
<div id="main">
30+
31+
<h1 class="page-title">Result</h1>
32+
33+
34+
35+
36+
37+
38+
<section>
39+
40+
<header>
41+
42+
<h2>
43+
Result
44+
</h2>
45+
46+
47+
</header>
48+
49+
<article>
50+
<div class="container-overview">
51+
52+
53+
54+
55+
56+
57+
<h4 class="name" id="Result"><span class="type-signature"></span>new Result<span class="signature">(object)</span><span class="type-signature"> &rarr; {<a href="Result.html">Result</a>}</span></h4>
58+
59+
60+
<p class="summary">Creates an instance of `Result`.</p>
61+
62+
63+
64+
65+
<div class="description">
66+
An initializer is responsible for creating Result object.
67+
</div>
68+
69+
70+
71+
72+
73+
74+
75+
76+
77+
<h5>Parameters:</h5>
78+
79+
80+
<table class="params">
81+
<thead>
82+
<tr>
83+
84+
<th>Name</th>
85+
86+
87+
88+
89+
90+
91+
<th class="last">Description</th>
92+
</tr>
93+
</thead>
94+
95+
<tbody>
96+
97+
98+
<tr>
99+
100+
<td class="name"><code>object</code></td>
101+
102+
103+
104+
105+
106+
107+
<td class="description last">API result object</td>
108+
</tr>
109+
110+
111+
</tbody>
112+
</table>
113+
114+
115+
116+
117+
118+
119+
<dl class="details">
120+
121+
122+
123+
124+
125+
126+
127+
128+
129+
130+
131+
132+
133+
134+
135+
136+
137+
138+
139+
140+
141+
142+
143+
144+
145+
146+
147+
148+
149+
150+
</dl>
151+
152+
153+
154+
155+
156+
157+
158+
159+
160+
161+
162+
163+
164+
<h5>Examples</h5>
165+
166+
<pre class="prettyprint"><code>blogEntry.then(function (result) {
167+
// sucess function
168+
},function (error) {
169+
// error function
170+
})</code></pre>
171+
172+
<pre class="prettyprint"><code>assetQuery.then(function (result) {
173+
// sucess function
174+
},function (error) {
175+
// error function
176+
})</code></pre>
177+
178+
179+
180+
181+
</div>
182+
183+
184+
185+
186+
187+
188+
189+
190+
191+
192+
193+
194+
195+
196+
197+
198+
199+
200+
</article>
201+
202+
</section>
203+
204+
205+
206+
207+
</div>
208+
209+
<br class="clear">
210+
211+
<footer>
212+
<div class="inner-content center">
213+
<span class="copy-right"><a href="mailto:[email protected]" target="_self">[email protected]</a> | © 2017 Contentstack. All rights reserved.</span>
214+
</div>
215+
</footer>
216+
217+
<script>prettyPrint();</script>
218+
<script src="scripts/linenumber.js"></script>
219+
</body>
220+
</html>
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>contentstack.js - Documentation</title>
6+
7+
<script src="scripts/prettify/prettify.js"></script>
8+
<script src="scripts/prettify/lang-css.js"></script>
9+
<!--[if lt IE 9]>
10+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11+
<![endif]-->
12+
<link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
13+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
14+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
15+
</head>
16+
<body>
17+
18+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
19+
<label for="nav-trigger" class="navicon-button x">
20+
<div class="navicon"></div>
21+
</label>
22+
23+
<label for="nav-trigger" class="overlay"></label>
24+
25+
<nav>
26+
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Result.html">Result</a></li></ul><h3>Global</h3><ul><li><a href="global.html#Contentstack">Contentstack</a></li><li><a href="global.html#CachePolicy">CachePolicy</a></li><li><a href="global.html#Stack">Stack</a></li><li><a href="global.html#setPort">setPort</a></li><li><a href="global.html#setProtocol">setProtocol</a></li><li><a href="global.html#setHost">setHost</a></li><li><a href="global.html#setCachePolicy">setCachePolicy</a></li><li><a href="global.html#setCacheProvider">setCacheProvider</a></li><li><a href="global.html#getCacheProvider">getCacheProvider</a></li><li><a href="global.html#ContentType">ContentType</a></li><li><a href="global.html#Entry">Entry</a></li><li><a href="global.html#Assets">Assets</a></li><li><a href="global.html#Query">Query</a></li><li><a href="global.html#imageTransform">imageTransform</a></li><li><a href="global.html#only">only</a></li><li><a href="global.html#toJSON">toJSON</a></li><li><a href="global.html#AddParam">AddParam</a></li><li><a href="global.html#fetch">fetch</a></li><li><a href="global.html#except">except</a></li><li><a href="global.html#includeReference">includeReference</a></li><li><a href="global.html#language">language</a></li><li><a href="global.html#addQuery">addQuery</a></li><li><a href="global.html#includeSchema">includeSchema</a></li><li><a href="global.html#includeContentType">includeContentType</a></li><li><a href="global.html#includeOwner">includeOwner</a></li><li><a href="global.html#lessThan">lessThan</a></li><li><a href="global.html#lessThanOrEqualTo">lessThanOrEqualTo</a></li><li><a href="global.html#greaterThan">greaterThan</a></li><li><a href="global.html#greaterThanOrEqualTo">greaterThanOrEqualTo</a></li><li><a href="global.html#notEqualTo">notEqualTo</a></li><li><a href="global.html#containedIn">containedIn</a></li><li><a href="global.html#notContainedIn">notContainedIn</a></li><li><a href="global.html#exists">exists</a></li><li><a href="global.html#notExists">notExists</a></li><li><a href="global.html#ascending">ascending</a></li><li><a href="global.html#descending">descending</a></li><li><a href="global.html#skip">skip</a></li><li><a href="global.html#limit">limit</a></li><li><a href="global.html#or">or</a></li><li><a href="global.html#and">and</a></li><li><a href="global.html#whereequalTo">where</a></li><li><a href="global.html#count">count</a></li><li><a href="global.html#query">query</a></li><li><a href="global.html#tags">tags</a></li><li><a href="global.html#includeCount">includeCount</a></li><li><a href="global.html#getQuery">getQuery</a></li><li><a href="global.html#regex">regex</a></li><li><a href="global.html#search">search</a></li><li><a href="global.html#find">find</a></li><li><a href="global.html#findOne">findOne</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#getDownloadUrl">getDownloadUrl</a></li></ul>
27+
</nav>
28+
29+
<div id="main">
30+
31+
<h1 class="page-title">contentstack.js</h1>
32+
33+
34+
35+
36+
37+
38+
<section>
39+
<article>
40+
<pre class="prettyprint source linenums"><code>import Stack from "./stack";
41+
import CacheProvider from './cache-provider/index';
42+
43+
/**
44+
* @method Contentstack
45+
* @description Creates an instance of `Contentstack`.
46+
* @api public
47+
*/
48+
class Contentstack {
49+
50+
constructor(){
51+
/**
52+
* @constant CachePolicy
53+
* @description CachePolicy contains different cache policies constants.
54+
* @example
55+
* Contentstack.CachePolicy.IGNORE_CACHE
56+
* Contentstack.CachePolicy.ONLY_NETWORK
57+
* Contentstack.CachePolicy.CACHE_ELSE_NETWORK
58+
* Contentstack.CachePolicy.NETWORK_ELSE_CACHE
59+
* Contentstack.CachePolicy.CACHE_THEN_NETWORK
60+
*/
61+
this.CachePolicy = CacheProvider.policies;
62+
}
63+
64+
/**
65+
* @method Stack
66+
* @description Initialize "Built.io Contentstack" Stack javascript-SDK instance
67+
* @api public
68+
* @example
69+
* var Stack = Contentstack.Stack('api_key', 'access_token', 'environment');
70+
* OR
71+
* var Stack = Contentstack.Stack({
72+
* 'api_key':'bltsomethingapikey',
73+
* 'access_token':'bltsomethongtoken',
74+
* 'environment':'environment_name'
75+
* });
76+
*
77+
* @returns {Stack}
78+
*/
79+
Stack(...stack_arguments){
80+
return new Stack(...stack_arguments);
81+
}
82+
}
83+
84+
module.exports = new Contentstack();
85+
</code></pre>
86+
</article>
87+
</section>
88+
89+
90+
91+
92+
</div>
93+
94+
<br class="clear">
95+
96+
<footer>
97+
<div class="inner-content center">
98+
<span class="copy-right"><a href="mailto:[email protected]" target="_self">[email protected]</a> | © 2017 Contentstack. All rights reserved.</span>
99+
</div>
100+
</footer>
101+
102+
<script>prettyPrint();</script>
103+
<script src="scripts/linenumber.js"></script>
104+
</body>
105+
</html>

0 commit comments

Comments
 (0)