@pisell/pisellos 0.0.220 → 0.0.221
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/README.md +180 -180
- package/dist/core/index.js +4 -4
- package/dist/index.js +3 -3
- package/dist/modules/Account/types.js +6 -6
- package/dist/modules/AccountList/index.js +14 -14
- package/dist/modules/AccountList/types.js +14 -14
- package/dist/modules/AccountList/utils.js +5 -5
- package/dist/modules/Cart/index.js +35 -35
- package/dist/modules/Cart/types.js +14 -14
- package/dist/modules/Cart/utils/cartAccount.js +8 -8
- package/dist/modules/Cart/utils/cartDate.js +12 -12
- package/dist/modules/Cart/utils/cartDiscount.js +8 -8
- package/dist/modules/Cart/utils/cartNote.js +8 -8
- package/dist/modules/Cart/utils/cartProduct.js +39 -39
- package/dist/modules/Cart/utils/cartRelationForms.js +8 -8
- package/dist/modules/Cart/utils/cartResource.js +8 -8
- package/dist/modules/Cart/utils/index.js +4 -4
- package/dist/modules/Customer/index.js +67 -67
- package/dist/modules/Customer/types.js +18 -18
- package/dist/modules/Date/types.js +6 -6
- package/dist/modules/Date/utils.js +25 -25
- package/dist/modules/Guests/types.js +8 -8
- package/dist/modules/Order/types.js +4 -4
- package/dist/modules/Order/utils.js +8 -8
- package/dist/modules/Payment/cash.js +2 -2
- package/dist/modules/Payment/eftpos.js +2 -2
- package/dist/modules/Payment/index.js +135 -135
- package/dist/modules/Payment/types.js +50 -50
- package/dist/modules/Payment/wallet.js +2 -2
- package/dist/modules/Product/index.js +22 -22
- package/dist/modules/Product/utils.js +12 -12
- package/dist/modules/ProductList/index.js +4 -4
- package/dist/modules/Resource/types.js +8 -8
- package/dist/modules/Resource/utils.js +14 -14
- package/dist/modules/Schedule/index.js +4 -4
- package/dist/modules/Schedule/utils.js +73 -73
- package/dist/modules/Step/index.js +18 -18
- package/dist/modules/Summary/index.js +4 -4
- package/dist/modules/Summary/utils.js +15 -15
- package/dist/plugins/app-types/app/app.d.ts +83 -83
- package/dist/plugins/app-types/app/const.d.ts +4 -4
- package/dist/plugins/app-types/app/index.d.ts +14 -14
- package/dist/plugins/app-types/applicationManager/application.d.ts +50 -50
- package/dist/plugins/app-types/applicationManager/index.d.ts +13 -13
- package/dist/plugins/app-types/config.d.ts +3 -3
- package/dist/plugins/app-types/cookie/index.d.ts +13 -13
- package/dist/plugins/app-types/data/index.d.ts +8 -8
- package/dist/plugins/app-types/history/config.d.ts +24 -24
- package/dist/plugins/app-types/history/index.d.ts +20 -20
- package/dist/plugins/app-types/history/type.d.ts +2 -2
- package/dist/plugins/app-types/hooks/index.d.ts +12 -12
- package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -2
- package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +2 -2
- package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +13 -13
- package/dist/plugins/app-types/hooks/useStore/index.d.ts +6 -6
- package/dist/plugins/app-types/index.d.ts +6 -6
- package/dist/plugins/app-types/indexDB/index.d.ts +178 -178
- package/dist/plugins/app-types/locales/en.d.ts +3 -3
- package/dist/plugins/app-types/locales/index.d.ts +37 -37
- package/dist/plugins/app-types/locales/original.d.ts +3 -3
- package/dist/plugins/app-types/locales/type.d.ts +19 -19
- package/dist/plugins/app-types/locales/zh-CN.d.ts +3 -3
- package/dist/plugins/app-types/locales/zh-HK.d.ts +3 -3
- package/dist/plugins/app-types/logger/feishu.d.ts +11 -11
- package/dist/plugins/app-types/logger/index.d.ts +122 -122
- package/dist/plugins/app-types/menuManager/hooks.d.ts +17 -17
- package/dist/plugins/app-types/menuManager/index.d.ts +28 -28
- package/dist/plugins/app-types/models/global.d.ts +32 -32
- package/dist/plugins/app-types/models/index.d.ts +45 -45
- package/dist/plugins/app-types/models/type.d.ts +2 -2
- package/dist/plugins/app-types/package.json +14 -14
- package/dist/plugins/app-types/pubsub/example.d.ts +5 -5
- package/dist/plugins/app-types/pubsub/index.d.ts +63 -63
- package/dist/plugins/app-types/request/cache.d.ts +46 -46
- package/dist/plugins/app-types/request/cancelToken.d.ts +38 -38
- package/dist/plugins/app-types/request/config.d.ts +3 -3
- package/dist/plugins/app-types/request/constants.d.ts +2 -2
- package/dist/plugins/app-types/request/index.d.ts +24 -24
- package/dist/plugins/app-types/request/pisell2Request.d.ts +6 -6
- package/dist/plugins/app-types/request/type.d.ts +41 -41
- package/dist/plugins/app-types/request/utils.d.ts +46 -46
- package/dist/plugins/app-types/routes/config.d.ts +7 -7
- package/dist/plugins/app-types/routes/index.d.ts +28 -28
- package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -6
- package/dist/plugins/app-types/socket/components/index.d.ts +2 -2
- package/dist/plugins/app-types/socket/constants.d.ts +33 -33
- package/dist/plugins/app-types/socket/events.d.ts +31 -31
- package/dist/plugins/app-types/socket/heartbeat.d.ts +66 -66
- package/dist/plugins/app-types/socket/index.d.ts +61 -61
- package/dist/plugins/app-types/socket/monitor.d.ts +169 -169
- package/dist/plugins/app-types/socket/reconnect.d.ts +61 -61
- package/dist/plugins/app-types/socket/socket.d.ts +129 -129
- package/dist/plugins/app-types/socket/types.d.ts +85 -85
- package/dist/plugins/app-types/storage/index.d.ts +17 -17
- package/dist/plugins/app-types/tasks/index.d.ts +77 -77
- package/dist/plugins/app-types/tasks/type.d.ts +62 -62
- package/dist/plugins/app-types/tasks/useTasks.d.ts +5 -5
- package/dist/plugins/app-types/type.d.ts +2 -2
- package/dist/plugins/app-types/variables/VariablesProvider.d.ts +7 -7
- package/dist/plugins/app-types/variables/config.d.ts +3 -3
- package/dist/plugins/app-types/variables/index.d.ts +6 -6
- package/dist/plugins/app-types/variables/type.d.ts +2 -2
- package/dist/plugins/app-types/website/index.d.ts +6 -6
- package/dist/plugins/request.js +33 -33
- package/dist/plugins/window.js +16 -16
- package/dist/solution/BookingByStep/index.js +126 -126
- package/dist/solution/BookingByStep/utils/capacity.js +30 -30
- package/dist/solution/BookingByStep/utils/products.js +4 -4
- package/dist/solution/BookingByStep/utils/resources.js +146 -146
- package/dist/solution/BookingByStep/utils/timeslots.js +20 -20
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +82 -86
- package/dist/solution/BookingTicket/types.js +8 -8
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +6 -6
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -4
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +20 -28
- package/dist/solution/BookingTicket/utils/scan/index.js +19 -19
- package/dist/solution/BookingTicket/utils/scan/scanCache.js +52 -52
- package/dist/solution/BuyTickets/types.js +4 -4
- package/dist/utils/task.js +11 -11
- package/dist/utils/watch.js +59 -59
- package/lib/plugins/app-types/app/app.d.ts +83 -83
- package/lib/plugins/app-types/app/const.d.ts +4 -4
- package/lib/plugins/app-types/app/index.d.ts +14 -14
- package/lib/plugins/app-types/applicationManager/application.d.ts +50 -50
- package/lib/plugins/app-types/applicationManager/index.d.ts +13 -13
- package/lib/plugins/app-types/config.d.ts +3 -3
- package/lib/plugins/app-types/cookie/index.d.ts +13 -13
- package/lib/plugins/app-types/data/index.d.ts +8 -8
- package/lib/plugins/app-types/history/config.d.ts +24 -24
- package/lib/plugins/app-types/history/index.d.ts +20 -20
- package/lib/plugins/app-types/history/type.d.ts +2 -2
- package/lib/plugins/app-types/hooks/index.d.ts +12 -12
- package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -2
- package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +2 -2
- package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +13 -13
- package/lib/plugins/app-types/hooks/useStore/index.d.ts +6 -6
- package/lib/plugins/app-types/index.d.ts +6 -6
- package/lib/plugins/app-types/indexDB/index.d.ts +178 -178
- package/lib/plugins/app-types/locales/en.d.ts +3 -3
- package/lib/plugins/app-types/locales/index.d.ts +37 -37
- package/lib/plugins/app-types/locales/original.d.ts +3 -3
- package/lib/plugins/app-types/locales/type.d.ts +19 -19
- package/lib/plugins/app-types/locales/zh-CN.d.ts +3 -3
- package/lib/plugins/app-types/locales/zh-HK.d.ts +3 -3
- package/lib/plugins/app-types/logger/feishu.d.ts +11 -11
- package/lib/plugins/app-types/logger/index.d.ts +122 -122
- package/lib/plugins/app-types/menuManager/hooks.d.ts +17 -17
- package/lib/plugins/app-types/menuManager/index.d.ts +28 -28
- package/lib/plugins/app-types/models/global.d.ts +32 -32
- package/lib/plugins/app-types/models/index.d.ts +45 -45
- package/lib/plugins/app-types/models/type.d.ts +2 -2
- package/lib/plugins/app-types/package.json +14 -14
- package/lib/plugins/app-types/pubsub/example.d.ts +5 -5
- package/lib/plugins/app-types/pubsub/index.d.ts +63 -63
- package/lib/plugins/app-types/request/cache.d.ts +46 -46
- package/lib/plugins/app-types/request/cancelToken.d.ts +38 -38
- package/lib/plugins/app-types/request/config.d.ts +3 -3
- package/lib/plugins/app-types/request/constants.d.ts +2 -2
- package/lib/plugins/app-types/request/index.d.ts +24 -24
- package/lib/plugins/app-types/request/pisell2Request.d.ts +6 -6
- package/lib/plugins/app-types/request/type.d.ts +41 -41
- package/lib/plugins/app-types/request/utils.d.ts +46 -46
- package/lib/plugins/app-types/routes/config.d.ts +7 -7
- package/lib/plugins/app-types/routes/index.d.ts +28 -28
- package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -6
- package/lib/plugins/app-types/socket/components/index.d.ts +2 -2
- package/lib/plugins/app-types/socket/constants.d.ts +33 -33
- package/lib/plugins/app-types/socket/events.d.ts +31 -31
- package/lib/plugins/app-types/socket/heartbeat.d.ts +66 -66
- package/lib/plugins/app-types/socket/index.d.ts +61 -61
- package/lib/plugins/app-types/socket/monitor.d.ts +169 -169
- package/lib/plugins/app-types/socket/reconnect.d.ts +61 -61
- package/lib/plugins/app-types/socket/socket.d.ts +129 -129
- package/lib/plugins/app-types/socket/types.d.ts +85 -85
- package/lib/plugins/app-types/storage/index.d.ts +17 -17
- package/lib/plugins/app-types/tasks/index.d.ts +77 -77
- package/lib/plugins/app-types/tasks/type.d.ts +62 -62
- package/lib/plugins/app-types/tasks/useTasks.d.ts +5 -5
- package/lib/plugins/app-types/type.d.ts +2 -2
- package/lib/plugins/app-types/variables/VariablesProvider.d.ts +7 -7
- package/lib/plugins/app-types/variables/config.d.ts +3 -3
- package/lib/plugins/app-types/variables/index.d.ts +6 -6
- package/lib/plugins/app-types/variables/type.d.ts +2 -2
- package/lib/plugins/app-types/website/index.d.ts +6 -6
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +1 -2
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -4
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -14
- package/package.json +1 -1
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import { Task, TasksModule, RunTaskParams, AddTaskParams, DeleteTaskParams } from "./type";
|
|
2
|
-
import App from "../app";
|
|
3
|
-
export declare class TasksManager {
|
|
4
|
-
private static instance;
|
|
5
|
-
private taskFunctions;
|
|
6
|
-
private tasks;
|
|
7
|
-
private app;
|
|
8
|
-
private db;
|
|
9
|
-
useTasks: () => {
|
|
10
|
-
tasks: TasksModule;
|
|
11
|
-
};
|
|
12
|
-
watchTaskCallback: (taskModule: TasksModule) => void;
|
|
13
|
-
constructor(app: App);
|
|
14
|
-
static getInstance(app?: App): TasksManager;
|
|
15
|
-
addTaskFunction<T>(name: string, fun: T): void;
|
|
16
|
-
addTaskFunctions<T>(tasks: {
|
|
17
|
-
name: string;
|
|
18
|
-
fun: T;
|
|
19
|
-
}[]): void;
|
|
20
|
-
getTasks(): TasksModule;
|
|
21
|
-
getTaskFunction(name: string): any;
|
|
22
|
-
init(): Promise<void>;
|
|
23
|
-
private saveTaskQueueToLocal;
|
|
24
|
-
private loadTaskQueueFromLocal;
|
|
25
|
-
/**
|
|
26
|
-
* @title: 执行任务
|
|
27
|
-
* @description:
|
|
28
|
-
* @param {Task} task
|
|
29
|
-
* @return {*}
|
|
30
|
-
* @Author: zhiwei.Wang
|
|
31
|
-
* @Date: 2024-09-26 13:53
|
|
32
|
-
*/
|
|
33
|
-
private runTask;
|
|
34
|
-
/**
|
|
35
|
-
* @title: 启动轮询
|
|
36
|
-
* @description: 根据轮询间隔定期执行任务
|
|
37
|
-
* @param {Task} task
|
|
38
|
-
* @return {*}
|
|
39
|
-
*/
|
|
40
|
-
private startPolling;
|
|
41
|
-
/**
|
|
42
|
-
* @title: 创建任务数据
|
|
43
|
-
* @description:
|
|
44
|
-
* @param {Partial} payload
|
|
45
|
-
* @return {*}
|
|
46
|
-
* @Author: zhiwei.Wang
|
|
47
|
-
* @Date: 2024-09-26 13:54
|
|
48
|
-
*/
|
|
49
|
-
private createTaskData;
|
|
50
|
-
private getTaskQueue;
|
|
51
|
-
private timeout;
|
|
52
|
-
/**
|
|
53
|
-
* @title: 执行任务队列
|
|
54
|
-
* @description:
|
|
55
|
-
* @return {*}
|
|
56
|
-
* @Author: zhiwei.Wang
|
|
57
|
-
* @Date: 2024-09-26 13:52
|
|
58
|
-
*/
|
|
59
|
-
run(payload: RunTaskParams): Promise<void>;
|
|
60
|
-
deleteTask(payload: DeleteTaskParams): void;
|
|
61
|
-
/**
|
|
62
|
-
* @title: 重试任务
|
|
63
|
-
* @description:
|
|
64
|
-
* @return {*}
|
|
65
|
-
* @Author: zhiwei.Wang
|
|
66
|
-
* @Date: 2024-09-26 13:53
|
|
67
|
-
*/
|
|
68
|
-
retryTask(payload: RunTaskParams): void;
|
|
69
|
-
addTask(payload: AddTaskParams): void;
|
|
70
|
-
private updateTask;
|
|
71
|
-
private updateQueueStatus;
|
|
72
|
-
private setTasks;
|
|
73
|
-
clearAllTaskTimer(tasks: Task[]): void;
|
|
74
|
-
clearTasks(payload: RunTaskParams): void;
|
|
75
|
-
clearAllTasks(): void;
|
|
76
|
-
watchTask(callback: (taskModule: TasksModule) => void): void;
|
|
77
|
-
}
|
|
1
|
+
import { Task, TasksModule, RunTaskParams, AddTaskParams, DeleteTaskParams } from "./type";
|
|
2
|
+
import App from "../app";
|
|
3
|
+
export declare class TasksManager {
|
|
4
|
+
private static instance;
|
|
5
|
+
private taskFunctions;
|
|
6
|
+
private tasks;
|
|
7
|
+
private app;
|
|
8
|
+
private db;
|
|
9
|
+
useTasks: () => {
|
|
10
|
+
tasks: TasksModule;
|
|
11
|
+
};
|
|
12
|
+
watchTaskCallback: (taskModule: TasksModule) => void;
|
|
13
|
+
constructor(app: App);
|
|
14
|
+
static getInstance(app?: App): TasksManager;
|
|
15
|
+
addTaskFunction<T>(name: string, fun: T): void;
|
|
16
|
+
addTaskFunctions<T>(tasks: {
|
|
17
|
+
name: string;
|
|
18
|
+
fun: T;
|
|
19
|
+
}[]): void;
|
|
20
|
+
getTasks(): TasksModule;
|
|
21
|
+
getTaskFunction(name: string): any;
|
|
22
|
+
init(): Promise<void>;
|
|
23
|
+
private saveTaskQueueToLocal;
|
|
24
|
+
private loadTaskQueueFromLocal;
|
|
25
|
+
/**
|
|
26
|
+
* @title: 执行任务
|
|
27
|
+
* @description:
|
|
28
|
+
* @param {Task} task
|
|
29
|
+
* @return {*}
|
|
30
|
+
* @Author: zhiwei.Wang
|
|
31
|
+
* @Date: 2024-09-26 13:53
|
|
32
|
+
*/
|
|
33
|
+
private runTask;
|
|
34
|
+
/**
|
|
35
|
+
* @title: 启动轮询
|
|
36
|
+
* @description: 根据轮询间隔定期执行任务
|
|
37
|
+
* @param {Task} task
|
|
38
|
+
* @return {*}
|
|
39
|
+
*/
|
|
40
|
+
private startPolling;
|
|
41
|
+
/**
|
|
42
|
+
* @title: 创建任务数据
|
|
43
|
+
* @description:
|
|
44
|
+
* @param {Partial} payload
|
|
45
|
+
* @return {*}
|
|
46
|
+
* @Author: zhiwei.Wang
|
|
47
|
+
* @Date: 2024-09-26 13:54
|
|
48
|
+
*/
|
|
49
|
+
private createTaskData;
|
|
50
|
+
private getTaskQueue;
|
|
51
|
+
private timeout;
|
|
52
|
+
/**
|
|
53
|
+
* @title: 执行任务队列
|
|
54
|
+
* @description:
|
|
55
|
+
* @return {*}
|
|
56
|
+
* @Author: zhiwei.Wang
|
|
57
|
+
* @Date: 2024-09-26 13:52
|
|
58
|
+
*/
|
|
59
|
+
run(payload: RunTaskParams): Promise<void>;
|
|
60
|
+
deleteTask(payload: DeleteTaskParams): void;
|
|
61
|
+
/**
|
|
62
|
+
* @title: 重试任务
|
|
63
|
+
* @description:
|
|
64
|
+
* @return {*}
|
|
65
|
+
* @Author: zhiwei.Wang
|
|
66
|
+
* @Date: 2024-09-26 13:53
|
|
67
|
+
*/
|
|
68
|
+
retryTask(payload: RunTaskParams): void;
|
|
69
|
+
addTask(payload: AddTaskParams): void;
|
|
70
|
+
private updateTask;
|
|
71
|
+
private updateQueueStatus;
|
|
72
|
+
private setTasks;
|
|
73
|
+
clearAllTaskTimer(tasks: Task[]): void;
|
|
74
|
+
clearTasks(payload: RunTaskParams): void;
|
|
75
|
+
clearAllTasks(): void;
|
|
76
|
+
watchTask(callback: (taskModule: TasksModule) => void): void;
|
|
77
|
+
}
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
export type TaskRunStatus = "pending" | "in-progress" | "success" | "failure";
|
|
2
|
-
export interface Task {
|
|
3
|
-
id?: string;
|
|
4
|
-
type?: "local" | "cloud";
|
|
5
|
-
retries?: number;
|
|
6
|
-
maxRetries?: number;
|
|
7
|
-
status?: TaskRunStatus;
|
|
8
|
-
action: string;
|
|
9
|
-
payload: any;
|
|
10
|
-
beforeAction?: string;
|
|
11
|
-
beforePayload?: any;
|
|
12
|
-
afterAction?: string;
|
|
13
|
-
afterPayload?: any;
|
|
14
|
-
polling?: {
|
|
15
|
-
interval?: number;
|
|
16
|
-
};
|
|
17
|
-
pollingResult?: {
|
|
18
|
-
count: number;
|
|
19
|
-
timerId?: any;
|
|
20
|
-
};
|
|
21
|
-
manual?: boolean;
|
|
22
|
-
destroy?: boolean;
|
|
23
|
-
[key: string]: any;
|
|
24
|
-
}
|
|
25
|
-
export interface TaskConfig {
|
|
26
|
-
tasks: Task[];
|
|
27
|
-
}
|
|
28
|
-
type TaskModuleName = string;
|
|
29
|
-
type TaskQueueName = string;
|
|
30
|
-
type TaskStatus = "uncompleted" | "completed";
|
|
31
|
-
export interface TaskQueue {
|
|
32
|
-
status: TaskStatus;
|
|
33
|
-
tasks: Task[];
|
|
34
|
-
}
|
|
35
|
-
export interface RunTaskParams {
|
|
36
|
-
module: TaskModuleName;
|
|
37
|
-
queueId: TaskQueueName;
|
|
38
|
-
callback?: () => void;
|
|
39
|
-
}
|
|
40
|
-
export interface DeleteTaskParams {
|
|
41
|
-
module: TaskModuleName;
|
|
42
|
-
queueId: TaskQueueName;
|
|
43
|
-
taskId: string;
|
|
44
|
-
}
|
|
45
|
-
export interface AddTaskParams {
|
|
46
|
-
module: TaskModuleName;
|
|
47
|
-
queueId: TaskQueueName;
|
|
48
|
-
tasks: Task[];
|
|
49
|
-
}
|
|
50
|
-
export interface TaskRunResult {
|
|
51
|
-
status: TaskRunStatus;
|
|
52
|
-
[key: string]: any;
|
|
53
|
-
}
|
|
54
|
-
export interface TasksModule {
|
|
55
|
-
[key: TaskModuleName]: {
|
|
56
|
-
[key: TaskQueueName]: {
|
|
57
|
-
status: TaskStatus;
|
|
58
|
-
tasks: Task[];
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
export {};
|
|
1
|
+
export type TaskRunStatus = "pending" | "in-progress" | "success" | "failure";
|
|
2
|
+
export interface Task {
|
|
3
|
+
id?: string;
|
|
4
|
+
type?: "local" | "cloud";
|
|
5
|
+
retries?: number;
|
|
6
|
+
maxRetries?: number;
|
|
7
|
+
status?: TaskRunStatus;
|
|
8
|
+
action: string;
|
|
9
|
+
payload: any;
|
|
10
|
+
beforeAction?: string;
|
|
11
|
+
beforePayload?: any;
|
|
12
|
+
afterAction?: string;
|
|
13
|
+
afterPayload?: any;
|
|
14
|
+
polling?: {
|
|
15
|
+
interval?: number;
|
|
16
|
+
};
|
|
17
|
+
pollingResult?: {
|
|
18
|
+
count: number;
|
|
19
|
+
timerId?: any;
|
|
20
|
+
};
|
|
21
|
+
manual?: boolean;
|
|
22
|
+
destroy?: boolean;
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}
|
|
25
|
+
export interface TaskConfig {
|
|
26
|
+
tasks: Task[];
|
|
27
|
+
}
|
|
28
|
+
type TaskModuleName = string;
|
|
29
|
+
type TaskQueueName = string;
|
|
30
|
+
type TaskStatus = "uncompleted" | "completed";
|
|
31
|
+
export interface TaskQueue {
|
|
32
|
+
status: TaskStatus;
|
|
33
|
+
tasks: Task[];
|
|
34
|
+
}
|
|
35
|
+
export interface RunTaskParams {
|
|
36
|
+
module: TaskModuleName;
|
|
37
|
+
queueId: TaskQueueName;
|
|
38
|
+
callback?: () => void;
|
|
39
|
+
}
|
|
40
|
+
export interface DeleteTaskParams {
|
|
41
|
+
module: TaskModuleName;
|
|
42
|
+
queueId: TaskQueueName;
|
|
43
|
+
taskId: string;
|
|
44
|
+
}
|
|
45
|
+
export interface AddTaskParams {
|
|
46
|
+
module: TaskModuleName;
|
|
47
|
+
queueId: TaskQueueName;
|
|
48
|
+
tasks: Task[];
|
|
49
|
+
}
|
|
50
|
+
export interface TaskRunResult {
|
|
51
|
+
status: TaskRunStatus;
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
}
|
|
54
|
+
export interface TasksModule {
|
|
55
|
+
[key: TaskModuleName]: {
|
|
56
|
+
[key: TaskQueueName]: {
|
|
57
|
+
status: TaskStatus;
|
|
58
|
+
tasks: Task[];
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TasksModule } from './type';
|
|
2
|
-
declare const useTasks: () => {
|
|
3
|
-
tasks: TasksModule;
|
|
4
|
-
};
|
|
5
|
-
export default useTasks;
|
|
1
|
+
import { TasksModule } from './type';
|
|
2
|
+
declare const useTasks: () => {
|
|
3
|
+
tasks: TasksModule;
|
|
4
|
+
};
|
|
5
|
+
export default useTasks;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export interface CoreConfig {
|
|
2
|
-
}
|
|
1
|
+
export interface CoreConfig {
|
|
2
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export declare const useVariablesContext: () => any;
|
|
3
|
-
interface VariablesProviderProps {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
}
|
|
6
|
-
export declare const VariablesProvider: React.FC<VariablesProviderProps>;
|
|
7
|
-
export {};
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const useVariablesContext: () => any;
|
|
3
|
+
interface VariablesProviderProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const VariablesProvider: React.FC<VariablesProviderProps>;
|
|
7
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { VariablesConfig } from './type';
|
|
2
|
-
export declare const setConfig: (newConfig: Partial<VariablesConfig>) => void;
|
|
3
|
-
export declare const getConfig: () => VariablesConfig;
|
|
1
|
+
import { VariablesConfig } from './type';
|
|
2
|
+
export declare const setConfig: (newConfig: Partial<VariablesConfig>) => void;
|
|
3
|
+
export declare const getConfig: () => VariablesConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type VariableMap = Record<string, string>;
|
|
2
|
-
declare const _default: {
|
|
3
|
-
setConfig: (newConfig: Partial<import("./type").VariablesConfig>) => void;
|
|
4
|
-
getConfig: () => import("./type").VariablesConfig;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
1
|
+
export type VariableMap = Record<string, string>;
|
|
2
|
+
declare const _default: {
|
|
3
|
+
setConfig: (newConfig: Partial<import("./type").VariablesConfig>) => void;
|
|
4
|
+
getConfig: () => import("./type").VariablesConfig;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export interface VariablesConfig {
|
|
2
|
-
}
|
|
1
|
+
export interface VariablesConfig {
|
|
2
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
setTitle: (title: string) => void;
|
|
3
|
-
setIcon: (paramsIcon: string) => void;
|
|
4
|
-
setAppleWebAppTitle: (title: string) => void;
|
|
5
|
-
};
|
|
6
|
-
export default _default;
|
|
1
|
+
declare const _default: {
|
|
2
|
+
setTitle: (title: string) => void;
|
|
3
|
+
setIcon: (paramsIcon: string) => void;
|
|
4
|
+
setAppleWebAppTitle: (title: string) => void;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
package/dist/plugins/request.js
CHANGED
|
@@ -27,20 +27,20 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
27
27
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
28
28
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
29
29
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
30
|
-
/**
|
|
31
|
-
* RequestPlugin 接口定义
|
|
30
|
+
/**
|
|
31
|
+
* RequestPlugin 接口定义
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
|
-
/**
|
|
35
|
-
* 请求配置
|
|
34
|
+
/**
|
|
35
|
+
* 请求配置
|
|
36
36
|
*/
|
|
37
37
|
|
|
38
|
-
/**
|
|
39
|
-
* 响应接口
|
|
38
|
+
/**
|
|
39
|
+
* 响应接口
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
|
-
/**
|
|
43
|
-
* 请求错误
|
|
42
|
+
/**
|
|
43
|
+
* 请求错误
|
|
44
44
|
*/
|
|
45
45
|
export var RequestError = /*#__PURE__*/function (_Error) {
|
|
46
46
|
_inherits(RequestError, _Error);
|
|
@@ -61,8 +61,8 @@ export var RequestError = /*#__PURE__*/function (_Error) {
|
|
|
61
61
|
return _createClass(RequestError);
|
|
62
62
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
63
63
|
|
|
64
|
-
/**
|
|
65
|
-
* RequestPlugin 实现
|
|
64
|
+
/**
|
|
65
|
+
* RequestPlugin 实现
|
|
66
66
|
*/
|
|
67
67
|
var RequestPluginImpl = /*#__PURE__*/function () {
|
|
68
68
|
function RequestPluginImpl() {
|
|
@@ -70,8 +70,8 @@ var RequestPluginImpl = /*#__PURE__*/function () {
|
|
|
70
70
|
_defineProperty(this, "name", 'request');
|
|
71
71
|
_defineProperty(this, "version", '1.0.0');
|
|
72
72
|
_defineProperty(this, "core", null);
|
|
73
|
-
/**
|
|
74
|
-
* 默认请求选项
|
|
73
|
+
/**
|
|
74
|
+
* 默认请求选项
|
|
75
75
|
*/
|
|
76
76
|
_defineProperty(this, "defaultOptions", {
|
|
77
77
|
method: 'GET',
|
|
@@ -81,8 +81,8 @@ var RequestPluginImpl = /*#__PURE__*/function () {
|
|
|
81
81
|
timeout: 30000,
|
|
82
82
|
responseType: 'json'
|
|
83
83
|
});
|
|
84
|
-
/**
|
|
85
|
-
* 全局拦截器
|
|
84
|
+
/**
|
|
85
|
+
* 全局拦截器
|
|
86
86
|
*/
|
|
87
87
|
_defineProperty(this, "interceptors", {
|
|
88
88
|
request: [],
|
|
@@ -106,8 +106,8 @@ var RequestPluginImpl = /*#__PURE__*/function () {
|
|
|
106
106
|
console.log('[RequestPlugin] 已销毁');
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
/**
|
|
110
|
-
* 添加请求拦截器
|
|
109
|
+
/**
|
|
110
|
+
* 添加请求拦截器
|
|
111
111
|
*/
|
|
112
112
|
}, {
|
|
113
113
|
key: "addRequestInterceptor",
|
|
@@ -115,8 +115,8 @@ var RequestPluginImpl = /*#__PURE__*/function () {
|
|
|
115
115
|
this.interceptors.request.push(interceptor);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
/**
|
|
119
|
-
* 添加响应拦截器
|
|
118
|
+
/**
|
|
119
|
+
* 添加响应拦截器
|
|
120
120
|
*/
|
|
121
121
|
}, {
|
|
122
122
|
key: "addResponseInterceptor",
|
|
@@ -124,8 +124,8 @@ var RequestPluginImpl = /*#__PURE__*/function () {
|
|
|
124
124
|
this.interceptors.response.push(interceptor);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
/**
|
|
128
|
-
* 添加错误拦截器
|
|
127
|
+
/**
|
|
128
|
+
* 添加错误拦截器
|
|
129
129
|
*/
|
|
130
130
|
}, {
|
|
131
131
|
key: "addErrorInterceptor",
|
|
@@ -133,8 +133,8 @@ var RequestPluginImpl = /*#__PURE__*/function () {
|
|
|
133
133
|
this.interceptors.error.push(interceptor);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
/**
|
|
137
|
-
* GET 请求
|
|
136
|
+
/**
|
|
137
|
+
* GET 请求
|
|
138
138
|
*/
|
|
139
139
|
}, {
|
|
140
140
|
key: "get",
|
|
@@ -146,8 +146,8 @@ var RequestPluginImpl = /*#__PURE__*/function () {
|
|
|
146
146
|
}));
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
/**
|
|
150
|
-
* POST 请求
|
|
149
|
+
/**
|
|
150
|
+
* POST 请求
|
|
151
151
|
*/
|
|
152
152
|
}, {
|
|
153
153
|
key: "post",
|
|
@@ -160,8 +160,8 @@ var RequestPluginImpl = /*#__PURE__*/function () {
|
|
|
160
160
|
}));
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
/**
|
|
164
|
-
* PUT 请求
|
|
163
|
+
/**
|
|
164
|
+
* PUT 请求
|
|
165
165
|
*/
|
|
166
166
|
}, {
|
|
167
167
|
key: "put",
|
|
@@ -174,8 +174,8 @@ var RequestPluginImpl = /*#__PURE__*/function () {
|
|
|
174
174
|
}));
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
/**
|
|
178
|
-
* DELETE 请求
|
|
177
|
+
/**
|
|
178
|
+
* DELETE 请求
|
|
179
179
|
*/
|
|
180
180
|
}, {
|
|
181
181
|
key: "delete",
|
|
@@ -187,8 +187,8 @@ var RequestPluginImpl = /*#__PURE__*/function () {
|
|
|
187
187
|
}));
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
/**
|
|
191
|
-
* 通用请求方法
|
|
190
|
+
/**
|
|
191
|
+
* 通用请求方法
|
|
192
192
|
*/
|
|
193
193
|
}, {
|
|
194
194
|
key: "request",
|
|
@@ -411,9 +411,9 @@ var RequestPluginImpl = /*#__PURE__*/function () {
|
|
|
411
411
|
}
|
|
412
412
|
return request;
|
|
413
413
|
}()
|
|
414
|
-
/**
|
|
415
|
-
* 执行实际的请求
|
|
416
|
-
* 这里实现了一个基于 fetch API 的请求
|
|
414
|
+
/**
|
|
415
|
+
* 执行实际的请求
|
|
416
|
+
* 这里实现了一个基于 fetch API 的请求
|
|
417
417
|
*/
|
|
418
418
|
)
|
|
419
419
|
}, {
|
package/dist/plugins/window.js
CHANGED
|
@@ -5,11 +5,11 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
-
/**
|
|
9
|
-
* WindowPlugin 接口定义
|
|
8
|
+
/**
|
|
9
|
+
* WindowPlugin 接口定义
|
|
10
10
|
*/
|
|
11
|
-
/**
|
|
12
|
-
* 简单的 Storage 接口实现
|
|
11
|
+
/**
|
|
12
|
+
* 简单的 Storage 接口实现
|
|
13
13
|
*/
|
|
14
14
|
var SimpleStorage = /*#__PURE__*/function () {
|
|
15
15
|
function SimpleStorage() {
|
|
@@ -50,8 +50,8 @@ var SimpleStorage = /*#__PURE__*/function () {
|
|
|
50
50
|
}]);
|
|
51
51
|
return SimpleStorage;
|
|
52
52
|
}();
|
|
53
|
-
/**
|
|
54
|
-
* 简单的 Location 类实现
|
|
53
|
+
/**
|
|
54
|
+
* 简单的 Location 类实现
|
|
55
55
|
*/
|
|
56
56
|
var SimpleLocation = /*#__PURE__*/function () {
|
|
57
57
|
function SimpleLocation() {
|
|
@@ -84,8 +84,8 @@ var SimpleLocation = /*#__PURE__*/function () {
|
|
|
84
84
|
}]);
|
|
85
85
|
return SimpleLocation;
|
|
86
86
|
}();
|
|
87
|
-
/**
|
|
88
|
-
* 简单的 Navigator 类实现
|
|
87
|
+
/**
|
|
88
|
+
* 简单的 Navigator 类实现
|
|
89
89
|
*/
|
|
90
90
|
var SimpleNavigator = /*#__PURE__*/function () {
|
|
91
91
|
function SimpleNavigator() {
|
|
@@ -110,8 +110,8 @@ var SimpleNavigator = /*#__PURE__*/function () {
|
|
|
110
110
|
}]);
|
|
111
111
|
return SimpleNavigator;
|
|
112
112
|
}();
|
|
113
|
-
/**
|
|
114
|
-
* 简单的 History 接口实现
|
|
113
|
+
/**
|
|
114
|
+
* 简单的 History 接口实现
|
|
115
115
|
*/
|
|
116
116
|
var SimpleHistory = /*#__PURE__*/function () {
|
|
117
117
|
function SimpleHistory() {
|
|
@@ -138,11 +138,11 @@ var SimpleHistory = /*#__PURE__*/function () {
|
|
|
138
138
|
}]);
|
|
139
139
|
return SimpleHistory;
|
|
140
140
|
}();
|
|
141
|
-
/**
|
|
142
|
-
* 简单 HTMLElement 接口
|
|
141
|
+
/**
|
|
142
|
+
* 简单 HTMLElement 接口
|
|
143
143
|
*/
|
|
144
|
-
/**
|
|
145
|
-
* 简单的 Document 类实现
|
|
144
|
+
/**
|
|
145
|
+
* 简单的 Document 类实现
|
|
146
146
|
*/
|
|
147
147
|
var SimpleDocument = /*#__PURE__*/function () {
|
|
148
148
|
function SimpleDocument() {
|
|
@@ -223,8 +223,8 @@ var SimpleDocument = /*#__PURE__*/function () {
|
|
|
223
223
|
}]);
|
|
224
224
|
return SimpleDocument;
|
|
225
225
|
}();
|
|
226
|
-
/**
|
|
227
|
-
* Window 插件实现
|
|
226
|
+
/**
|
|
227
|
+
* Window 插件实现
|
|
228
228
|
*/
|
|
229
229
|
var WindowPluginImpl = /*#__PURE__*/function () {
|
|
230
230
|
function WindowPluginImpl() {
|