@qikdev/sdk 0.3.0 → 1.0.0
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/main.js +444 -433
- package/package.json +3 -3
- package/src/api/qik.access.js +20 -0
- package/src/api/qik.api.js +5 -3
- package/src/api/qik.auth.js +0 -1
- package/src/api/qik.cache.js +2 -2
- package/src/api/qik.content.js +0 -2
- package/src/api/qik.utils.js +0 -1
- package/src/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qikdev/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Promise based Javascript SDK",
|
|
6
6
|
"main": "./dist/main.js",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"vite": "^7.2.2"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"axios": "^
|
|
52
|
-
"axios-extensions": "^3.1.2",
|
|
51
|
+
"axios": "^1.7.0",
|
|
53
52
|
"browser-or-node": "^2.0.0",
|
|
54
53
|
"lodash.camelcase": "^4.3.0",
|
|
55
54
|
"lodash.get": "^4.4.2",
|
|
55
|
+
"lru-cache": "^11.0.0",
|
|
56
56
|
"qs": "^6.10.5"
|
|
57
57
|
},
|
|
58
58
|
"directories": {
|
package/src/api/qik.access.js
CHANGED
|
@@ -492,8 +492,28 @@ var QikAccess = function (QikCore) {
|
|
|
492
492
|
|
|
493
493
|
//////////////////////////////////
|
|
494
494
|
|
|
495
|
+
//The user should be able to list any scopes that they have
|
|
496
|
+
//permission to do things in.
|
|
497
|
+
if (ANY_ACTION == "listany" || OWN_ACTION == "listown") {
|
|
498
|
+
if (type === "scope") {
|
|
499
|
+
var itemID = QikCore.utils.id(item);
|
|
500
|
+
return !!user.permissions[itemID];
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
//////////////////////////////////
|
|
505
|
+
|
|
495
506
|
var itemScopes = QikCore.utils.ids(item.meta.scopes || []);
|
|
496
507
|
|
|
508
|
+
//Scopes don't have meta.scopes, instead use the scope's
|
|
509
|
+
//path (ancestors) plus the scope's own ID
|
|
510
|
+
if (type === "scope") {
|
|
511
|
+
itemScopes = [
|
|
512
|
+
...QikCore.utils.ids(item.path || []),
|
|
513
|
+
QikCore.utils.id(item),
|
|
514
|
+
];
|
|
515
|
+
}
|
|
516
|
+
|
|
497
517
|
//////////////////////////////////
|
|
498
518
|
|
|
499
519
|
var actionAnyScopesHash;
|
package/src/api/qik.api.js
CHANGED
|
@@ -25,7 +25,8 @@ var QikAPI = function (qik) {
|
|
|
25
25
|
defaultCache = qik.cache.get("api");
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
// axios 1.x exposes defaults.adapter as an array of adapter names — resolve it to the underlying function
|
|
29
|
+
const defaultAdapter = axios.getAdapter(axios.defaults.adapter);
|
|
29
30
|
|
|
30
31
|
/////////////////////////////////////////////////////
|
|
31
32
|
|
|
@@ -179,8 +180,9 @@ var QikAPI = function (qik) {
|
|
|
179
180
|
|
|
180
181
|
function createNewAxios(adapter) {
|
|
181
182
|
var instance = axios.create({
|
|
182
|
-
paramsSerializer:
|
|
183
|
-
qs.stringify(params, { arrayFormat: "repeat" }),
|
|
183
|
+
paramsSerializer: {
|
|
184
|
+
serialize: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
185
|
+
},
|
|
184
186
|
adapter,
|
|
185
187
|
});
|
|
186
188
|
|
package/src/api/qik.auth.js
CHANGED
package/src/api/qik.cache.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LRUCache } from 'lru-cache';
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
///////////////////////////////////////////////////////////////////////////////
|
|
@@ -45,7 +45,7 @@ var QikCache = {
|
|
|
45
45
|
if (caches[key]) {
|
|
46
46
|
return caches[key];
|
|
47
47
|
}
|
|
48
|
-
caches[key] = new
|
|
48
|
+
caches[key] = new LRUCache(options)
|
|
49
49
|
return caches[key];
|
|
50
50
|
}
|
|
51
51
|
}
|
package/src/api/qik.content.js
CHANGED
package/src/api/qik.utils.js
CHANGED
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "0.
|
|
1
|
+
export const version = "1.0.0";
|