openapi-node
Version:
A Node library to interact with the Wix Hive (RESTful API)
913 lines (353 loc) • 14.2 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>Wix openapi-node Module: Wix/Connect</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
<link type="text/css" rel="stylesheet" href="styles/site.spacelab.css">
</head>
<body>
<div class="container-fluid">
<div class="navbar navbar-fixed-top ">
<div class="navbar-inner">
<a class="brand" href="index.html">Wix openapi-node</a>
<ul class="nav">
<li class="dropdown">
<a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="API.html">Wix/API</a>
</li>
<li>
<a href="connect.html">wix/connect</a>
</li>
<li>
<a href="Connect_.html">Wix/Connect</a>
</li>
</ul>
</li>
<li class="dropdown">
<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b
class="caret"></b></a>
<ul class="dropdown-menu ">
<li>
<a href="Activities.html">Activities</a>
</li>
<li>
<a href="ActivityType.html">ActivityType</a>
</li>
<li>
<a href="APIBuilder.html">APIBuilder</a>
</li>
<li>
<a href="BaseWixAPIObject.html">BaseWixAPIObject</a>
</li>
<li>
<a href="Contact.html">Contact</a>
</li>
<li>
<a href="Contacts.html">Contacts</a>
</li>
<li>
<a href="Insights.html">Insights</a>
</li>
<li>
<a href="Wix.html">Wix</a>
</li>
<li>
<a href="WixActivity.html">WixActivity</a>
</li>
<li>
<a href="WixActivityData.html">WixActivityData</a>
</li>
<li>
<a href="WixAPICaller.html">WixAPICaller</a>
</li>
<li>
<a href="WixPagingData.html">WixPagingData</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="row-fluid">
<div class="span8">
<div id="main">
<h1 class="page-title">Module: Wix/Connect</h1>
<section>
<header>
<h2>
Wix/Connect
</h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixConnect.js
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<dl>
<dt>
<h4 class="name" id="WIX_API_ENTRY_POINT"><span class="type-signature"><static> </span>WIX_API_ENTRY_POINT<span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>The URL for the Wix RESTful API</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixConnect.js
</li></ul></dd>
</dl>
</dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="parseInstance"><span class="type-signature"><static> </span>parseInstance<span class="signature">(instance, secret, validator)</span><span class="type-signature"> → {<a href="Connect_.html#WixInstanceData">module:Wix/Connect.WixInstanceData</a>}</span></h4>
</dt>
<dd>
<div class="description">
<p>Parses a Wix instance and verifies the data. Either returns an object or throws an exception</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>instance</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>the instance parameter sent by Wix</p></td>
</tr>
<tr>
<td class="name"><code>secret</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>your application's secret key</p></td>
</tr>
<tr>
<td class="name"><code>validator</code></td>
<td class="type">
<span class="param-type"><a href="Connect_.html#WixDateValidator">module:Wix/Connect~WixDateValidator</a></span>
</td>
<td class="attributes">
<nullable><br>
</td>
<td class="description last"><p>an optional data validator</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixConnect.js
</li></ul></dd>
</dl>
<h5>Throws:</h5>
<div class="param-desc">
an exception if signatures don't match
</div>
<h5>Returns:</h5>
<div class="param-desc">
<ul>
<li>a JSON object containing information from Wix about the requester</li>
</ul>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="Connect_.html#WixInstanceData">module:Wix/Connect.WixInstanceData</a></span>
</dd>
</dl>
</dd>
</dl>
<h3 class="subsection-title">Type Definitions</h3>
<dl>
<dt>
<h4 class="name" id="WixInstanceData">WixInstanceData</h4>
</dt>
<dd>
<div class="description">
<p>Information about the requesting site</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<dl class="details">
<h5 class="subsection-title">Properties:</h5>
<dl>
<table class="props table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Argument</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>instanceId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The instanceId</p></td>
</tr>
<tr>
<td class="name"><code>signDate</code></td>
<td class="type">
<span class="param-type">Date</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>the date this request was signed</p></td>
</tr>
<tr>
<td class="name"><code>uid</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
<nullable><br>
</td>
<td class="description last"><p>The ID of the site-member that is currently logged in (optional)</p></td>
</tr>
<tr>
<td class="name"><code>permissions</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>The permission set of the site member. At this point, the permissions have the value OWNER if the uid is of the site owner. Otherwise, the permissions member will be empty.</p></td>
</tr>
<tr>
<td class="name"><code>vendorProductId</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>Premium Package ID, as was entered in the Dev Center during the app registration process</p></td>
</tr>
</tbody>
</table>
</dl>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixConnect.js
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="WixDateValidator"><span class="type-signature"></span>WixDateValidator<span class="signature">(date)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
<p>A callback that validates that a date sent from Wix is within a certain range. Defaults to 30 seconds</p>
</div>
<h5>Parameters:</h5>
<table class="params table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>date</code></td>
<td class="type">
<span class="param-type">Date</span>
</td>
<td class="description last"><p>the Date from the signed Wix request</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
WixConnect.js
</li></ul></dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<div class="clearfix"></div>
<footer>
<a href='http://dev.wix.com'>Wix Developer Center</a>
<br />
<span class="copyright">
2014, Wix
</span>
<br />
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a>
on Thu Jul 31 2014 17:22:21 GMT+0300 (IDT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>
<div class="span3">
<div id="toc"></div>
</div>
<br clear="both">
</div>
</div>
<script src="scripts/sunlight.js"></script>
<script src="scripts/sunlight.javascript.js"></script>
<script src="scripts/sunlight-plugin.doclinks.js"></script>
<script src="scripts/sunlight-plugin.linenumbers.js"></script>
<script src="scripts/sunlight-plugin.menu.js"></script>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.scrollTo.js"></script>
<script src="scripts/jquery.localScroll.js"></script>
<script src="scripts/bootstrap-dropdown.js"></script>
<script src="scripts/toc.js"></script>
<script> Sunlight.highlightAll({lineNumbers:false, showMenu: true, enableDoclinks :true}); </script>
<script>
$( function () {
$( "#toc" ).toc( {
selectors : "h1,h2,h3,h4",
showAndHide : false,
scrollTo : 60
} );
$( "#toc>ul" ).addClass( "nav nav-pills nav-stacked" );
$( "#main span[id^='toc']" ).addClass( "toc-shim" );
} );
</script>
</body>
</html>