@pisell/core 1.0.29 → 1.0.30

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.
@@ -28,8 +28,9 @@ var MAX_CACHE_TIME = 7 * 60 * 60 * 1000;
28
28
  var createCacheKey = function createCacheKey(url, data, cache) {
29
29
  var _getConfig = getConfig(),
30
30
  storage = _getConfig.storage;
31
+ var _data = (cache === null || cache === void 0 ? void 0 : cache.cacheKeyData) || data;
31
32
  // @ts-ignore
32
- return cache.key ? storage.createKey(cache.key) : md5("".concat(url, "_").concat(JSON.stringify(data)));
33
+ return cache.key ? storage.createKey(cache.key) : md5("".concat(url, "_").concat(JSON.stringify(_data)));
33
34
  };
34
35
 
35
36
  /**
@@ -33,6 +33,7 @@ export interface CacheProps {
33
33
  updateCache?: boolean;
34
34
  cacheUpdateChange?: (data: any) => void;
35
35
  mode?: RequestModeType;
36
+ cacheKeyData?: any;
36
37
  }
37
38
  export interface RequestSetting {
38
39
  abort?: boolean;
@@ -109,7 +109,7 @@ export declare class TasksManager {
109
109
  */
110
110
  getQueueStatus(module: string, queueId: string): {
111
111
  isRunning: boolean;
112
- status: "completed" | "uncompleted";
112
+ status: "uncompleted" | "completed";
113
113
  progress: {
114
114
  total: number;
115
115
  completed: number;
@@ -44,7 +44,8 @@ var CACHES = {};
44
44
  var MAX_CACHE_TIME = 7 * 60 * 60 * 1e3;
45
45
  var createCacheKey = (url, data, cache) => {
46
46
  const { storage } = (0, import_config.getConfig)();
47
- return cache.key ? storage.createKey(cache.key) : (0, import_js_md5.default)(`${url}_${JSON.stringify(data)}`);
47
+ let _data = (cache == null ? void 0 : cache.cacheKeyData) || data;
48
+ return cache.key ? storage.createKey(cache.key) : (0, import_js_md5.default)(`${url}_${JSON.stringify(_data)}`);
48
49
  };
49
50
  var setCache = async (key, data, cache) => {
50
51
  const { storage } = (0, import_config.getConfig)();
@@ -33,6 +33,7 @@ export interface CacheProps {
33
33
  updateCache?: boolean;
34
34
  cacheUpdateChange?: (data: any) => void;
35
35
  mode?: RequestModeType;
36
+ cacheKeyData?: any;
36
37
  }
37
38
  export interface RequestSetting {
38
39
  abort?: boolean;
@@ -109,7 +109,7 @@ export declare class TasksManager {
109
109
  */
110
110
  getQueueStatus(module: string, queueId: string): {
111
111
  isRunning: boolean;
112
- status: "completed" | "uncompleted";
112
+ status: "uncompleted" | "completed";
113
113
  progress: {
114
114
  total: number;
115
115
  completed: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/core",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
4
4
  "sideEffects": false,
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",