fluro
Version:
Promise based HTTP Fluro client for the browser and node.js
1,932 lines (508 loc) • 30 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>types - 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="styles/prettify.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
<script src="scripts/nav.js" defer></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</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 >
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="access.html">access</a><ul class='methods'><li data-type='method'><a href="access.html#.addEventListener">addEventListener</a></li><li data-type='method'><a href="access.html#.can">can</a></li><li data-type='method'><a href="access.html#.canDeleteItem">canDeleteItem</a></li><li data-type='method'><a href="access.html#.canEditItem">canEditItem</a></li><li data-type='method'><a href="access.html#.canKnowOf">canKnowOf</a></li><li data-type='method'><a href="access.html#.canViewItem">canViewItem</a></li><li data-type='method'><a href="access.html#.has">has</a></li><li data-type='method'><a href="access.html#.isAuthor">isAuthor</a></li><li data-type='method'><a href="access.html#.removeAllListeners">removeAllListeners</a></li><li data-type='method'><a href="access.html#.removeEventListener">removeEventListener</a></li><li data-type='method'><a href="access.html#.retrieveActionableRealms">retrieveActionableRealms</a></li><li data-type='method'><a href="access.html#.retrieveCurrentSession">retrieveCurrentSession</a></li><li data-type='method'><a href="access.html#.setDefaultApplication">setDefaultApplication</a></li></ul></li><li><a href="api.html">api</a><ul class='methods'><li data-type='method'><a href="api.html#.delete">delete</a></li><li data-type='method'><a href="api.html#.generateEndpointURL">generateEndpointURL</a></li><li data-type='method'><a href="api.html#.get">get</a></li><li data-type='method'><a href="api.html#.post">post</a></li><li data-type='method'><a href="api.html#.put">put</a></li></ul></li><li><a href="app.device.html">device</a></li><li><a href="asset.html">asset</a><ul class='methods'><li data-type='method'><a href="asset.html#.avatarUrl">avatarUrl</a></li><li data-type='method'><a href="asset.html#.downloadUrl">downloadUrl</a></li><li data-type='method'><a href="asset.html#.filesize">filesize</a></li><li data-type='method'><a href="asset.html#.getUrl">getUrl</a></li><li data-type='method'><a href="asset.html#.imageUrl">imageUrl</a></li><li data-type='method'><a href="asset.html#.playerUrl">playerUrl</a></li><li data-type='method'><a href="asset.html#.posterUrl">posterUrl</a></li><li data-type='method'><a href="asset.html#.typeFromMime">typeFromMime</a></li></ul></li><li><a href="auth.html">auth</a><ul class='methods'><li data-type='method'><a href="auth.html#.addEventListener">addEventListener</a></li><li data-type='method'><a href="auth.html#.changeAccount">changeAccount</a></li><li data-type='method'><a href="auth.html#.getCurrentToken">getCurrentToken</a></li><li data-type='method'><a href="auth.html#.getCurrentUser">getCurrentUser</a></li><li data-type='method'><a href="auth.html#.impersonate">impersonate</a></li><li data-type='method'><a href="auth.html#.login">login</a></li><li data-type='method'><a href="auth.html#.logout">logout</a></li><li data-type='method'><a href="auth.html#.refreshAccessToken">refreshAccessToken</a></li><li data-type='method'><a href="auth.html#.removeAllListeners">removeAllListeners</a></li><li data-type='method'><a href="auth.html#.removeEventListener">removeEventListener</a></li><li data-type='method'><a href="auth.html#.retrieveUserFromResetToken">retrieveUserFromResetToken</a></li><li data-type='method'><a href="auth.html#.sendResetPasswordRequest">sendResetPasswordRequest</a></li><li data-type='method'><a href="auth.html#.set">set</a></li><li data-type='method'><a href="auth.html#.signup">signup</a></li><li data-type='method'><a href="auth.html#.updateUserWithToken">updateUserWithToken</a></li></ul></li><li><a href="cache.html">cache</a><ul class='methods'><li data-type='method'><a href="cache.html#.get">get</a></li><li data-type='method'><a href="cache.html#.reset">reset</a></li></ul></li><li><a href="components.html">components</a><ul class='methods'><li data-type='method'><a href="components.html#.hydrateModel">hydrateModel</a></li></ul></li><li><a href="content.html">content</a><ul class='methods'><li data-type='method'><a href="content.html#.duplicate">duplicate</a></li><li data-type='method'><a href="content.html#.external">external</a></li><li data-type='method'><a href="content.html#.filter">filter</a></li><li data-type='method'><a href="content.html#.form">form</a></li><li data-type='method'><a href="content.html#.get">get</a></li><li data-type='method'><a href="content.html#.getMultiple">getMultiple</a></li><li data-type='method'><a href="content.html#.keys">keys</a></li><li data-type='method'><a href="content.html#.list">list</a></li><li data-type='method'><a href="content.html#.query">query</a></li><li data-type='method'><a href="content.html#.related">related</a></li><li data-type='method'><a href="content.html#.retrieve">retrieve</a></li><li data-type='method'><a href="content.html#.slug">slug</a></li><li data-type='method'><a href="content.html#.submitInteraction">submitInteraction</a></li><li data-type='method'><a href="content.html#.submitPost">submitPost</a></li><li data-type='method'><a href="content.html#.thread">thread</a></li><li data-type='method'><a href="content.html#.values">values</a></li></ul></li><li><a href="date.html">date</a><ul class='methods'><li data-type='method'><a href="date.html#.countdown">countdown</a></li><li data-type='method'><a href="date.html#.dateFromID">dateFromID</a></li><li data-type='method'><a href="date.html#.formatDate">formatDate</a></li><li data-type='method'><a href="date.html#.getAge">getAge</a></li><li data-type='method'><a href="date.html#.groupEventByDate">groupEventByDate</a></li><li data-type='method'><a href="date.html#.isDifferentTimezoneThanUser">isDifferentTimezoneThanUser</a></li><li data-type='method'><a href="date.html#.isMultiDayEvent">isMultiDayEvent</a></li><li data-type='method'><a href="date.html#.localDate">localDate</a></li><li data-type='method'><a href="date.html#.militaryTimestamp">militaryTimestamp</a></li><li data-type='method'><a href="date.html#.readableEventDate">readableEventDate</a></li><li data-type='method'><a href="date.html#.readableEventTime">readableEventTime</a></li><li data-type='method'><a href="date.html#.timeago">timeago</a></li><li data-type='method'><a href="date.html#.timeline">timeline</a></li><li data-type='method'><a href="date.html#.timestampToAmPm">timestampToAmPm</a></li><li data-type='method'><a href="date.html#.timezones">timezones</a></li></ul></li><li><a href="fluro.html">fluro</a></li><li><a href="types.html">types</a><ul class='methods'><li data-type='method'><a href="types.html#.all">all</a></li><li data-type='method'><a href="types.html#.basicTypes">basicTypes</a></li><li data-type='method'><a href="types.html#.get">get</a></li><li data-type='method'><a href="types.html#.mapDefinitionItems">mapDefinitionItems</a></li><li data-type='method'><a href="types.html#.parentType">parentType</a></li><li data-type='method'><a href="types.html#.postableTypes">postableTypes</a></li><li data-type='method'><a href="types.html#.readable">readable</a></li><li data-type='method'><a href="types.html#.reloadTerminology">reloadTerminology</a></li><li data-type='method'><a href="types.html#.retrieve">retrieve</a></li><li data-type='method'><a href="types.html#.subTypes">subTypes</a></li><li data-type='method'><a href="types.html#.term">term</a></li></ul></li><li><a href="utils.html">utils</a><ul class='methods'><li data-type='method'><a href="utils.html#.arrayIDs">arrayIDs</a></li><li data-type='method'><a href="utils.html#.comma">comma</a></li><li data-type='method'><a href="utils.html#.currencySymbol">currencySymbol</a></li><li data-type='method'><a href="utils.html#.errorMessage">errorMessage</a></li><li data-type='method'><a href="utils.html#.extractFromArray">extractFromArray</a></li><li data-type='method'><a href="utils.html#.formatCurrency">formatCurrency</a></li><li data-type='method'><a href="utils.html#.getDefaultValueForField">getDefaultValueForField</a></li><li data-type='method'><a href="utils.html#.getFlattenedFields">getFlattenedFields</a></li><li data-type='method'><a href="utils.html#.getStringID">getStringID</a></li><li data-type='method'><a href="utils.html#.guid">guid</a></li><li data-type='method'><a href="utils.html#.hash">hash</a></li><li data-type='method'><a href="utils.html#.injectScript">injectScript</a></li><li data-type='method'><a href="utils.html#.machineName">machineName</a></li><li data-type='method'><a href="utils.html#.mapParameters">mapParameters</a></li><li data-type='method'><a href="utils.html#.matchInArray">matchInArray</a></li><li data-type='method'><a href="utils.html#.processCardPrioritySort">processCardPrioritySort</a></li></ul></li><li><a href="video.html">video</a><ul class='methods'><li data-type='method'><a href="video.html#.hhmmss">hhmmss</a></li><li data-type='method'><a href="video.html#.readableMilliseconds">readableMilliseconds</a></li><li data-type='method'><a href="video.html#.readableSeconds">readableSeconds</a></li></ul></li></ul>
</nav>
<div id="main">
<h1 class="page-title">types</h1>
<section>
<header>
<h2>
types
</h2>
</header>
<article>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id=".terms"><span class="type-signature">(static) </span>terms<span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="fluro.types.js.html">fluro.types.js</a>, <a href="fluro.types.js.html#line327">line 327</a>
</li></ul></dd>
</dl>
<div class="description">
Retrieves all definitions available in the current account. Useful for making one request and caching
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".all"><span class="type-signature">(static) </span>all<span class="signature">(options)</span><span class="type-signature"> → {promise}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="fluro.types.js.html">fluro.types.js</a>, <a href="fluro.types.js.html#line298">line 298</a>
</li></ul></dd>
</dl>
<div class="description">
Retrieves all definitions available in the current account. Useful for making one request and caching
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">extra options for the request</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
An promise that will resolve to the array of definitions
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">promise</span>
</dd>
</dl>
<h4 class="name" id=".basicTypes"><span class="type-signature">(static) </span>basicTypes<span class="signature">()</span><span class="type-signature"> → {Array}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="fluro.types.js.html">fluro.types.js</a>, <a href="fluro.types.js.html#line548">line 548</a>
</li></ul></dd>
</dl>
<div class="description">
Retrieve an array of all basic types
</div>
<h5>Returns:</h5>
<div class="param-desc">
eg. 'service', 'concert', 'conference'
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Array</span>
</dd>
</dl>
<h4 class="name" id=".get"><span class="type-signature">(static) </span>get<span class="signature">(definedName, options)</span><span class="type-signature"> → {promise}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="fluro.types.js.html">fluro.types.js</a>, <a href="fluro.types.js.html#line216">line 216</a>
</li></ul></dd>
</dl>
<div class="description">
Retrieves a specified definition or primitive type object
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>definedName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The definition or type name you want to retrieve</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">extra options for the request</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
An promise that will resolve to the type definition from Fluro
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">promise</span>
</dd>
</dl>
<h4 class="name" id=".mapDefinitionItems"><span class="type-signature">(static) </span>mapDefinitionItems<span class="signature">(array, baseType)</span><span class="type-signature"> → {Array}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="fluro.types.js.html">fluro.types.js</a>, <a href="fluro.types.js.html#line252">line 252</a>
</li></ul></dd>
</dl>
<div class="description">
A helpful function for mapping an array of items into a grouped array broken up by definition
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>//Returns {something:[{title:'Demographic', plural:'Demographics', key:'demographic', entries:[{...},{...}]}]}
fluro.types.mapDefinitionItems([{title:'test', definition:'demographic'}], 'tag');</code></pre>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>array</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">An array of content items</td>
</tr>
<tr>
<td class="name"><code>baseType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The default base type to map, eg. 'tag', 'contact', 'event'</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
A mapped array broken up by definition
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Array</span>
</dd>
</dl>
<h4 class="name" id=".parentType"><span class="type-signature">(static) </span>parentType<span class="signature">(definitionName)</span><span class="type-signature"> → {String}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="fluro.types.js.html">fluro.types.js</a>, <a href="fluro.types.js.html#line528">line 528</a>
</li></ul></dd>
</dl>
<div class="description">
Input a definition name or basic type and receive the most basic _type of that definition
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>definitionName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The definition or _type</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
Eg. 'photo', 'service', or 'song'...
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
<h4 class="name" id=".postableTypes"><span class="type-signature">(static) </span>postableTypes<span class="signature">(definitionName, options)</span><span class="type-signature"> → {Array}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="fluro.types.js.html">fluro.types.js</a>, <a href="fluro.types.js.html#line681">line 681</a>
</li></ul></dd>
</dl>
<div class="description">
Input a definition name or basic type and receive the most basic _type of that definition
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>definitionName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The definition or _type</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Extra options</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
an array of definitions that can be posted
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Array</span>
</dd>
</dl>
<h4 class="name" id=".readable"><span class="type-signature">(static) </span>readable<span class="signature">(definitionName, plural)</span><span class="type-signature"> → {String}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="fluro.types.js.html">fluro.types.js</a>, <a href="fluro.types.js.html#line484">line 484</a>
</li></ul></dd>
</dl>
<div class="description">
Input a definition name or basic type and receive the human readable version of that type
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>definitionName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The definition or _type</td>
</tr>
<tr>
<td class="name"><code>plural</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">Whether to return it's plural version</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
Eg. 'Audio', 'Detail Sheet', or 'Events'...
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
<h4 class="name" id=".reloadTerminology"><span class="type-signature">(static) </span>reloadTerminology<span class="signature">()</span><span class="type-signature"> → {promise}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="fluro.types.js.html">fluro.types.js</a>, <a href="fluro.types.js.html#line399">line 399</a>
</li></ul></dd>
</dl>
<div class="description">
Retrieves a glossary of glossary for readable definition titles and plurals
</div>
<h5>Returns:</h5>
<div class="param-desc">
An promise that will resolve to the matching basic types or reject with the responding error
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">promise</span>
</dd>
</dl>
<h4 class="name" id=".retrieve"><span class="type-signature">(static) </span>retrieve<span class="signature">(types)</span><span class="type-signature"> → {promise}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="fluro.types.js.html">fluro.types.js</a>, <a href="fluro.types.js.html#line762">line 762</a>
</li></ul></dd>
</dl>
<div class="description">
Retrieves a list of specified types and their respective definitions
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>types</code></td>
<td class="type">
<span class="param-type">array</span>
</td>
<td class="description last">The names of the basic types you want to retrieve</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
An promise that will resolve to the matching basic types or reject with the responding error
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">promise</span>
</dd>
</dl>
<h4 class="name" id=".subTypes"><span class="type-signature">(static) </span>subTypes<span class="signature">(definitionName, includeBasicType)</span><span class="type-signature"> → {Array}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="fluro.types.js.html">fluro.types.js</a>, <a href="fluro.types.js.html#line565">line 565</a>
</li></ul></dd>
</dl>
<div class="description">
Input a definition name or basic type and receive the most basic _type of that definition
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>definitionName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The basic _type</td>
</tr>
<tr>
<td class="name"><code>includeBasicType</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">Whether to include the basic type definition in the results</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
eg. 'service', 'concert', 'conference'
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Array</span>
</dd>
</dl>
<h4 class="name" id=".term"><span class="type-signature">(static) </span>term<span class="signature">(definitionName)</span><span class="type-signature"> → {Object}</span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="fluro.types.js.html">fluro.types.js</a>, <a href="fluro.types.js.html#line513">line 513</a>
</li></ul></dd>
</dl>
<div class="description">
Input a definition name or basic type and receive the basic details about that definition
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>definitionName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The definition or _type</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
The details about this definition as defined in the glossary
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
</article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Jun 29 2021 08:38:17 GMT+1000 (Australian Eastern Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/polyfill.js"></script>
<script src="scripts/linenumber.js"></script>
</body>
</html>