@pisell/pisellos 0.0.220 → 0.0.222

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.
Files changed (199) hide show
  1. package/README.md +180 -180
  2. package/dist/core/index.js +4 -4
  3. package/dist/index.js +3 -3
  4. package/dist/modules/Account/types.js +6 -6
  5. package/dist/modules/AccountList/index.js +14 -14
  6. package/dist/modules/AccountList/types.js +14 -14
  7. package/dist/modules/AccountList/utils.js +5 -5
  8. package/dist/modules/Cart/index.js +35 -35
  9. package/dist/modules/Cart/types.js +14 -14
  10. package/dist/modules/Cart/utils/cartAccount.js +8 -8
  11. package/dist/modules/Cart/utils/cartDate.js +12 -12
  12. package/dist/modules/Cart/utils/cartDiscount.js +8 -8
  13. package/dist/modules/Cart/utils/cartNote.js +8 -8
  14. package/dist/modules/Cart/utils/cartProduct.js +39 -39
  15. package/dist/modules/Cart/utils/cartRelationForms.js +8 -8
  16. package/dist/modules/Cart/utils/cartResource.js +8 -8
  17. package/dist/modules/Cart/utils/index.js +4 -4
  18. package/dist/modules/Customer/index.js +67 -67
  19. package/dist/modules/Customer/types.js +18 -18
  20. package/dist/modules/Date/types.js +6 -6
  21. package/dist/modules/Date/utils.js +25 -25
  22. package/dist/modules/Guests/types.js +8 -8
  23. package/dist/modules/Order/types.js +4 -4
  24. package/dist/modules/Order/utils.js +8 -8
  25. package/dist/modules/Payment/cash.js +2 -2
  26. package/dist/modules/Payment/eftpos.js +2 -2
  27. package/dist/modules/Payment/index.js +135 -135
  28. package/dist/modules/Payment/types.js +50 -50
  29. package/dist/modules/Payment/wallet.js +2 -2
  30. package/dist/modules/Product/index.js +22 -22
  31. package/dist/modules/Product/utils.js +12 -12
  32. package/dist/modules/ProductList/index.js +4 -4
  33. package/dist/modules/Resource/types.js +8 -8
  34. package/dist/modules/Resource/utils.js +14 -14
  35. package/dist/modules/Schedule/index.js +4 -4
  36. package/dist/modules/Schedule/utils.js +73 -73
  37. package/dist/modules/Step/index.js +18 -18
  38. package/dist/modules/Summary/index.js +4 -4
  39. package/dist/modules/Summary/utils.js +15 -15
  40. package/dist/plugins/app-types/app/app.d.ts +83 -83
  41. package/dist/plugins/app-types/app/const.d.ts +4 -4
  42. package/dist/plugins/app-types/app/index.d.ts +14 -14
  43. package/dist/plugins/app-types/applicationManager/application.d.ts +50 -50
  44. package/dist/plugins/app-types/applicationManager/index.d.ts +13 -13
  45. package/dist/plugins/app-types/config.d.ts +3 -3
  46. package/dist/plugins/app-types/cookie/index.d.ts +13 -13
  47. package/dist/plugins/app-types/data/index.d.ts +8 -8
  48. package/dist/plugins/app-types/history/config.d.ts +24 -24
  49. package/dist/plugins/app-types/history/index.d.ts +20 -20
  50. package/dist/plugins/app-types/history/type.d.ts +2 -2
  51. package/dist/plugins/app-types/hooks/index.d.ts +12 -12
  52. package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -2
  53. package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +2 -2
  54. package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +13 -13
  55. package/dist/plugins/app-types/hooks/useStore/index.d.ts +6 -6
  56. package/dist/plugins/app-types/index.d.ts +6 -6
  57. package/dist/plugins/app-types/indexDB/index.d.ts +178 -178
  58. package/dist/plugins/app-types/locales/en.d.ts +3 -3
  59. package/dist/plugins/app-types/locales/index.d.ts +37 -37
  60. package/dist/plugins/app-types/locales/original.d.ts +3 -3
  61. package/dist/plugins/app-types/locales/type.d.ts +19 -19
  62. package/dist/plugins/app-types/locales/zh-CN.d.ts +3 -3
  63. package/dist/plugins/app-types/locales/zh-HK.d.ts +3 -3
  64. package/dist/plugins/app-types/logger/feishu.d.ts +11 -11
  65. package/dist/plugins/app-types/logger/index.d.ts +122 -122
  66. package/dist/plugins/app-types/menuManager/hooks.d.ts +17 -17
  67. package/dist/plugins/app-types/menuManager/index.d.ts +28 -28
  68. package/dist/plugins/app-types/models/global.d.ts +32 -32
  69. package/dist/plugins/app-types/models/index.d.ts +45 -45
  70. package/dist/plugins/app-types/models/type.d.ts +2 -2
  71. package/dist/plugins/app-types/package.json +14 -14
  72. package/dist/plugins/app-types/pubsub/example.d.ts +5 -5
  73. package/dist/plugins/app-types/pubsub/index.d.ts +63 -63
  74. package/dist/plugins/app-types/request/cache.d.ts +46 -46
  75. package/dist/plugins/app-types/request/cancelToken.d.ts +38 -38
  76. package/dist/plugins/app-types/request/config.d.ts +3 -3
  77. package/dist/plugins/app-types/request/constants.d.ts +2 -2
  78. package/dist/plugins/app-types/request/index.d.ts +24 -24
  79. package/dist/plugins/app-types/request/pisell2Request.d.ts +6 -6
  80. package/dist/plugins/app-types/request/type.d.ts +41 -41
  81. package/dist/plugins/app-types/request/utils.d.ts +46 -46
  82. package/dist/plugins/app-types/routes/config.d.ts +7 -7
  83. package/dist/plugins/app-types/routes/index.d.ts +28 -28
  84. package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -6
  85. package/dist/plugins/app-types/socket/components/index.d.ts +2 -2
  86. package/dist/plugins/app-types/socket/constants.d.ts +33 -33
  87. package/dist/plugins/app-types/socket/events.d.ts +31 -31
  88. package/dist/plugins/app-types/socket/heartbeat.d.ts +66 -66
  89. package/dist/plugins/app-types/socket/index.d.ts +61 -61
  90. package/dist/plugins/app-types/socket/monitor.d.ts +169 -169
  91. package/dist/plugins/app-types/socket/reconnect.d.ts +61 -61
  92. package/dist/plugins/app-types/socket/socket.d.ts +129 -129
  93. package/dist/plugins/app-types/socket/types.d.ts +85 -85
  94. package/dist/plugins/app-types/storage/index.d.ts +17 -17
  95. package/dist/plugins/app-types/tasks/index.d.ts +77 -77
  96. package/dist/plugins/app-types/tasks/type.d.ts +62 -62
  97. package/dist/plugins/app-types/tasks/useTasks.d.ts +5 -5
  98. package/dist/plugins/app-types/type.d.ts +2 -2
  99. package/dist/plugins/app-types/variables/VariablesProvider.d.ts +7 -7
  100. package/dist/plugins/app-types/variables/config.d.ts +3 -3
  101. package/dist/plugins/app-types/variables/index.d.ts +6 -6
  102. package/dist/plugins/app-types/variables/type.d.ts +2 -2
  103. package/dist/plugins/app-types/website/index.d.ts +6 -6
  104. package/dist/plugins/request.js +33 -33
  105. package/dist/plugins/window.js +16 -16
  106. package/dist/solution/BookingByStep/index.js +126 -126
  107. package/dist/solution/BookingByStep/utils/capacity.js +30 -30
  108. package/dist/solution/BookingByStep/utils/products.js +4 -4
  109. package/dist/solution/BookingByStep/utils/resources.js +146 -146
  110. package/dist/solution/BookingByStep/utils/timeslots.js +20 -20
  111. package/dist/solution/BookingTicket/index.d.ts +13 -1
  112. package/dist/solution/BookingTicket/index.js +109 -86
  113. package/dist/solution/BookingTicket/types.js +8 -8
  114. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +6 -6
  115. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -4
  116. package/dist/solution/BookingTicket/utils/scan/handleScan.js +20 -28
  117. package/dist/solution/BookingTicket/utils/scan/index.d.ts +13 -0
  118. package/dist/solution/BookingTicket/utils/scan/index.js +64 -21
  119. package/dist/solution/BookingTicket/utils/scan/scanCache.js +52 -52
  120. package/dist/solution/BuyTickets/types.js +4 -4
  121. package/dist/utils/task.d.ts +5 -1
  122. package/dist/utils/task.js +22 -38
  123. package/dist/utils/watch.d.ts +1 -1
  124. package/dist/utils/watch.js +60 -60
  125. package/lib/plugins/app-types/app/app.d.ts +83 -83
  126. package/lib/plugins/app-types/app/const.d.ts +4 -4
  127. package/lib/plugins/app-types/app/index.d.ts +14 -14
  128. package/lib/plugins/app-types/applicationManager/application.d.ts +50 -50
  129. package/lib/plugins/app-types/applicationManager/index.d.ts +13 -13
  130. package/lib/plugins/app-types/config.d.ts +3 -3
  131. package/lib/plugins/app-types/cookie/index.d.ts +13 -13
  132. package/lib/plugins/app-types/data/index.d.ts +8 -8
  133. package/lib/plugins/app-types/history/config.d.ts +24 -24
  134. package/lib/plugins/app-types/history/index.d.ts +20 -20
  135. package/lib/plugins/app-types/history/type.d.ts +2 -2
  136. package/lib/plugins/app-types/hooks/index.d.ts +12 -12
  137. package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -2
  138. package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +2 -2
  139. package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +13 -13
  140. package/lib/plugins/app-types/hooks/useStore/index.d.ts +6 -6
  141. package/lib/plugins/app-types/index.d.ts +6 -6
  142. package/lib/plugins/app-types/indexDB/index.d.ts +178 -178
  143. package/lib/plugins/app-types/locales/en.d.ts +3 -3
  144. package/lib/plugins/app-types/locales/index.d.ts +37 -37
  145. package/lib/plugins/app-types/locales/original.d.ts +3 -3
  146. package/lib/plugins/app-types/locales/type.d.ts +19 -19
  147. package/lib/plugins/app-types/locales/zh-CN.d.ts +3 -3
  148. package/lib/plugins/app-types/locales/zh-HK.d.ts +3 -3
  149. package/lib/plugins/app-types/logger/feishu.d.ts +11 -11
  150. package/lib/plugins/app-types/logger/index.d.ts +122 -122
  151. package/lib/plugins/app-types/menuManager/hooks.d.ts +17 -17
  152. package/lib/plugins/app-types/menuManager/index.d.ts +28 -28
  153. package/lib/plugins/app-types/models/global.d.ts +32 -32
  154. package/lib/plugins/app-types/models/index.d.ts +45 -45
  155. package/lib/plugins/app-types/models/type.d.ts +2 -2
  156. package/lib/plugins/app-types/package.json +14 -14
  157. package/lib/plugins/app-types/pubsub/example.d.ts +5 -5
  158. package/lib/plugins/app-types/pubsub/index.d.ts +63 -63
  159. package/lib/plugins/app-types/request/cache.d.ts +46 -46
  160. package/lib/plugins/app-types/request/cancelToken.d.ts +38 -38
  161. package/lib/plugins/app-types/request/config.d.ts +3 -3
  162. package/lib/plugins/app-types/request/constants.d.ts +2 -2
  163. package/lib/plugins/app-types/request/index.d.ts +24 -24
  164. package/lib/plugins/app-types/request/pisell2Request.d.ts +6 -6
  165. package/lib/plugins/app-types/request/type.d.ts +41 -41
  166. package/lib/plugins/app-types/request/utils.d.ts +46 -46
  167. package/lib/plugins/app-types/routes/config.d.ts +7 -7
  168. package/lib/plugins/app-types/routes/index.d.ts +28 -28
  169. package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -6
  170. package/lib/plugins/app-types/socket/components/index.d.ts +2 -2
  171. package/lib/plugins/app-types/socket/constants.d.ts +33 -33
  172. package/lib/plugins/app-types/socket/events.d.ts +31 -31
  173. package/lib/plugins/app-types/socket/heartbeat.d.ts +66 -66
  174. package/lib/plugins/app-types/socket/index.d.ts +61 -61
  175. package/lib/plugins/app-types/socket/monitor.d.ts +169 -169
  176. package/lib/plugins/app-types/socket/reconnect.d.ts +61 -61
  177. package/lib/plugins/app-types/socket/socket.d.ts +129 -129
  178. package/lib/plugins/app-types/socket/types.d.ts +85 -85
  179. package/lib/plugins/app-types/storage/index.d.ts +17 -17
  180. package/lib/plugins/app-types/tasks/index.d.ts +77 -77
  181. package/lib/plugins/app-types/tasks/type.d.ts +62 -62
  182. package/lib/plugins/app-types/tasks/useTasks.d.ts +5 -5
  183. package/lib/plugins/app-types/type.d.ts +2 -2
  184. package/lib/plugins/app-types/variables/VariablesProvider.d.ts +7 -7
  185. package/lib/plugins/app-types/variables/config.d.ts +3 -3
  186. package/lib/plugins/app-types/variables/index.d.ts +6 -6
  187. package/lib/plugins/app-types/variables/type.d.ts +2 -2
  188. package/lib/plugins/app-types/website/index.d.ts +6 -6
  189. package/lib/solution/BookingTicket/index.d.ts +13 -1
  190. package/lib/solution/BookingTicket/index.js +19 -2
  191. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -4
  192. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -14
  193. package/lib/solution/BookingTicket/utils/scan/index.d.ts +13 -0
  194. package/lib/solution/BookingTicket/utils/scan/index.js +32 -0
  195. package/lib/utils/task.d.ts +5 -1
  196. package/lib/utils/task.js +8 -1
  197. package/lib/utils/watch.d.ts +1 -1
  198. package/lib/utils/watch.js +1 -1
  199. 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;
