@qikdev/sdk
Version:
Promise based Javascript SDK
2,585 lines (717 loc) • 41.8 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>content - 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#.actionableScopes">actionableScopes</a></li><li data-type='method'><a href="access.html#.allPermissions">allPermissions</a></li><li data-type='method'><a href="access.html#.allPermissionTypes">allPermissionTypes</a></li><li data-type='method'><a href="access.html#.allUserScopes">allUserScopes</a></li><li data-type='method'><a href="access.html#.canCreate">canCreate</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#.canEraseItem">canEraseItem</a></li><li data-type='method'><a href="access.html#.canKnowOf">canKnowOf</a></li><li data-type='method'><a href="access.html#.canListItem">canListItem</a></li><li data-type='method'><a href="access.html#.canRestoreItem">canRestoreItem</a></li><li data-type='method'><a href="access.html#.canViewItem">canViewItem</a></li><li data-type='method'><a href="access.html#.checkActionAccess">checkActionAccess</a></li><li data-type='method'><a href="access.html#.getAllDescendants">getAllDescendants</a></li><li data-type='method'><a href="access.html#.has">has</a></li><li data-type='method'><a href="access.html#.hasFeature">hasFeature</a></li><li data-type='method'><a href="access.html#.hashPermissions">hashPermissions</a></li><li data-type='method'><a href="access.html#.isAdministrator">isAdministrator</a></li><li data-type='method'><a href="access.html#.isAssignee">isAssignee</a></li><li data-type='method'><a href="access.html#.isOwner">isOwner</a></li></ul></li><li><a href="api.html">api</a><ul class='methods'><li data-type='method'><a href="api.html#.generateEndpointURL">generateEndpointURL</a></li></ul></li><li><a href="auth.html">auth</a><ul class='methods'><li data-type='method'><a href="auth.html#.changeOrganisation">changeOrganisation</a></li><li data-type='method'><a href="auth.html#.ensureValidToken">ensureValidToken</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#.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#.sync">sync</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="content.html">content</a><ul class='methods'><li data-type='method'><a href="content.html#.create">create</a></li><li data-type='method'><a href="content.html#.delete">delete</a></li><li data-type='method'><a href="content.html#.get">get</a></li><li data-type='method'><a href="content.html#.getFromSlug">getFromSlug</a></li><li data-type='method'><a href="content.html#.glossary">glossary</a></li><li data-type='method'><a href="content.html#.list">list</a></li><li data-type='method'><a href="content.html#.patch">patch</a></li><li data-type='method'><a href="content.html#.restore">restore</a></li><li data-type='method'><a href="content.html#.scopeGlossary">scopeGlossary</a></li><li data-type='method'><a href="content.html#.update">update</a></li><li data-type='method'><a href="content.html#.validateField">validateField</a></li><li data-type='method'><a href="content.html#.variables">variables</a></li></ul></li><li><a href="files.html">files</a><ul class='methods'><li data-type='method'><a href="files.html#.downloadUrl">downloadUrl</a></li><li data-type='method'><a href="files.html#.duration">duration</a></li><li data-type='method'><a href="files.html#.filesize">filesize</a></li><li data-type='method'><a href="files.html#.getBinaryTypeFromMime">getBinaryTypeFromMime</a></li><li data-type='method'><a href="files.html#.mediaUrl">mediaUrl</a></li></ul></li><li><a href="filter.html">filter</a><ul class='methods'><li data-type='method'><a href="filter.html#.activeFilterComparators">activeFilterComparators</a></li><li data-type='method'><a href="filter.html#.activeFilterKeys">activeFilterKeys</a></li><li data-type='method'><a href="filter.html#.activeFilterOperators">activeFilterOperators</a></li><li data-type='method'><a href="filter.html#.activeFilters">activeFilters</a></li><li data-type='method'><a href="filter.html#.activeFilterValues">activeFilterValues</a></li><li data-type='method'><a href="filter.html#.filterChangeString">filterChangeString</a></li><li data-type='method'><a href="filter.html#.isValidFilter">isValidFilter</a></li></ul></li><li><a href="geo.html">geo</a><ul class='methods'><li data-type='method'><a href="geo.html#.distance">distance</a></li><li data-type='method'><a href="geo.html#.getDefaultCountry">getDefaultCountry</a></li><li data-type='method'><a href="geo.html#.getDefaultTimezone">getDefaultTimezone</a></li><li data-type='method'><a href="geo.html#.getPosition">getPosition</a></li><li data-type='method'><a href="geo.html#.stopWatchPosition">stopWatchPosition</a></li><li data-type='method'><a href="geo.html#.watchPosition">watchPosition</a></li></ul></li><li><a href="module-QikStorage-CookieStorageAdapter.html">CookieStorageAdapter</a><ul class='methods'><li data-type='method'><a href="module-QikStorage-CookieStorageAdapter.html#getCookieOptions">getCookieOptions</a></li><li data-type='method'><a href="module-QikStorage-CookieStorageAdapter.html#isCookieMode">isCookieMode</a></li></ul></li><li><a href="module-QikStorage-LocalStorageAdapter.html">LocalStorageAdapter</a></li><li><a href="module-QikStorage-StorageAdapter.html">StorageAdapter</a><ul class='methods'><li data-type='method'><a href="module-QikStorage-StorageAdapter.html#clearUser">clearUser</a></li><li data-type='method'><a href="module-QikStorage-StorageAdapter.html#getAccessToken">getAccessToken</a></li><li data-type='method'><a href="module-QikStorage-StorageAdapter.html#getRefreshToken">getRefreshToken</a></li><li data-type='method'><a href="module-QikStorage-StorageAdapter.html#getTokenExpiry">getTokenExpiry</a></li><li data-type='method'><a href="module-QikStorage-StorageAdapter.html#getUser">getUser</a></li><li data-type='method'><a href="module-QikStorage-StorageAdapter.html#isAvailable">isAvailable</a></li><li data-type='method'><a href="module-QikStorage-StorageAdapter.html#setUser">setUser</a></li></ul></li><li><a href="socket.html">socket</a><ul class='methods'><li data-type='method'><a href="socket.html#.channel">channel</a></li><li data-type='method'><a href="socket.html#.close">close</a></li><li data-type='method'><a href="socket.html#.connect">connect</a></li><li data-type='method'><a href="socket.html#.reconnect">reconnect</a></li><li data-type='method'><a href="socket.html#.subscribe">subscribe</a></li><li data-type='method'><a href="socket.html#.unsubscribe">unsubscribe</a></li></ul></li><li><a href="system.html">system</a><ul class='methods'><li data-type='method'><a href="system.html#.countries">countries</a></li></ul></li><li><a href="utils.html">utils</a><ul class='methods'><li data-type='method'><a href="utils.html#.cleanValue">cleanValue</a></li><li data-type='method'><a href="utils.html#.comma">comma</a></li><li data-type='method'><a href="utils.html#.errorMessage">errorMessage</a></li><li data-type='method'><a href="utils.html#.exists">exists</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#.getTypeFromID">getTypeFromID</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#.id">id</a></li><li data-type='method'><a href="utils.html#.ids">ids</a></li><li data-type='method'><a href="utils.html#.isValidEmailAddress">isValidEmailAddress</a></li><li data-type='method'><a href="utils.html#.loadExternalScript">loadExternalScript</a></li><li data-type='method'><a href="utils.html#.loadExternalStyle">loadExternalStyle</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#.parseBoolean">parseBoolean</a></li><li data-type='method'><a href="utils.html#.parseDate">parseDate</a></li><li data-type='method'><a href="utils.html#.parseEmail">parseEmail</a></li><li data-type='method'><a href="utils.html#.parseInt">parseInt</a></li><li data-type='method'><a href="utils.html#.parseNumber">parseNumber</a></li><li data-type='method'><a href="utils.html#.parseURL">parseURL</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-QikStorage.html">QikStorage</a><ul class='methods'><li data-type='method'><a href="module-QikStorage.html#.createStorageAdapter">createStorageAdapter</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#EventDispatcher">EventDispatcher</a></li></ul>
</nav>
<div id="main">
<h1 class="page-title">content</h1>
<section>
<header>
<h2>
content
</h2>
</header>
<article>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id=".comparators"><span class="type-signature">(static, constant) </span>comparators<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="qik.content.js.html">qik.content.js</a>, <a href="qik.content.js.html#line248">line 248</a>
</li></ul></dd>
</dl>
<div class="description usertext">
Retrieves all available filter comparators for each data type
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>const {hash, available, types} = await sdk.content.comparators();
console.log(available) // {boolean:[{title:'Is equal to', operator:'equal'...}]}
console.log(hash) // {equal:[{title:'Is equal to', operator:'equal'...}]}</code></pre>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".create"><span class="type-signature">(static) </span>create<span class="signature">(type, input)</span><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="qik.content.js.html">qik.content.js</a>, <a href="qik.content.js.html#line751">line 751</a>
</li></ul></dd>
</dl>
<div class="description usertext">
Create an item
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>const result = await sdk.content.create('profile', {
firstName:'Mickey',
lastName:'Mouse',
gender:'male',
meta:{
scopes:['61eca4746971e75c1fc670cf'],
}
})</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>type</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The type or definition of the record we want to create</td>
</tr>
<tr>
<td class="name"><code>input</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">The data for our new record</td>
</tr>
</tbody>
</table>
<h4 class="name" id=".delete"><span class="type-signature">(static) </span>delete<span class="signature">(id)</span><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="qik.content.js.html">qik.content.js</a>, <a href="qik.content.js.html#line850">line 850</a>
</li></ul></dd>
</dl>
<div class="description usertext">
Delete an item from the database
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>const result = await sdk.content.delete('61eca4746971e75c1fc670cd')</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>id</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The id of the record we want to delete</td>
</tr>
</tbody>
</table>
<h4 class="name" id=".get"><span class="type-signature">(static) </span>get<span class="signature">(id)</span><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="qik.content.js.html">qik.content.js</a>, <a href="qik.content.js.html#line830">line 830</a>
</li></ul></dd>
</dl>
<div class="description usertext">
Get an item from the database, Only fields the user has permission to view will be returned
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>const result = await sdk.content.get('61eca4746971e75c1fc670cd')</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>id</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The id of the record we want to update</td>
</tr>
</tbody>
</table>
<h4 class="name" id=".getFromSlug"><span class="type-signature">(static) </span>getFromSlug<span class="signature">(slug)</span><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="qik.content.js.html">qik.content.js</a>, <a href="qik.content.js.html#line882">line 882</a>
</li></ul></dd>
</dl>
<div class="description usertext">
Retrieve an item from the database by providing it's 'slug'
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>const result = await sdk.content.getFromSlug('article:how-to-get-started')
const result = await sdk.content.getFromSlug('car:toyota-landcruiser')
const result = await sdk.content.getFromSlug('article:toyota-landcruiser')</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>slug</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The slug id of the record we want to retrieve
it must be provided as either `(type):(slug)`` or `(definition):(slug)`
(if unsure use the `meta.abs` absolute slug property of the item you are wanting to retrieve).</td>
</tr>
</tbody>
</table>
<h4 class="name" id=".glossary"><span class="type-signature">(static) </span>glossary<span class="signature">(options)</span><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="qik.content.js.html">qik.content.js</a>, <a href="qik.content.js.html#line136">line 136</a>
</li></ul></dd>
</dl>
<div class="description usertext">
Retrieves the glossary of all content types visible to the requesting user.
By default this will include all fields, validation, expressions and other configuration
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>const { article, profile } = await sdk.content.glossary({hash:true});
// Use compressed endpoint for faster loading
const glossary = await sdk.content.glossary({compressed:true});</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Additional options
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>hash</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">Whether to return the data as a keyed object
allowing for fast selection of specific content types, by default will return as an array</td>
</tr>
<tr>
<td class="name"><code>reload</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">Force glossary to reload and not be cached.
If false will retrieve content type data from the in memory cache</td>
</tr>
<tr>
<td class="name"><code>uncompressed</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">Use the uncompressed endpoint</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h4 class="name" id=".list"><span class="type-signature">(static) </span>list<span class="signature">(type, options)</span><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="qik.content.js.html">qik.content.js</a>, <a href="qik.content.js.html#line700">line 700</a>
</li></ul></dd>
</dl>
<div class="description usertext">
Retrieves a list of records matching the provided criteria
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>sdk.content.list('profile', {
search:'Jim',
page:{
size:50,
index:2,
},
sort:{
key:'age',
direction:'asc',
type:'integer',
},
filter:{
operator:'and',
filters:[{
key:'age',
comparator:'>',
value:5,
}],
},
})</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>type</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The type or definition of records we 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">The options for our query
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>search</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Freeform text keywords</td>
</tr>
<tr>
<td class="name"><code>sort</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">How to sort the results
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>key</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Which key to sort on</td>
</tr>
<tr>
<td class="name"><code>direction</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Which direction to sort on</td>
</tr>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">What type of data is being sorted</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>page</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Page configuration
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>size</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Page size</td>
</tr>
<tr>
<td class="name"><code>index</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Page index</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="name"><code>filter</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">How to filter the results</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h4 class="name" id=".patch"><span class="type-signature">(static) </span>patch<span class="signature">(id, input)</span><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="qik.content.js.html">qik.content.js</a>, <a href="qik.content.js.html#line807">line 807</a>
</li></ul></dd>
</dl>
<div class="description usertext">
Partially update and patch an item, Only fields the user has permission to edit will be updated
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>const result = await sdk.content.patch('61eca4746971e75c1fc670cd', {
firstName:'Mickey',
gender:'male',
})</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>id</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The id of the record we want to update</td>
</tr>
<tr>
<td class="name"><code>input</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">The data to update, this will be merged with existing data</td>
</tr>
</tbody>
</table>
<h4 class="name" id=".restore"><span class="type-signature">(static) </span>restore<span class="signature">(id)</span><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="qik.content.js.html">qik.content.js</a>, <a href="qik.content.js.html#line864">line 864</a>
</li></ul></dd>
</dl>
<div class="description usertext">
Restore a deleted item from the database
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>const result = await sdk.content.restore('61eca4746971e75c1fc670cd')</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>id</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The id of the record we want to restore</td>
</tr>
</tbody>
</table>
<h4 class="name" id=".scopeGlossary"><span class="type-signature">(static) </span>scopeGlossary<span class="signature">(options)</span><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="qik.content.js.html">qik.content.js</a>, <a href="qik.content.js.html#line206">line 206</a>
</li></ul></dd>
</dl>
<div class="description usertext">
Retrieves the scope glossary of all scopes the user can know about. This helps to convert a scope id into a human readable title.
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>const scopes = await sdk.content.scopeGlossary();</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Additional options
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>hash</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">Whether to return the data as a keyed object with each scopes _id as the key
allowing for fast selection of specific scopes, by default will return a structured tree</td>
</tr>
<tr>
<td class="name"><code>reload</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">Force the glossary to reload and not be cached.
If false will retrieve content type data from the in memory cache</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h4 class="name" id=".update"><span class="type-signature">(static) </span>update<span class="signature">(id, input)</span><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="qik.content.js.html">qik.content.js</a>, <a href="qik.content.js.html#line780">line 780</a>
</li></ul></dd>
</dl>
<div class="description usertext">
Update an item, Only fields the user has permission to view will be returned
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>const result = await sdk.content.update('61eca4746971e75c1fc670cd', {
firstName:'Minnie',
lastName:'Mouse',
gender:'female',
meta:{
scopes:['61eca4746971e75c1fc670cd'],
}
})</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>id</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">The id of the record we want to update</td>
</tr>
<tr>
<td class="name"><code>input</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">The data to update</td>
</tr>
</tbody>
</table>
<h4 class="name" id=".validateField"><span class="type-signature">(static) </span>validateField<span class="signature">(input, fieldDefinition, options)</span><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="qik.content.js.html">qik.content.js</a>, <a href="qik.content.js.html#line352">line 352</a>
</li></ul></dd>
</dl>
<div class="description usertext">
Checks if a certain input validates against a field definition
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>const validationResult = await sdk.content.validateField('Johnny Bobbins', {title:'Name', key:'firstName', type:'string', minimum:1, maximum:1, ...});
console.log(validationResult)
// Results in { valid:true }
const validationResult = await sdk.content.validateField('Johnny Bobbins', {title:'Number', key:'number', type:'integer', minimum:1, maximum:1, ...});
console.log(validationResult)
// Results in { valid:false, status:400, message:'Invalid number input for field' }</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>input</code></td>
<td class="type">
<span class="param-type">Any</span>
</td>
<td class="description last">The input to validate</td>
</tr>
<tr>
<td class="name"><code>fieldDefinition</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">The field to validate against</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Additional options when calling the function</td>
</tr>
</tbody>
</table>
<h4 class="name" id=".variables"><span class="type-signature">(static) </span>variables<span class="signature">(keys, options)</span><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="qik.content.js.html">qik.content.js</a>, <a href="qik.content.js.html#line40">line 40</a>
</li></ul></dd>
</dl>
<div class="description usertext">
Retrieves all global variables for the current user. This is often used when running custom code in an action.
</div>
<h5>Example</h5>
<pre class="prettyprint"><code>const { OAUTH_CLIENT_ID, OAUTH_KEY } = await sdk.content.variables();</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>keys</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">Provide specific keys of variables 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">Additional options when making the request
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>reload</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="description last">Force variables to reload and not be cached. If false will retrieve any variables that are already known from the in memory cache.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon Jul 13 2026 18:49:48 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>