@pisell/core 1.0.31 → 1.1.2

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.
@@ -19,21 +19,11 @@ export interface RequestConfig {
19
19
  [key: string]: any;
20
20
  };
21
21
  }
22
- export declare enum RequestModeENUM {
23
- LOCAL = "local",
24
- REMOTE = "remote",
25
- LOCAL_REMOTE = "local_remote",
26
- REMOTE_LOCAL = "remote_local",
27
- OS_SERVER = "os_server"
28
- }
29
- export declare type RequestModeType = RequestModeENUM.LOCAL | RequestModeENUM.REMOTE | RequestModeENUM.LOCAL_REMOTE | RequestModeENUM.REMOTE_LOCAL | RequestModeENUM.OS_SERVER;
30
22
  export interface CacheProps {
31
23
  key?: string;
32
24
  type?: CacheType;
33
25
  updateCache?: boolean;
34
26
  cacheUpdateChange?: (data: any) => void;
35
- mode?: RequestModeType;
36
- cacheKeyData?: any;
37
27
  }
38
28
  export interface RequestSetting {
39
29
  abort?: boolean;
@@ -41,7 +31,6 @@ export interface RequestSetting {
41
31
  cache?: CacheProps;
42
32
  signal?: any;
43
33
  token?: string;
44
- osServer?: boolean;
45
34
  [key: string]: any;
46
35
  }
47
36
  export interface RequestWrapperProps {
@@ -1,10 +1 @@
1
- export var RequestModeENUM = /*#__PURE__*/function (RequestModeENUM) {
2
- RequestModeENUM["LOCAL"] = "local";
3
- RequestModeENUM["REMOTE"] = "remote";
4
- RequestModeENUM["LOCAL_REMOTE"] = "local_remote";
5
- RequestModeENUM["REMOTE_LOCAL"] = "remote_local";
6
- RequestModeENUM["OS_SERVER"] = "os_server";
7
- return RequestModeENUM;
8
- }({});
9
-
10
- // 请求模式
1
+ export {};
@@ -128,7 +128,7 @@ export var requestCallback = function requestCallback(resData) {
128
128
  if (codeFn) {
129
129
  if ((res === null || res === void 0 ? void 0 : res.code) === 200) {
130
130
  // 需要缓存的进行缓存数据
131
- if (config !== null && config !== void 0 && config.useCache || config !== null && config !== void 0 && config.cache) {
131
+ if (config !== null && config !== void 0 && config.cache) {
132
132
  var _config$cacheUpdateCh;
133
133
  setCacheData(props.url, props.data, res, config === null || config === void 0 ? void 0 : config.cache);
134
134
  config === null || config === void 0 || (_config$cacheUpdateCh = config.cacheUpdateChange) === null || _config$cacheUpdateCh === void 0 || _config$cacheUpdateCh.call(config, res);
@@ -37,20 +37,6 @@ export declare class TasksManager {
37
37
  * @param {NodeJS.Timeout} timerId
38
38
  */
39
39
  private clearTaskTimer;
40
- /**
41
- * @title: 计算下一次执行时间
42
- * @description: 根据定时任务配置计算下一次执行时间
43
- * @param {Task} task
44
- * @return {string | null} 下一次执行时间
45
- */
46
- private calculateNextExecuteTime;
47
- /**
48
- * @title: 启动定时任务
49
- * @description: 在特定时间点执行任务(仅在 scheduledTasks 模块中生效)
50
- * @param {Task} task
51
- * @return {*}
52
- */
53
- private startScheduledTask;
54
40
  /**
55
41
  * @title: 启动轮询
56
42
  * @description: 根据轮询间隔定期执行任务
@@ -89,40 +75,9 @@ export declare class TasksManager {
89
75
  addTask(payload: AddTaskParams): void;
90
76
  private updateTask;
91
77
  private updateQueueStatus;
92
- /**
93
- * @title: 更新队列运行状态
94
- * @description: 标记队列是否正在执行
95
- */
96
- private updateQueueRunningState;
97
- private setTasksData;
98
78
  private setTasks;
99
79
  clearAllTaskTimer(tasks: Task[]): void;
100
80
  clearTasks(payload: RunTaskParams): void;
101
81
  clearAllTasks(): void;
102
82
  watchTask(callback: (taskModule: TasksModule) => void): void;
103
- /**
104
- * @title: 获取队列执行状态
105
- * @description: 获取指定队列的执行状态和进度信息
106
- * @param {string} module - 模块名
107
- * @param {string} queueId - 队列ID
108
- * @return {object} 队列状态信息
109
- */
110
- getQueueStatus(module: string, queueId: string): {
111
- isRunning: boolean;
112
- status: "completed" | "uncompleted";
113
- progress: {
114
- total: number;
115
- completed: number;
116
- failed: number;
117
- inProgress: number;
118
- };
119
- lastRunAt: string | null;
120
- tasksCount: number;
121
- } | null;
122
- /**
123
- * @title: 获取所有队列状态
124
- * @description: 获取所有任务队列的执行状态概览
125
- * @return {object} 所有队列的状态信息
126
- */
127
- getAllQueuesStatus(): any;
128
83
  }