@@ -111,7 +111,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
111
111
  * 获取当前的客户搜索条件
112
112
  * @returns 当前搜索条件
113
113
  */
114
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
114
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
115
115
  /**
116
116
  * 获取客户列表状态(包含滚动加载相关状态)
117
117
  * @returns 客户状态
@@ -138,6 +138,18 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
138
138
  activateCamera(data?: {
139
139
  [key: string]: any;
140
140
  }): void;
141
+ /**
142
+ * 禁用所有扫描监听
143
+ */
144
+ disableAllScanListeners(): void;
145
+ /**
146
+ * 启用所有扫描监听
147
+ */
148
+ enableAllScanListeners(): void;
149
+ /**
150
+ * 清空所有扫描监听对应的任务执行队列
151
+ */
152
+ clearAllScanListenersTaskQueue(): void;
141
153
  /**
142
154
  * 设置其他参数
143
155
  * @param params 参数
@@ -314,8 +314,7 @@ var BookingTicketImpl = class extends import_BaseModule.BaseModule {
314
314
  * @param callback 回调
315
315
  */
316
316
  scanCustomerListener(callback) {
317
- const localSearch = (v) => this.store.products.findProductsByCodeOrBarcode(v);
318
- const scanCallback = (0, import_handleScan.handleCustomerScan)(this.request, localSearch);
317
+ const scanCallback = (0, import_handleScan.handleCustomerScan)();
319
318
  const safeCallback = (d) => {
320
319
  try {
321
320
  callback(d);
@@ -339,6 +338,24 @@ var BookingTicketImpl = class extends import_BaseModule.BaseModule {
339
338
  data
340
339
  });
341
340
  }
341
+ /**
342
+ * 禁用所有扫描监听
343
+ */
344
+ disableAllScanListeners() {
345
+ this.scan.disableAllListeners();
346
+ }
347
+ /**
348
+ * 启用所有扫描监听
349
+ */
350
+ enableAllScanListeners() {
351
+ this.scan.enableAllListeners();
352
+ }
353
+ /**
354
+ * 清空所有扫描监听对应的任务执行队列
355
+ */
356
+ clearAllScanListenersTaskQueue() {
357
+ this.scan.clearTaskQueue();
358
+ }
342
359
  /**
343
360
  * 设置其他参数
344
361
  * @param params 参数
@@ -13,7 +13,4 @@ export declare const handleGlobalScan: (request: RequestPlugin, localSearch: (v:
13
13
  * @param request 请求插件
14
14
  * @returns 处理结果
15
15
  */
16
- export declare const handleCustomerScan: (request: RequestPlugin, localSearch: (v: string) => any[]) => (scanResult: {
17
- type: string;
18
- value: string;
19
- }) => Promise<any>;
16
+ export declare const handleCustomerScan: () => () => Promise<{}>;
@@ -115,20 +115,8 @@ var handleGlobalScan = (request, localSearch) => {
115
115
  };
116
116
  return handleScanFn(getRequestList, localSearch);
117
117
  };
