|
| 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