datahub-nodejs-sdk
Version:
DataHub Node.js SDK
125 lines (88 loc) • 5.39 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Home - Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<li class="nav-link nav-home-link"><a href="index.html">Home</a></li><li class="nav-heading">Classes</li><li class="nav-heading"><span class="nav-item-type type-class">C</span><span class="nav-item-name"><a href="DataHubSDK.html">DataHubSDK</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DataHubSDK.html#getSceneData">getSceneData</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DataHubSDK.html#switchAllScenes">switchAllScenes</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DataHubSDK.html#switchMultiScenes">switchMultiScenes</a></span></li><li class="nav-item"><span class="nav-item-type type-function">F</span><span class="nav-item-name"><a href="DataHubSDK.html#switchScene">switchScene</a></span></li>
</nav>
<div id="main">
<section class="readme">
<article><h1><a href="https://github.com/macacajs/datahub-nodejs-sdk">datahub-nodejs-sdk</a></h1><p><a href="https://npmjs.org/package/datahub-nodejs-sdk"><img src="https://img.shields.io/npm/v/datahub-nodejs-sdk.svg?style=flat-square" alt="NPM version"></a>
<a href="https://travis-ci.org/macacajs/datahub-nodejs-sdk"><img src="https://img.shields.io/travis/macacajs/datahub-nodejs-sdk.svg?style=flat-square" alt="build status"></a>
<a href="https://codecov.io/gh/macacajs/datahub-nodejs-sdk/branch/master"><img src="https://img.shields.io/codecov/c/github/macacajs/datahub-nodejs-sdk.svg?style=flat-square" alt="Test coverage"></a>
<a href="http://nodejs.org/download/"><img src="https://img.shields.io/badge/node.js-%3E=_8-green.svg?style=flat-square" alt="node version"></a>
<a href="https://npmjs.org/package/datahub-nodejs-sdk"><img src="https://img.shields.io/npm/dm/datahub-nodejs-sdk.svg?style=flat-square" alt="npm download"></a></p>
<blockquote>
<p>DataHub Node.js SDK</p>
</blockquote>
<!-- GITCONTRIBUTOR_START -->
<h2>Contributors</h2><table>
<thead>
<tr>
<th style="text-align:center"><a href="https://github.com/zhangyuheng"><img src="https://avatars1.githubusercontent.com/u/2139038?v=4" width="100px;"/><br/><sub><b>zhangyuheng</b></sub></a><br/></th>
<th style="text-align:center"><a href="https://github.com/xudafeng"><img src="https://avatars1.githubusercontent.com/u/1011681?v=4" width="100px;"/><br/><sub><b>xudafeng</b></sub></a><br/></th>
<th style="text-align:center"><a href="https://github.com/zivyangll"><img src="https://avatars1.githubusercontent.com/u/11460601?v=4" width="100px;"/><br/><sub><b>zivyangll</b></sub></a><br/></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"></td>
</tr>
</tbody>
</table>
<p>This project follows the git-contributor <a href="https://github.com/xudafeng/git-contributor">spec</a>, auto updated at <code>Fri Feb 15 2019 23:07:40 GMT+0800</code>.</p>
<!-- GITCONTRIBUTOR_END -->
<h2>Installment</h2><pre class="prettyprint source lang-bash"><code>$ npm i datahub-nodejs-sdk --save-dev</code></pre><h2>Common Usage</h2><pre class="prettyprint source lang-javascript"><code>import DataHubSDK from 'datahub-nodejs-sdk';
const sdkClient = new DataHubSDK();
// switch currentScene for 'POST api/create' to 'sucess'
await sdkClient.switchScene({
hub: 'app',
pathname: 'api/create',
scene: 'success',
method: 'POST', // method is optional, default method is 'ALL'
})
// switch currentScene for 'GET api/read' to 'success'
// switch currentScene for 'DELETE api/delete' to 'success'
await sdkClient.switchMultiScenes([{
hub: 'app',
pathname: 'api/read',
scene: 'success',
method: 'GET', // method is optional, default method is 'ALL'
}, {
hub: 'app',
pathname: 'api/delete',
scene: 'success',
method: 'DELETE', // method is optional, default method is 'ALL'
}])
// switch all scenes for all pathnames under app to 'success'
await sdkClient.switchAllScenes({
hub: 'app',
scene: 'success',
})</code></pre><h2><a href="//macacajs.github.io/datahub-nodejs-sdk/">API Documents</a></h2><h2>License</h2><p>The MIT License (MIT)</p></article>
</section>
</div>
<br class="clear">
<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Feb 22 2019 16:32:31 GMT+0800 (CST) using the Minami theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>