118
- var handleCustomerScan = (request, localSearch) => {
119
- const getRequestList = (value) => {
120
- let requestList = [];
121
- if (value.startsWith("WL")) {
122
- requestList = [(0, import_cloudSearch.searchWallet)(request, value)];
123
- } else {
124
- requestList = [
125
- (0, import_cloudSearch.searchWalletPass)(request, value),
126
- (0, import_cloudSearch.searchWallet)(request, value)
127
- ];
128
- }
129
- return requestList;
130
- };
131
- return handleScanFn(getRequestList, localSearch);
118
+ var handleCustomerScan = () => {
119
+ return () => Promise.resolve({});
132
120
  };
133
121
  // Annotate the CommonJS export names for ESM import in node:
134
122
  0 && (module.exports = {
@@ -32,6 +32,19 @@ export default class Scan {
32
32
  * @param event 事件
33
33
  */
34
34
  removeListener(event: WatchEventItem): void;
35
+ /**
36
+ * 启用所有监听
37
+ */
38
+ enableAllListeners(): void;
39
+ /**
40
+ * 禁用所有监听,并清空任务执行队列
41
+ */
42
+ disableAllListeners(): void;
43
+ /**
44
+ * 清空监听对应的任务执行队列,不传入eventKey则清空所有监听对应的任务执行队列
45
+ * @param eventKey 事件key
46
+ */
47
+ clearTaskQueue(eventKey?: string): void;
35
48
  /**
36
49
  * 处理扫码事件
37
50
  * @param eventKey 事件key
@@ -85,6 +85,38 @@ var Scan = class {
85
85
  (_a = this.listenerConfig.get(event.key)) == null ? void 0 : _a.task.clear();
86
86
  this.listenerConfig.delete(event.key);
87
87
  }
88
+ /**
89
+ * 启用所有监听
90
+ */
91
+ enableAllListeners() {
92
+ import_watch.default.enableAllEventByWatchKey(this.watchKey);
93
+ }
94
+ /**
95
+ * 禁用所有监听,并清空任务执行队列
96
+ */
97
+ disableAllListeners() {
98
+ var _a, _b;
99
+ import_watch.default.disabledAllEventByWatchKey(this.watchKey);
100
+ (_b = (_a = this.listenerConfig) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(_a, (item) => {
101
+ var _a2;
102
+ (_a2 = item == null ? void 0 : item.task) == null ? void 0 : _a2.clearTaskQueue();
103
+ });
104
+ }
105
+ /**
106
+ * 清空监听对应的任务执行队列,不传入eventKey则清空所有监听对应的任务执行队列
107
+ * @param eventKey 事件key
108
+ */
109
+ clearTaskQueue(eventKey) {
110
+ var _a, _b, _c;
111
+ if (eventKey) {
112
+ (_a = this.listenerConfig.get(eventKey)) == null ? void 0 : _a.task.clearTaskQueue();
113
+ } else {
114
+ (_c = (_b = this.listenerConfig) == null ? void 0 : _b.forEach) == null ? void 0 : _c.call(_b, (item) => {
115
+ var _a2;
116
+ (_a2 = item == null ? void 0 : item.task) == null ? void 0 : _a2.clearTaskQueue();
117
+ });
118
+ }
119
+ }
88
120
  /**
89
121
  * 处理扫码事件
90
122
  * @param eventKey 事件key
@@ -9,9 +9,13 @@ declare class Tasks {
9
9
  isRunning: boolean;
10
10
  constructor(actions?: Map<string, Action>);
11
11
  /**
12
- * 清空任务队列
12
+ * 清空所有任务
13
13
  */
14
14
  clear(): void;
15
+ /**
16
+ * 清空任务执行队列
17
+ */
18
+ clearTaskQueue(): void;
15
19
  /**
16
20
  * 添加action
17
21
  * @param name action名称
package/lib/utils/task.js CHANGED
@@ -32,13 +32,20 @@ var Tasks = class {
32
32
  }
33
33
  }
34
34
  /**
35
- * 清空任务队列
35
+ * 清空所有任务
36
36
  */
37
37
  clear() {
38
38
  this.actions.clear();
39
39
  this.taskQueue = [];
40
40
  this.isRunning = false;
41
41
  }
42
+ /**
43
+ * 清空任务执行队列
44
+ */
45
+ clearTaskQueue() {
46
+ this.taskQueue = [];
47
+ this.isRunning = false;
48
+ }
42
49
  /**
43
50
  * 添加action
44
51
  * @param name action名称
@@ -73,7 +73,7 @@ declare class Watch {
73
73
  * @param event 事件名称
74
74
  * @returns 是否成功移除
75
75
  */
76
- clearEvent(watchKey: string): boolean;
76
+ clearEvent(watchKey: string): void;
77
77
  /**
78
78
  * 移除所有事件订阅
79
79
  */
@@ -170,7 +170,7 @@ var Watch = class {
170
170
  */
171
171
  clearEvent(watchKey) {
172
172
  this.disabledAllEventByWatchKey(watchKey);
173
- return this.events.delete(watchKey);
173
+ this.events.delete(watchKey);
174
174
  }
175
175
  /**
176
176
  * 移除所有事件订阅
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.220",
4
+ "version": "0.0.222",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",