@qikdev/sdk 1.0.4 → 1.0.6
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/dist/access.html +490 -12702
- package/dist/api.html +2 -1061
- package/dist/auth.html +355 -6630
- package/dist/cache.html +2 -786
- package/dist/content.html +365 -7847
- package/dist/files.html +17 -2512
- package/dist/filter.html +36 -3654
- package/dist/geo.html +37 -2859
- package/dist/global.html +3 -91
- package/dist/index.html +2 -2
- package/dist/main.js +770 -755
- package/dist/module-QikStorage-CookieStorageAdapter.html +2 -772
- package/dist/module-QikStorage-LocalStorageAdapter.html +2 -138
- package/dist/module-QikStorage-StorageAdapter.html +16 -2496
- package/dist/module-QikStorage.html +2 -1014
- package/dist/qik.access.js.html +2 -2
- package/dist/qik.api.js.html +2 -2
- package/dist/qik.auth.js.html +2 -2
- package/dist/qik.cache.js.html +2 -2
- package/dist/qik.content.js.html +2 -2
- package/dist/qik.core.js.html +2 -2
- package/dist/qik.files.js.html +2 -2
- package/dist/qik.filter.js.html +3 -3
- package/dist/qik.geo.js.html +3 -3
- package/dist/qik.socket.js.html +20 -14
- package/dist/qik.storage.js.html +2 -2
- package/dist/qik.system.js.html +2 -2
- package/dist/qik.utils.js.html +8 -2
- package/dist/socket.html +16 -2181
- package/dist/system.html +2 -328
- package/dist/utils.html +4422 -0
- package/package.json +2 -2
- package/src/api/qik.api.js +28 -0
- package/src/api/qik.filter.js +1 -1
- package/src/api/qik.geo.js +1 -1
- package/src/api/qik.utils.js +6 -0
- package/src/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qikdev/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Promise based Javascript SDK",
|
|
6
6
|
"main": "./dist/main.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"test": "mocha --colors ./test/*.spec.js",
|
|
12
12
|
"test:watch": "mocha --colors -w ./test/*.spec.js",
|
|
13
13
|
"test:auth": "yarn build && node test/server.js",
|
|
14
|
-
"document": "jsdoc -
|
|
14
|
+
"document": "jsdoc -d public -c jsdoc.conf README.md"
|
|
15
15
|
},
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
package/src/api/qik.api.js
CHANGED
|
@@ -273,6 +273,34 @@ var QikAPI = function (qik) {
|
|
|
273
273
|
//Ignore let QikAuth handle it
|
|
274
274
|
break;
|
|
275
275
|
|
|
276
|
+
case 429: {
|
|
277
|
+
// Rate-limited by the server's fairness/concurrency limiter. It
|
|
278
|
+
// sends Retry-After (seconds); honour it — with jitter so a burst
|
|
279
|
+
// of 429s doesn't retry in lockstep and re-trip the limit — and
|
|
280
|
+
// retry a few times rather than surfacing the error. Retry state
|
|
281
|
+
// lives on the request config, NOT the shared retryCount above,
|
|
282
|
+
// because 429s arrive in concurrent bursts that would corrupt a
|
|
283
|
+
// single shared counter.
|
|
284
|
+
var config429 = err.config || {};
|
|
285
|
+
config429.__retry429 = (config429.__retry429 || 0) + 1;
|
|
286
|
+
if (config429.__retry429 <= 3) {
|
|
287
|
+
var retryAfterHeader = parseInt(
|
|
288
|
+
err?.response?.headers?.["retry-after"],
|
|
289
|
+
10,
|
|
290
|
+
);
|
|
291
|
+
var backoffMs = Number.isFinite(retryAfterHeader)
|
|
292
|
+
? retryAfterHeader * 1000
|
|
293
|
+
: 800 * config429.__retry429;
|
|
294
|
+
var jitterMs = Math.floor(Math.random() * 500);
|
|
295
|
+
return new Promise(function (resolve, reject) {
|
|
296
|
+
setTimeout(function () {
|
|
297
|
+
return instance.request(config429).then(resolve, reject);
|
|
298
|
+
}, backoffMs + jitterMs);
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
|
|
276
304
|
case 502:
|
|
277
305
|
case 504:
|
|
278
306
|
if (retryCount < 5) {
|
package/src/api/qik.filter.js
CHANGED
|
@@ -325,7 +325,7 @@ service.activeFilterKeys = function(filterConfiguration, options) {
|
|
|
325
325
|
/**
|
|
326
326
|
*
|
|
327
327
|
* @description Returns an array of all comparators that are being actively filtered
|
|
328
|
-
* @alias filter.
|
|
328
|
+
* @alias filter.activeFilterComparators
|
|
329
329
|
* @param {Object} filterConfiguration A filter configuration object
|
|
330
330
|
* @example
|
|
331
331
|
*
|
package/src/api/qik.geo.js
CHANGED
|
@@ -85,7 +85,7 @@ export default function(qik) {
|
|
|
85
85
|
/**
|
|
86
86
|
*
|
|
87
87
|
* Start watching the user's geolocation
|
|
88
|
-
* @alias geo.
|
|
88
|
+
* @alias geo.watchPosition
|
|
89
89
|
* @param {Function} callback A function that will be called with updated position data
|
|
90
90
|
* @example
|
|
91
91
|
* const result = await sdk.geo.watchPosition(callback)
|
package/src/api/qik.utils.js
CHANGED
|
@@ -4,6 +4,12 @@ import { isBrowser, isNode } from "browser-or-node";
|
|
|
4
4
|
|
|
5
5
|
///////////////////////////////////////////////////////////////////////////////
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @name utils
|
|
9
|
+
* @classdesc Utility helper functions — id, ids, hashing, parsing, cleaning, and other general-purpose helpers
|
|
10
|
+
* @class
|
|
11
|
+
*/
|
|
12
|
+
|
|
7
13
|
const service = {};
|
|
8
14
|
|
|
9
15
|
////////////////////////////////////
|
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "1.0.
|
|
1
|
+
export const version = "1.0.6";
|