@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qikdev/sdk",
3
- "version": "0.3.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": "^0.19.2",
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": {
@@ -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;
@@ -25,7 +25,8 @@ var QikAPI = function (qik) {
25
25
  defaultCache = qik.cache.get("api");
26
26
  }
27
27
 
28
- const defaultAdapter = axios.defaults.adapter;
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: (params) =>
183
- qs.stringify(params, { arrayFormat: "repeat" }),
183
+ paramsSerializer: {
184
+ serialize: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
185
+ },
184
186
  adapter,
185
187
  });
186
188
 
@@ -1,4 +1,3 @@
1
- import axios from 'axios';
2
1
  import { EventDispatcher } from './qik.utils.js';
3
2
  import { createStorageAdapter } from './qik.storage.js';
4
3
 
@@ -1,4 +1,4 @@
1
- import {Cache} from 'axios-extensions';
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 Cache(options)
48
+ caches[key] = new LRUCache(options)
49
49
  return caches[key];
50
50
  }
51
51
  }
@@ -1,5 +1,3 @@
1
- import axios from "axios";
2
-
3
1
  ///////////////////////////////////////////////////
4
2
 
5
3
  /**
@@ -1,6 +1,5 @@
1
1
  import _get from "lodash.get";
2
2
  import _camelCase from "lodash.camelcase";
3
- import axios from "axios";
4
3
  import { isBrowser, isNode } from "browser-or-node";
5
4
 
6
5
  ///////////////////////////////////////////////////////////////////////////////
package/src/version.js CHANGED
@@ -1 +1 @@
1
- export const version = "0.3.0";
1
+ export const version = "1.0.0";