@qikdev/sdk 1.0.1 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/access.html +16371 -0
- package/dist/api.html +1503 -0
- package/dist/auth.html +8455 -0
- package/dist/cache.html +1135 -0
- package/dist/content.html +10067 -0
- package/dist/files.html +3415 -0
- package/dist/filter.html +4973 -0
- package/dist/geo.html +3851 -0
- package/dist/global.html +328 -0
- package/dist/index.html +96 -0
- package/dist/main.js +1100 -1126
- package/dist/module-QikStorage-CookieStorageAdapter.html +1177 -0
- package/dist/module-QikStorage-LocalStorageAdapter.html +329 -0
- package/dist/module-QikStorage-StorageAdapter.html +3457 -0
- package/dist/module-QikStorage.html +1445 -0
- package/dist/qik.access.js.html +904 -0
- package/dist/qik.api.js.html +409 -0
- package/dist/{docs/qik.auth.js.html → qik.auth.js.html} +142 -104
- package/dist/qik.cache.js.html +125 -0
- package/dist/qik.content.js.html +967 -0
- package/dist/qik.core.js.html +322 -0
- package/dist/qik.files.js.html +249 -0
- package/dist/{docs/qik.filter.js.html → qik.filter.js.html} +2 -2
- package/dist/qik.geo.js.html +963 -0
- package/dist/qik.socket.js.html +451 -0
- package/dist/qik.storage.js.html +375 -0
- package/dist/qik.system.js.html +117 -0
- package/dist/qik.utils.js.html +1542 -0
- package/dist/socket.html +2975 -0
- package/dist/{docs/styles → styles}/jsdoc.css +2 -2
- package/dist/system.html +523 -0
- package/package.json +2 -2
- package/src/api/qik.access.js +2 -53
- package/src/api/qik.socket.js +51 -10
- package/src/version.js +1 -1
- package/dist/docs/access.html +0 -3826
- package/dist/docs/api.html +0 -1356
- package/dist/docs/auth.html +0 -2180
- package/dist/docs/cache.html +0 -351
- package/dist/docs/content.html +0 -2560
- package/dist/docs/files.html +0 -779
- package/dist/docs/filter.html +0 -1355
- package/dist/docs/index.html +0 -96
- package/dist/docs/qik.access.js.html +0 -790
- package/dist/docs/qik.api.js.html +0 -511
- package/dist/docs/qik.cache.js.html +0 -131
- package/dist/docs/qik.content.js.html +0 -918
- package/dist/docs/qik.core.js.html +0 -301
- package/dist/docs/qik.files.js.html +0 -219
- package/dist/docs/qik.socket.js.html +0 -416
- package/dist/docs/qik.system.js.html +0 -117
- package/dist/docs/qik.utils.js.html +0 -1467
- package/dist/docs/socket.html +0 -810
- package/dist/docs/system.html +0 -197
- /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Bold.eot +0 -0
- /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Bold.ttf +0 -0
- /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Bold.woff +0 -0
- /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Bold.woff2 +0 -0
- /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Regular.eot +0 -0
- /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Regular.ttf +0 -0
- /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Regular.woff +0 -0
- /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Regular.woff2 +0 -0
- /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -0
- /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -0
- /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- /package/dist/{docs/scripts → scripts}/collapse.js +0 -0
- /package/dist/{docs/scripts → scripts}/linenumber.js +0 -0
- /package/dist/{docs/scripts → scripts}/nav.js +0 -0
- /package/dist/{docs/scripts → scripts}/polyfill.js +0 -0
- /package/dist/{docs/scripts → scripts}/prettify/Apache-License-2.0.txt +0 -0
- /package/dist/{docs/scripts → scripts}/prettify/lang-css.js +0 -0
- /package/dist/{docs/scripts → scripts}/prettify/prettify.js +0 -0
- /package/dist/{docs/scripts → scripts}/search.js +0 -0
- /package/dist/{docs/styles → styles}/prettify.css +0 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>qik.core.js - Documentation</title>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<script src="scripts/prettify/prettify.js"></script>
|
|
10
|
+
<script src="scripts/prettify/lang-css.js"></script>
|
|
11
|
+
<!--[if lt IE 9]>
|
|
12
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
13
|
+
<![endif]-->
|
|
14
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
15
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
16
|
+
<script src="scripts/nav.js" defer></script>
|
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
|
|
21
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
22
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
23
|
+
<div class="navicon"></div>
|
|
24
|
+
</label>
|
|
25
|
+
|
|
26
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
27
|
+
|
|
28
|
+
<nav >
|
|
29
|
+
|
|
30
|
+
<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#.actionableScopes">actionableScopes</a></li><li data-type='method'><a href="access.html#.allPermissions">allPermissions</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#.allPermissionTypes">allPermissionTypes</a></li><li data-type='method'><a href="access.html#.allUserScopes">allUserScopes</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#.canCreate">canCreate</a></li><li data-type='method'><a href="access.html#.canDeleteItem">canDeleteItem</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#.canEditItem">canEditItem</a></li><li data-type='method'><a href="access.html#.canEraseItem">canEraseItem</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#.canKnowOf">canKnowOf</a></li><li data-type='method'><a href="access.html#.canListItem">canListItem</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#.canRestoreItem">canRestoreItem</a></li><li data-type='method'><a href="access.html#.canViewItem">canViewItem</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#.checkActionAccess">checkActionAccess</a></li><li data-type='method'><a href="access.html#.getAllDescendants">getAllDescendants</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#.has">has</a></li><li data-type='method'><a href="access.html#.hasFeature">hasFeature</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#.hashPermissions">hashPermissions</a></li><li data-type='method'><a href="access.html#.isAdministrator">isAdministrator</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#.isAssignee">isAssignee</a></li><li data-type='method'><a href="access.html#.isOwner">isOwner</a></li><li data-type='method'><a href="access.html#.isOwner">isOwner</a></li></ul></li><li></li><li><a href="api.html">api</a><ul class='methods'><li data-type='method'><a href="api.html#.generateEndpointURL">generateEndpointURL</a></li><li data-type='method'><a href="api.html#.generateEndpointURL">generateEndpointURL</a></li></ul></li><li></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#.changeOrganisation">changeOrganisation</a></li><li data-type='method'><a href="auth.html#.ensureValidToken">ensureValidToken</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#.getCurrentToken">getCurrentToken</a></li><li data-type='method'><a href="auth.html#.getCurrentUser">getCurrentUser</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#.impersonate">impersonate</a></li><li data-type='method'><a href="auth.html#.login">login</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#.logout">logout</a></li><li data-type='method'><a href="auth.html#.retrieveUserFromResetToken">retrieveUserFromResetToken</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#.sendResetPasswordRequest">sendResetPasswordRequest</a></li><li data-type='method'><a href="auth.html#.set">set</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#.sync">sync</a></li><li data-type='method'><a href="auth.html#.updateUserWithToken">updateUserWithToken</a></li><li data-type='method'><a href="auth.html#.updateUserWithToken">updateUserWithToken</a></li></ul></li><li></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#.get">get</a></li><li data-type='method'><a href="cache.html#.reset">reset</a></li><li data-type='method'><a href="cache.html#.reset">reset</a></li></ul></li><li></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#.create">create</a></li><li data-type='method'><a href="content.html#.delete">delete</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#.get">get</a></li><li data-type='method'><a href="content.html#.getFromSlug">getFromSlug</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#.glossary">glossary</a></li><li data-type='method'><a href="content.html#.list">list</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#.patch">patch</a></li><li data-type='method'><a href="content.html#.restore">restore</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#.scopeGlossary">scopeGlossary</a></li><li data-type='method'><a href="content.html#.update">update</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#.validateField">validateField</a></li><li data-type='method'><a href="content.html#.variables">variables</a></li><li data-type='method'><a href="content.html#.variables">variables</a></li></ul></li><li></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#.downloadUrl">downloadUrl</a></li><li data-type='method'><a href="files.html#.duration">duration</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#.filesize">filesize</a></li><li data-type='method'><a href="files.html#.getBinaryTypeFromMime">getBinaryTypeFromMime</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><li data-type='method'><a href="files.html#.mediaUrl">mediaUrl</a></li></ul></li><li></li><li><a href="filter.html">filter</a><ul class='methods'><li data-type='method'><a href="filter.html#.activeFilterKeys">activeFilterKeys</a></li><li data-type='method'><a href="filter.html#.activeFilterKeys">activeFilterKeys</a></li><li data-type='method'><a href="filter.html#.activeFilterKeys">activeFilterKeys</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#.activeFilterOperators">activeFilterOperators</a></li><li data-type='method'><a href="filter.html#.activeFilters">activeFilters</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#.activeFilterValues">activeFilterValues</a></li><li data-type='method'><a href="filter.html#.filterChangeString">filterChangeString</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><li data-type='method'><a href="filter.html#.isValidFilter">isValidFilter</a></li></ul></li><li></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#.distance">distance</a></li><li data-type='method'><a href="geo.html#.getDefaultCountry">getDefaultCountry</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#.getDefaultTimezone">getDefaultTimezone</a></li><li data-type='method'><a href="geo.html#.getPosition">getPosition</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#.stopWatchPosition">stopWatchPosition</a></li><li data-type='method'><a href="geo.html#.stopWatchPosition">stopWatchPosition</a></li><li data-type='method'><a href="geo.html#.stopWatchPosition">stopWatchPosition</a></li></ul></li><li></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#getCookieOptions">getCookieOptions</a></li><li data-type='method'><a href="module-QikStorage-CookieStorageAdapter.html#isCookieMode">isCookieMode</a></li><li data-type='method'><a href="module-QikStorage-CookieStorageAdapter.html#isCookieMode">isCookieMode</a></li></ul></li><li></li><li><a href="module-QikStorage-LocalStorageAdapter.html">LocalStorageAdapter</a></li><li></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#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#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#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#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#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#isAvailable">isAvailable</a></li><li data-type='method'><a href="module-QikStorage-StorageAdapter.html#setUser">setUser</a></li><li data-type='method'><a href="module-QikStorage-StorageAdapter.html#setUser">setUser</a></li></ul></li><li></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#.channel">channel</a></li><li data-type='method'><a href="socket.html#.close">close</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#.connect">connect</a></li><li data-type='method'><a href="socket.html#.reconnect">reconnect</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#.subscribe">subscribe</a></li><li data-type='method'><a href="socket.html#.unsubscribe">unsubscribe</a></li><li data-type='method'><a href="socket.html#.unsubscribe">unsubscribe</a></li></ul></li><li></li><li><a href="system.html">system</a><ul class='methods'><li data-type='method'><a href="system.html#.countries">countries</a></li><li data-type='method'><a href="system.html#.countries">countries</a></li></ul></li><li></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><li data-type='method'><a href="module-QikStorage.html#.createStorageAdapter">createStorageAdapter</a></li></ul></li><li></li></ul><h3>Global</h3><ul><li><a href="global.html#EventDispatcher">EventDispatcher</a></li></ul>
|
|
31
|
+
</nav>
|
|
32
|
+
|
|
33
|
+
<div id="main">
|
|
34
|
+
|
|
35
|
+
<h1 class="page-title">qik.core.js</h1>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
<section>
|
|
44
|
+
<article>
|
|
45
|
+
<pre class="prettyprint source linenums"><code>import QikAPI from './qik.api.js';
|
|
46
|
+
import QikAuth from './qik.auth.js';
|
|
47
|
+
import QikUtils from './qik.utils.js';
|
|
48
|
+
import QikFilter from './qik.filter.js';
|
|
49
|
+
import QikFiles from './qik.files.js';
|
|
50
|
+
import QikCache from './qik.cache.js';
|
|
51
|
+
import QikAccess from './qik.access.js';
|
|
52
|
+
import QikContent from './qik.content.js';
|
|
53
|
+
import QikSystem from './qik.system.js';
|
|
54
|
+
import QikGeo from './qik.geo.js';
|
|
55
|
+
import QikSocket from './qik.socket.js';
|
|
56
|
+
import { EventDispatcher } from './qik.utils.js';
|
|
57
|
+
|
|
58
|
+
///////////////////////////////////////
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Creates a new QikCore instance including all of the default sub modules
|
|
62
|
+
* @alias qik
|
|
63
|
+
* @constructor
|
|
64
|
+
* @param {Object} options
|
|
65
|
+
* @param {String} options.apiURL The remote URL of the Qik API you want to connect to. Options are 'staging', 'production' or you may set a specific URL eg. 'https://api.qik.io' (do not include trailing slash). If no value is provided, will default to 'production'.
|
|
66
|
+
* @param {String} options.applicationToken When running as a static application, (for example a website) you may set the application's access token before you initialize the Qik instance here.
|
|
67
|
+
* @param {Boolean} options.useHttpOnlyCookies When set to true, authentication tokens will be stored in secure httpOnly cookies instead of localStorage. This provides enhanced security against XSS attacks. Requires backend support for cookie-based authentication.
|
|
68
|
+
* @param {Object} options.cookieConfig Configuration options for cookie storage when useHttpOnlyCookies is true.
|
|
69
|
+
* @param {String} options.cookieConfig.domain Cookie domain (auto-detected if not specified).
|
|
70
|
+
* @param {Boolean} options.cookieConfig.secure Whether cookies should only be sent over HTTPS (default: true).
|
|
71
|
+
* @param {String} options.cookieConfig.sameSite SameSite cookie attribute ('strict', 'lax', or 'none', default: 'lax').
|
|
72
|
+
* @example
|
|
73
|
+
*
|
|
74
|
+
* //Import the Qik package
|
|
75
|
+
* import Qik from '@qikdev/sdk';
|
|
76
|
+
*
|
|
77
|
+
* //Create a new Qik instance with localStorage (default)
|
|
78
|
+
* var qik = new Qik();
|
|
79
|
+
*
|
|
80
|
+
* //Create a new Qik instance with httpOnly cookies
|
|
81
|
+
* var qik = new Qik({
|
|
82
|
+
* apiURL: 'production',
|
|
83
|
+
* useHttpOnlyCookies: true
|
|
84
|
+
* });
|
|
85
|
+
*
|
|
86
|
+
* //Request the current user session endpoint from the Qik API
|
|
87
|
+
* qik.api.get('/session').then(function(res) {
|
|
88
|
+
* console.log('User session is ', res.data);
|
|
89
|
+
* })
|
|
90
|
+
* .catch(function(err) {
|
|
91
|
+
* console.log('There was an error', err);
|
|
92
|
+
* });
|
|
93
|
+
*
|
|
94
|
+
* //Use the QikAsset package to generate an image url
|
|
95
|
+
* var link = qik.asset.imageUrl('5ca3d64dd2bb085eb9d450db', 1920, 1080)
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
import { version } from '../version.js';
|
|
99
|
+
|
|
100
|
+
export default function(options) {
|
|
101
|
+
if (!options) {
|
|
102
|
+
options = {
|
|
103
|
+
// apiURL,
|
|
104
|
+
// applicationToken,
|
|
105
|
+
// api:{}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
///////////////////////////////////////
|
|
110
|
+
|
|
111
|
+
if (!options.apiURL || !options.apiURL.length) {
|
|
112
|
+
options.apiURL = 'staging';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
///////////////////////////////////////
|
|
116
|
+
|
|
117
|
+
switch (String(options.apiURL).toLowerCase()) {
|
|
118
|
+
case 'production':
|
|
119
|
+
options.apiURL = 'https://api.qik.dev';
|
|
120
|
+
break;
|
|
121
|
+
case 'staging':
|
|
122
|
+
options.apiURL = 'https://api.staging.qik.dev';
|
|
123
|
+
break;
|
|
124
|
+
case 'local':
|
|
125
|
+
options.apiURL = 'http://api.qik.localhost:4001';
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
///////////////////////////////////////
|
|
130
|
+
|
|
131
|
+
const core = Object.assign(options, {
|
|
132
|
+
version,
|
|
133
|
+
global:{},
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
///////////////////////////////////////
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Provides a cache service, used for creating, clearing
|
|
141
|
+
* and storing API requests and other information in memory
|
|
142
|
+
* @type {QikCache}
|
|
143
|
+
*/
|
|
144
|
+
const cache = QikCache;
|
|
145
|
+
Object.defineProperty(core, 'cache', {
|
|
146
|
+
value: cache,
|
|
147
|
+
writable: false,
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
///////////////////////////////////////
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Provides helper functions for working
|
|
154
|
+
* with Qik data
|
|
155
|
+
* @type {QikUtils}
|
|
156
|
+
*/
|
|
157
|
+
const utils = QikUtils;
|
|
158
|
+
Object.defineProperty(core, 'utils', {
|
|
159
|
+
value: utils,
|
|
160
|
+
writable: false,
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
///////////////////////////////////////
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Provides helper functions for working
|
|
167
|
+
* with Qik filters
|
|
168
|
+
* @type {QikFilter}
|
|
169
|
+
*/
|
|
170
|
+
const filter = QikFilter;
|
|
171
|
+
Object.defineProperty(core, 'filter', {
|
|
172
|
+
value: filter,
|
|
173
|
+
writable: false,
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
///////////////////////////////////////
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Provides helper functions for working
|
|
182
|
+
* with Qik files
|
|
183
|
+
* @type {QikFiles}
|
|
184
|
+
*/
|
|
185
|
+
const files = new QikFiles(core);
|
|
186
|
+
Object.defineProperty(core, 'files', {
|
|
187
|
+
value: files,
|
|
188
|
+
writable: false,
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
///////////////////////////////////////
|
|
192
|
+
|
|
193
|
+
//Create a new global dispatcher so we can trigger events
|
|
194
|
+
const dispatcher = new EventDispatcher();
|
|
195
|
+
dispatcher.bootstrap(core);
|
|
196
|
+
|
|
197
|
+
//Set the function
|
|
198
|
+
core.error = function(err) {
|
|
199
|
+
//Dispatch an error event
|
|
200
|
+
return core.dispatch('error', utils.errorMessage(err));
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
//And enable notifications with a short message
|
|
204
|
+
core.notify = function(message, options) {
|
|
205
|
+
return core.dispatch('notification', { message, options });
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
///////////////////////////////////////
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* The default service for interacting with
|
|
212
|
+
* the Qik REST API, it's a wrapper around the axios library
|
|
213
|
+
* that works in conjunction with the other Qik modules
|
|
214
|
+
* @type {QikAPI}
|
|
215
|
+
*/
|
|
216
|
+
const api = new QikAPI(core);
|
|
217
|
+
Object.defineProperty(core, 'api', {
|
|
218
|
+
value: api,
|
|
219
|
+
writable: false,
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* The default service for managing authentication
|
|
224
|
+
* handles automatic refreshing of access tokens, and provides login, logout
|
|
225
|
+
* and other user/application specific functionality
|
|
226
|
+
* @type {QikAuth}
|
|
227
|
+
*/
|
|
228
|
+
const auth = new QikAuth(core);
|
|
229
|
+
Object.defineProperty(core, 'auth', {
|
|
230
|
+
value: auth,
|
|
231
|
+
writable: false,
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* The default service for connecting, subscribing and unsubscribing sockets
|
|
236
|
+
* @type {QikSocket}
|
|
237
|
+
*/
|
|
238
|
+
const socket = new QikSocket(core);
|
|
239
|
+
Object.defineProperty(core, 'socket', {
|
|
240
|
+
value: socket,
|
|
241
|
+
writable: false,
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
///////////////////////////////////////
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* A helper service for understanding a user's access permissions
|
|
248
|
+
* @type {QikAccess}
|
|
249
|
+
*/
|
|
250
|
+
const access = new QikAccess(core);
|
|
251
|
+
Object.defineProperty(core, 'access', {
|
|
252
|
+
value: access,
|
|
253
|
+
writable: false,
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
///////////////////////////////////////
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* A helper service for system functions and features
|
|
260
|
+
* @type {QikSystem}
|
|
261
|
+
*/
|
|
262
|
+
const system = new QikSystem(core);
|
|
263
|
+
Object.defineProperty(core, 'system', {
|
|
264
|
+
value: system,
|
|
265
|
+
writable: false,
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
///////////////////////////////////////
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* A helper service for geolocation features
|
|
272
|
+
* @type {QikGeo}
|
|
273
|
+
*/
|
|
274
|
+
const geo = new QikGeo(core);
|
|
275
|
+
Object.defineProperty(core, 'geo', {
|
|
276
|
+
value: geo,
|
|
277
|
+
writable: false,
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
///////////////////////////////////////
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* A helper service for content create, update, read and delete operations.
|
|
285
|
+
* @type {QikContent}
|
|
286
|
+
*/
|
|
287
|
+
const content = new QikContent(core);
|
|
288
|
+
Object.defineProperty(core, 'content', {
|
|
289
|
+
value: content,
|
|
290
|
+
writable: false,
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
///////////////////////////////////////
|
|
294
|
+
|
|
295
|
+
return core;
|
|
296
|
+
|
|
297
|
+
}
|
|
298
|
+
</code></pre>
|
|
299
|
+
</article>
|
|
300
|
+
</section>
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
</div>
|
|
308
|
+
|
|
309
|
+
<br class="clear">
|
|
310
|
+
|
|
311
|
+
<footer>
|
|
312
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Mon Jun 01 2026 23:37:17 GMT+1000 (Australian Eastern Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
313
|
+
</footer>
|
|
314
|
+
|
|
315
|
+
<script>prettyPrint();</script>
|
|
316
|
+
<script src="scripts/polyfill.js"></script>
|
|
317
|
+
<script src="scripts/linenumber.js"></script>
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
</body>
|
|
322
|
+
</html>
|