@pisell/pisellos 3.0.57 → 3.0.59

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 (256) hide show
  1. package/dist/core/index.js +1 -2
  2. package/dist/effects/index.d.ts +3 -4
  3. package/dist/effects/index.js +6 -15
  4. package/dist/modules/AccountList/index.d.ts +1 -7
  5. package/dist/modules/AccountList/index.js +14 -81
  6. package/dist/modules/AccountList/types.d.ts +0 -28
  7. package/dist/modules/AccountList/types.js +0 -8
  8. package/dist/modules/Cart/index.js +1 -1
  9. package/dist/modules/Payment/index.d.ts +9 -273
  10. package/dist/modules/Payment/index.js +109 -2525
  11. package/dist/modules/Payment/types.d.ts +30 -382
  12. package/dist/modules/Payment/types.js +14 -116
  13. package/dist/modules/ProductList/index.d.ts +1 -12
  14. package/dist/modules/ProductList/index.js +3 -27
  15. package/dist/modules/Rules/index.js +14 -27
  16. package/dist/modules/Rules/types.d.ts +0 -1
  17. package/dist/modules/index.d.ts +0 -1
  18. package/dist/modules/index.js +0 -1
  19. package/dist/plugins/window.d.ts +0 -1
  20. package/dist/solution/BookingByStep/index.js +1 -9
  21. package/dist/solution/ShopDiscount/index.js +2 -4
  22. package/dist/solution/index.d.ts +0 -2
  23. package/dist/solution/index.js +1 -3
  24. package/dist/types/index.d.ts +1 -3
  25. package/lib/core/index.js +1 -1
  26. package/lib/effects/index.d.ts +3 -4
  27. package/lib/effects/index.js +1 -4
  28. package/lib/modules/AccountList/index.d.ts +1 -7
  29. package/lib/modules/AccountList/index.js +0 -27
  30. package/lib/modules/AccountList/types.d.ts +0 -28
  31. package/lib/modules/Cart/index.js +1 -1
  32. package/lib/modules/Payment/index.d.ts +9 -273
  33. package/lib/modules/Payment/index.js +50 -1285
  34. package/lib/modules/Payment/types.d.ts +30 -382
  35. package/lib/modules/Payment/types.js +6 -41
  36. package/lib/modules/ProductList/index.d.ts +1 -12
  37. package/lib/modules/ProductList/index.js +2 -29
  38. package/lib/modules/Rules/index.js +12 -20
  39. package/lib/modules/Rules/types.d.ts +0 -1
  40. package/lib/modules/index.d.ts +0 -1
  41. package/lib/modules/index.js +0 -2
  42. package/lib/plugins/window.d.ts +0 -1
  43. package/lib/solution/BookingByStep/index.js +2 -1
  44. package/lib/solution/ShopDiscount/index.js +1 -2
  45. package/lib/solution/index.d.ts +0 -2
  46. package/lib/solution/index.js +1 -5
  47. package/lib/types/index.d.ts +1 -3
  48. package/package.json +2 -4
  49. package/dist/modules/Customer/constants.d.ts +0 -7
  50. package/dist/modules/Customer/constants.js +0 -12
  51. package/dist/modules/Customer/index.d.ts +0 -122
  52. package/dist/modules/Customer/index.js +0 -697
  53. package/dist/modules/Customer/types.d.ts +0 -146
  54. package/dist/modules/Customer/types.js +0 -41
  55. package/dist/modules/Payment/cash.d.ts +0 -11
  56. package/dist/modules/Payment/cash.js +0 -78
  57. package/dist/modules/Payment/eftpos.d.ts +0 -11
  58. package/dist/modules/Payment/eftpos.js +0 -80
  59. package/dist/modules/Payment/wallet.d.ts +0 -11
  60. package/dist/modules/Payment/wallet.js +0 -78
  61. package/dist/modules/Payment/walletpass.d.ts +0 -0
  62. package/dist/modules/Payment/walletpass.js +0 -0
  63. package/dist/plugins/app-types/app/app.d.ts +0 -83
  64. package/dist/plugins/app-types/app/const.d.ts +0 -4
  65. package/dist/plugins/app-types/app/index.d.ts +0 -14
  66. package/dist/plugins/app-types/applicationManager/application.d.ts +0 -50
  67. package/dist/plugins/app-types/applicationManager/index.d.ts +0 -13
  68. package/dist/plugins/app-types/config.d.ts +0 -3
  69. package/dist/plugins/app-types/cookie/index.d.ts +0 -13
  70. package/dist/plugins/app-types/data/index.d.ts +0 -8
  71. package/dist/plugins/app-types/history/config.d.ts +0 -24
  72. package/dist/plugins/app-types/history/index.d.ts +0 -20
  73. package/dist/plugins/app-types/history/type.d.ts +0 -2
  74. package/dist/plugins/app-types/hooks/index.d.ts +0 -12
  75. package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  76. package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  77. package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  78. package/dist/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  79. package/dist/plugins/app-types/index.d.ts +0 -6
  80. package/dist/plugins/app-types/indexDB/index.d.ts +0 -178
  81. package/dist/plugins/app-types/locales/en.d.ts +0 -3
  82. package/dist/plugins/app-types/locales/index.d.ts +0 -37
  83. package/dist/plugins/app-types/locales/original.d.ts +0 -3
  84. package/dist/plugins/app-types/locales/type.d.ts +0 -19
  85. package/dist/plugins/app-types/locales/zh-CN.d.ts +0 -3
  86. package/dist/plugins/app-types/locales/zh-HK.d.ts +0 -3
  87. package/dist/plugins/app-types/logger/feishu.d.ts +0 -11
  88. package/dist/plugins/app-types/logger/index.d.ts +0 -122
  89. package/dist/plugins/app-types/menuManager/hooks.d.ts +0 -17
  90. package/dist/plugins/app-types/menuManager/index.d.ts +0 -28
  91. package/dist/plugins/app-types/models/global.d.ts +0 -32
  92. package/dist/plugins/app-types/models/index.d.ts +0 -45
  93. package/dist/plugins/app-types/models/type.d.ts +0 -2
  94. package/dist/plugins/app-types/package.json +0 -15
  95. package/dist/plugins/app-types/plugin/index.d.ts +0 -0
  96. package/dist/plugins/app-types/pubsub/example.d.ts +0 -5
  97. package/dist/plugins/app-types/pubsub/index.d.ts +0 -63
  98. package/dist/plugins/app-types/request/cache.d.ts +0 -46
  99. package/dist/plugins/app-types/request/cancelToken.d.ts +0 -38
  100. package/dist/plugins/app-types/request/config.d.ts +0 -3
  101. package/dist/plugins/app-types/request/constants.d.ts +0 -2
  102. package/dist/plugins/app-types/request/index.d.ts +0 -24
  103. package/dist/plugins/app-types/request/pisell2Request.d.ts +0 -6
  104. package/dist/plugins/app-types/request/type.d.ts +0 -41
  105. package/dist/plugins/app-types/request/utils.d.ts +0 -46
  106. package/dist/plugins/app-types/routes/config.d.ts +0 -7
  107. package/dist/plugins/app-types/routes/index.d.ts +0 -28
  108. package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  109. package/dist/plugins/app-types/socket/components/index.d.ts +0 -2
  110. package/dist/plugins/app-types/socket/constants.d.ts +0 -33
  111. package/dist/plugins/app-types/socket/events.d.ts +0 -31
  112. package/dist/plugins/app-types/socket/heartbeat.d.ts +0 -66
  113. package/dist/plugins/app-types/socket/index.d.ts +0 -61
  114. package/dist/plugins/app-types/socket/monitor.d.ts +0 -169
  115. package/dist/plugins/app-types/socket/reconnect.d.ts +0 -61
  116. package/dist/plugins/app-types/socket/socket.d.ts +0 -129
  117. package/dist/plugins/app-types/socket/types.d.ts +0 -85
  118. package/dist/plugins/app-types/storage/index.d.ts +0 -17
  119. package/dist/plugins/app-types/tasks/index.d.ts +0 -77
  120. package/dist/plugins/app-types/tasks/type.d.ts +0 -62
  121. package/dist/plugins/app-types/tasks/useTasks.d.ts +0 -5
  122. package/dist/plugins/app-types/type.d.ts +0 -2
  123. package/dist/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  124. package/dist/plugins/app-types/variables/config.d.ts +0 -3
  125. package/dist/plugins/app-types/variables/index.d.ts +0 -6
  126. package/dist/plugins/app-types/variables/type.d.ts +0 -2
  127. package/dist/plugins/app-types/website/index.d.ts +0 -6
  128. package/dist/plugins/app.d.ts +0 -8
  129. package/dist/plugins/app.js +0 -1
  130. package/dist/solution/BookingTicket/index.d.ts +0 -172
  131. package/dist/solution/BookingTicket/index.js +0 -665
  132. package/dist/solution/BookingTicket/types.d.ts +0 -68
  133. package/dist/solution/BookingTicket/types.js +0 -43
  134. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  135. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -159
  136. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -16
  137. package/dist/solution/BookingTicket/utils/scan/handleScan.js +0 -174
  138. package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -81
  139. package/dist/solution/BookingTicket/utils/scan/index.js +0 -285
  140. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  141. package/dist/solution/BookingTicket/utils/scan/scanCache.js +0 -305
  142. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  143. package/dist/solution/Checkout/index.d.ts +0 -181
  144. package/dist/solution/Checkout/index.js +0 -1596
  145. package/dist/solution/Checkout/types.d.ts +0 -550
  146. package/dist/solution/Checkout/types.js +0 -132
  147. package/dist/solution/Checkout/utils/index.d.ts +0 -73
  148. package/dist/solution/Checkout/utils/index.js +0 -371
  149. package/dist/utils/task.d.ts +0 -40
  150. package/dist/utils/task.js +0 -171
  151. package/dist/utils/watch.d.ts +0 -102
  152. package/dist/utils/watch.js +0 -294
  153. package/lib/modules/Customer/constants.d.ts +0 -7
  154. package/lib/modules/Customer/constants.js +0 -39
  155. package/lib/modules/Customer/index.d.ts +0 -122
  156. package/lib/modules/Customer/index.js +0 -440
  157. package/lib/modules/Customer/types.d.ts +0 -146
  158. package/lib/modules/Customer/types.js +0 -37
  159. package/lib/modules/Payment/cash.d.ts +0 -11
  160. package/lib/modules/Payment/cash.js +0 -51
  161. package/lib/modules/Payment/eftpos.d.ts +0 -11
  162. package/lib/modules/Payment/eftpos.js +0 -51
  163. package/lib/modules/Payment/wallet.d.ts +0 -11
  164. package/lib/modules/Payment/wallet.js +0 -51
  165. package/lib/modules/Payment/walletpass.d.ts +0 -0
  166. package/lib/modules/Payment/walletpass.js +0 -0
  167. package/lib/plugins/app-types/app/app.d.ts +0 -83
  168. package/lib/plugins/app-types/app/const.d.ts +0 -4
  169. package/lib/plugins/app-types/app/index.d.ts +0 -14
  170. package/lib/plugins/app-types/applicationManager/application.d.ts +0 -50
  171. package/lib/plugins/app-types/applicationManager/index.d.ts +0 -13
  172. package/lib/plugins/app-types/config.d.ts +0 -3
  173. package/lib/plugins/app-types/cookie/index.d.ts +0 -13
  174. package/lib/plugins/app-types/data/index.d.ts +0 -8
  175. package/lib/plugins/app-types/history/config.d.ts +0 -24
  176. package/lib/plugins/app-types/history/index.d.ts +0 -20
  177. package/lib/plugins/app-types/history/type.d.ts +0 -2
  178. package/lib/plugins/app-types/hooks/index.d.ts +0 -12
  179. package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  180. package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  181. package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  182. package/lib/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  183. package/lib/plugins/app-types/index.d.ts +0 -6
  184. package/lib/plugins/app-types/indexDB/index.d.ts +0 -178
  185. package/lib/plugins/app-types/locales/en.d.ts +0 -3
  186. package/lib/plugins/app-types/locales/index.d.ts +0 -37
  187. package/lib/plugins/app-types/locales/original.d.ts +0 -3
  188. package/lib/plugins/app-types/locales/type.d.ts +0 -19
  189. package/lib/plugins/app-types/locales/zh-CN.d.ts +0 -3
  190. package/lib/plugins/app-types/locales/zh-HK.d.ts +0 -3
  191. package/lib/plugins/app-types/logger/feishu.d.ts +0 -11
  192. package/lib/plugins/app-types/logger/index.d.ts +0 -122
  193. package/lib/plugins/app-types/menuManager/hooks.d.ts +0 -17
  194. package/lib/plugins/app-types/menuManager/index.d.ts +0 -28
  195. package/lib/plugins/app-types/models/global.d.ts +0 -32
  196. package/lib/plugins/app-types/models/index.d.ts +0 -45
  197. package/lib/plugins/app-types/models/type.d.ts +0 -2
  198. package/lib/plugins/app-types/package.json +0 -15
  199. package/lib/plugins/app-types/plugin/index.d.ts +0 -0
  200. package/lib/plugins/app-types/pubsub/example.d.ts +0 -5
  201. package/lib/plugins/app-types/pubsub/index.d.ts +0 -63
  202. package/lib/plugins/app-types/request/cache.d.ts +0 -46
  203. package/lib/plugins/app-types/request/cancelToken.d.ts +0 -38
  204. package/lib/plugins/app-types/request/config.d.ts +0 -3
  205. package/lib/plugins/app-types/request/constants.d.ts +0 -2
  206. package/lib/plugins/app-types/request/index.d.ts +0 -24
  207. package/lib/plugins/app-types/request/pisell2Request.d.ts +0 -6
  208. package/lib/plugins/app-types/request/type.d.ts +0 -41
  209. package/lib/plugins/app-types/request/utils.d.ts +0 -46
  210. package/lib/plugins/app-types/routes/config.d.ts +0 -7
  211. package/lib/plugins/app-types/routes/index.d.ts +0 -28
  212. package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  213. package/lib/plugins/app-types/socket/components/index.d.ts +0 -2
  214. package/lib/plugins/app-types/socket/constants.d.ts +0 -33
  215. package/lib/plugins/app-types/socket/events.d.ts +0 -31
  216. package/lib/plugins/app-types/socket/heartbeat.d.ts +0 -66
  217. package/lib/plugins/app-types/socket/index.d.ts +0 -61
  218. package/lib/plugins/app-types/socket/monitor.d.ts +0 -169
  219. package/lib/plugins/app-types/socket/reconnect.d.ts +0 -61
  220. package/lib/plugins/app-types/socket/socket.d.ts +0 -129
  221. package/lib/plugins/app-types/socket/types.d.ts +0 -85
  222. package/lib/plugins/app-types/storage/index.d.ts +0 -17
  223. package/lib/plugins/app-types/tasks/index.d.ts +0 -77
  224. package/lib/plugins/app-types/tasks/type.d.ts +0 -62
  225. package/lib/plugins/app-types/tasks/useTasks.d.ts +0 -5
  226. package/lib/plugins/app-types/type.d.ts +0 -2
  227. package/lib/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  228. package/lib/plugins/app-types/variables/config.d.ts +0 -3
  229. package/lib/plugins/app-types/variables/index.d.ts +0 -6
  230. package/lib/plugins/app-types/variables/type.d.ts +0 -2
  231. package/lib/plugins/app-types/website/index.d.ts +0 -6
  232. package/lib/plugins/app.d.ts +0 -8
  233. package/lib/plugins/app.js +0 -17
  234. package/lib/solution/BookingTicket/index.d.ts +0 -172
  235. package/lib/solution/BookingTicket/index.js +0 -399
  236. package/lib/solution/BookingTicket/types.d.ts +0 -68
  237. package/lib/solution/BookingTicket/types.js +0 -72
  238. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  239. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -117
  240. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -16
  241. package/lib/solution/BookingTicket/utils/scan/handleScan.js +0 -125
  242. package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -81
  243. package/lib/solution/BookingTicket/utils/scan/index.js +0 -210
  244. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  245. package/lib/solution/BookingTicket/utils/scan/scanCache.js +0 -231
  246. package/lib/solution/Checkout/appointmentDemo.json +0 -1
  247. package/lib/solution/Checkout/index.d.ts +0 -181
  248. package/lib/solution/Checkout/index.js +0 -864
  249. package/lib/solution/Checkout/types.d.ts +0 -550
  250. package/lib/solution/Checkout/types.js +0 -75
  251. package/lib/solution/Checkout/utils/index.d.ts +0 -73
  252. package/lib/solution/Checkout/utils/index.js +0 -266
  253. package/lib/utils/task.d.ts +0 -40
  254. package/lib/utils/task.js +0 -109
  255. package/lib/utils/watch.d.ts +0 -102
  256. package/lib/utils/watch.js +0 -217
@@ -1,45 +0,0 @@
1
- import hooks from '../hooks';
2
- import { Provider as StoreProvider } from "react-redux";
3
- declare const models: import("./global").GlobalModal[];
4
- type ModalsType = (typeof models[number]);
5
- export interface Store {
6
- getDataByModel: typeof getDataByModel;
7
- useStore: typeof hooks.useStore;
8
- useDispatch: typeof hooks.useDispatch;
9
- setDataByModel: typeof setDataByModel;
10
- dispatch: any;
11
- getState: any;
12
- }
13
- export type ModelsNames = ModalsType['namespace'];
14
- export type ModelsState = {
15
- [K in (ModalsType['namespace'])]: Extract<ModalsType, {
16
- namespace: K;
17
- }>['state'];
18
- };
19
- /**
20
- * @title: 从store内获取数据
21
- * @description:
22
- * @param {string} model
23
- * @param {string} key
24
- * @return {*}
25
- * @Author: zhiwei.Wang
26
- * @Date: 2024-09-03 11:07
27
- */
28
- declare const getDataByModel: <T extends keyof ModelsState, D extends keyof ModelsState[T]>(model: string, key?: D) => D extends undefined ? ModelsState[T] : ModelsState[T][D];
29
- /**
30
- * @title: 设置数据到store
31
- * @description:
32
- * @param {string} model
33
- * @param {string} key
34
- * @param {string} value
35
- * @return {*}
36
- * @Author: zhiwei.Wang
37
- * @Date: 2024-09-08 15:17
38
- */
39
- declare const setDataByModel: <T extends keyof ModelsState, D extends keyof ModelsState[T]>(model: string, key: any, value: any) => void;
40
- declare const _default: {
41
- getStore: () => Store;
42
- StoreProvider: typeof StoreProvider;
43
- setConfig: (models: any[]) => void;
44
- };
45
- export default _default;
@@ -1,2 +0,0 @@
1
- export interface ModelsConfig {
2
- }
@@ -1,15 +0,0 @@
1
- {
2
- "name": "@pisell/core-types",
3
- "version": "1.0.1",
4
- "description": "TypeScript type definitions for @pisell/core",
5
- "main": "index.d.ts",
6
- "types": "index.d.ts",
7
- "typings": "index.d.ts",
8
- "peerDependencies": {
9
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
10
- },
11
- "files": ["**/*.d.ts"],
12
- "publishConfig": {
13
- "access": "public"
14
- }
15
- }
File without changes
@@ -1,5 +0,0 @@
1
- /**
2
- * 发布订阅模块使用示例
3
- * 此文件仅用于演示,不会被实际引入项目
4
- */
5
- export {};
@@ -1,63 +0,0 @@
1
- /**
2
- * 发布订阅模块
3
- * 用于组件/服务间的事件通信
4
- */
5
- type EventCallback = (...args: any[]) => void;
6
- interface EventSubscription {
7
- unsubscribe: () => void;
8
- }
9
- declare class PubSub {
10
- private events;
11
- /**
12
- * 订阅事件
13
- * @param event 事件名称
14
- * @param callback 回调函数
15
- * @returns 订阅对象,可用于取消订阅
16
- */
17
- subscribe(event: string, callback: EventCallback): EventSubscription;
18
- /**
19
- * 取消订阅事件
20
- * @param event 事件名称
21
- * @param callback 回调函数
22
- * @returns 是否成功取消订阅
23
- */
24
- unsubscribe(event: string, callback: EventCallback): boolean;
25
- /**
26
- * 发布事件
27
- * @param event 事件名称
28
- * @param args 事件参数
29
- */
30
- publish(event: string, ...args: any[]): void;
31
- /**
32
- * 移除某个事件的所有订阅
33
- * @param event 事件名称
34
- * @returns 是否成功移除
35
- */
36
- clearEvent(event: string): boolean;
37
- /**
38
- * 移除所有事件订阅
39
- */
40
- clearAllEvents(): void;
41
- /**
42
- * 获取事件的订阅数量
43
- * @param event 事件名称
44
- * @returns 订阅数量
45
- */
46
- getSubscriberCount(event: string): number;
47
- /**
48
- * 检查事件是否有订阅者
49
- * @param event 事件名称
50
- * @returns 是否有订阅者
51
- */
52
- hasSubscribers(event: string): boolean;
53
- /**
54
- * 一次性订阅事件,事件触发后自动取消订阅
55
- * @param event 事件名称
56
- * @param callback 回调函数
57
- * @returns 订阅对象,可用于取消订阅
58
- */
59
- once(event: string, callback: EventCallback): EventSubscription;
60
- }
61
- declare const pubsub: PubSub;
62
- export default pubsub;
63
- export { PubSub, type EventCallback, type EventSubscription };
@@ -1,46 +0,0 @@
1
- import { CacheProps } from './type';
2
- export type CacheType = 'memory' | 'storage' | 'indexDB';
3
- /**
4
- * @title: 设置缓存
5
- * @description:
6
- * @return {*}
7
- * @Author: zhiwei.Wang
8
- */
9
- export declare const setCache: (key: string, data: any, cache: CacheProps) => Promise<void>;
10
- /**
11
- * @title: 删除缓存数据
12
- * @description:
13
- * @return {*}
14
- * @Author: zhiwei.Wang
15
- */
16
- export declare const removeCache: (key: string, cache: CacheProps) => void;
17
- /**
18
- * @title: 获取数据
19
- * @description:
20
- * @param {any} url
21
- * @param {any} data
22
- * @return {*}
23
- * @Author: zhiwei.Wang
24
- */
25
- export declare const getCacheData: (url: string, data: any, cache: CacheProps) => Promise<any>;
26
- /**
27
- * @title: 设置缓存
28
- * @description:
29
- * @param {any} url 路径
30
- * @param {any} data 参数
31
- * @param {any} res 数据
32
- * @return {*}
33
- * @Author: zhiwei.Wang
34
- */
35
- export declare const setCacheData: (url: string, data: any, res: any, cache: CacheProps) => any | null;
36
- /**
37
- * @title: 缓存函数包装器
38
- * @description:
39
- * @param {any} url
40
- * @param {any} data
41
- * @param {any} config
42
- * @param {any} fn
43
- * @return {*}
44
- * @Author: zhiwei.Wang
45
- */
46
- export declare const cacheFn: (props: any, fn: any) => Promise<any>;
@@ -1,38 +0,0 @@
1
- /**
2
- * @Title: 请求列表
3
- * @Describe:
4
- * @Author: Wzw
5
- */
6
- export declare let requestList: {
7
- [key: string]: AbortController;
8
- };
9
- /**
10
- * @Title: 创建一个控制器
11
- * @Describe:
12
- * @Author: Wzw
13
- * @param {string} key
14
- */
15
- export declare const createController: (key: string) => AbortController;
16
- /**
17
- * @Title: 储存请求
18
- * @Describe:
19
- * @Author: Wzw
20
- * @param {AbortController} controller
21
- * @param {string} key
22
- */
23
- export declare const setRequestList: (controller: AbortController, key: string) => void;
24
- /**
25
- * @Title: 取消请求
26
- * @Describe:
27
- * @Author: Wzw
28
- * @param {string} key
29
- */
30
- export declare const abortRequest: (key: string) => void;
31
- /**
32
- * @Title: 创建signal
33
- * @Describe:
34
- * @Author: Wzw
35
- * @param {string} isAbort
36
- * @param {string} url
37
- */
38
- export declare const createSignal: (isAbort: boolean, url: string) => AbortSignal | null;
@@ -1,3 +0,0 @@
1
- import { RequestConfig } from './type';
2
- export declare const setConfig: (newConfig: Partial<RequestConfig>) => void;
3
- export declare const getConfig: () => RequestConfig;
@@ -1,2 +0,0 @@
1
- import { CreateAxiosDefaults } from "axios";
2
- export declare const axiosConfig: CreateAxiosDefaults;
@@ -1,24 +0,0 @@
1
- import { RequestWrapperProps, RequestConfig } from "./type";
2
- export declare const createRequest: (props: RequestWrapperProps) => Promise<unknown>;
3
- /**
4
- * 请求
5
- * @param props
6
- * @returns
7
- */
8
- export declare const request: (props: RequestWrapperProps) => Promise<any>;
9
- export declare const get: (url: RequestWrapperProps["url"], data: RequestWrapperProps["data"], config: RequestWrapperProps["config"]) => Promise<any>;
10
- export declare const post: (url: RequestWrapperProps["url"], data: RequestWrapperProps["data"], config: RequestWrapperProps["config"]) => Promise<any>;
11
- export declare const put: (url: RequestWrapperProps["url"], data: RequestWrapperProps["data"], config: RequestWrapperProps["config"]) => Promise<any>;
12
- export declare const remove: (url: RequestWrapperProps["url"], data: RequestWrapperProps["data"], config: RequestWrapperProps["config"]) => Promise<any>;
13
- export declare const custom: (url: RequestWrapperProps["url"], config: RequestWrapperProps["config"]) => Promise<any>;
14
- export * from "./type";
15
- declare const _default: {
16
- get: (url: RequestWrapperProps["url"], data: RequestWrapperProps["data"], config: RequestWrapperProps["config"]) => Promise<any>;
17
- post: (url: RequestWrapperProps["url"], data: RequestWrapperProps["data"], config: RequestWrapperProps["config"]) => Promise<any>;
18
- put: (url: RequestWrapperProps["url"], data: RequestWrapperProps["data"], config: RequestWrapperProps["config"]) => Promise<any>;
19
- remove: (url: RequestWrapperProps["url"], data: RequestWrapperProps["data"], config: RequestWrapperProps["config"]) => Promise<any>;
20
- custom: (url: RequestWrapperProps["url"], config: RequestWrapperProps["config"]) => Promise<any>;
21
- setConfig: (newConfig: Partial<RequestConfig>) => void;
22
- getConfig: () => RequestConfig;
23
- };
24
- export default _default;
@@ -1,6 +0,0 @@
1
- type RequestMethod = any;
2
- declare const pisell2Get: RequestMethod;
3
- declare const pisell2Post: RequestMethod;
4
- declare const pisell2Put: RequestMethod;
5
- declare const pisell2Remove: RequestMethod;
6
- export { pisell2Get as get, pisell2Post as post, pisell2Put as put, pisell2Remove as remove, };
@@ -1,41 +0,0 @@
1
- import { CreateAxiosDefaults } from "axios";
2
- import { CacheType } from './cache';
3
- export interface RequestConfig {
4
- interceptorsRequest?: ((value: any) => any | Promise<any>) | null;
5
- interceptorsRequestError?: ((error: any) => any) | null;
6
- interceptorsResponse?: any;
7
- interceptorsResponseError?: ((error: any) => any) | null;
8
- axiosConfig?: CreateAxiosDefaults;
9
- storage?: any;
10
- getToken?: () => string | null;
11
- setToken?: (token: string) => void;
12
- getLocale?: () => string | null;
13
- getUrl?: (config: any) => string;
14
- requestCallbacks?: {
15
- 200?: (data: any) => void;
16
- 401?: (data: any) => void;
17
- 403?: (data: any) => void;
18
- other?: (data: any) => void;
19
- [key: string]: any;
20
- };
21
- }
22
- export interface CacheProps {
23
- key?: string;
24
- type?: CacheType;
25
- updateCache?: boolean;
26
- cacheUpdateChange?: (data: any) => void;
27
- }
28
- export interface RequestSetting {
29
- abort?: boolean;
30
- headers?: any;
31
- cache?: CacheProps;
32
- signal?: any;
33
- token?: string;
34
- [key: string]: any;
35
- }
36
- export interface RequestWrapperProps {
37
- url: string;
38
- method: 'get' | 'post' | 'remove' | 'put';
39
- data?: any;
40
- config?: RequestSetting;
41
- }
@@ -1,46 +0,0 @@
1
- import { InternalAxiosRequestConfig } from "axios";
2
- import { RequestSetting, RequestConfig, RequestWrapperProps } from "./type";
3
- export declare const getRequestHeaders: (config: InternalAxiosRequestConfig<RequestSetting> & Record<string, any>) => Record<string, string | null>;
4
- /**
5
- * @title: 请求前拦截
6
- * @description:
7
- * @param {any} config
8
- * @return {*}
9
- * @Author: zhiwei.Wang
10
- * @Date: 2024-07-04 10:51
11
- */
12
- export declare const interceptorsRequest: (config: InternalAxiosRequestConfig<RequestSetting> & Record<string, any>) => Promise<InternalAxiosRequestConfig<RequestSetting> & Record<string, any>>;
13
- /**
14
- * @title: 请求前error
15
- * @description:
16
- * @param {any} err
17
- * @return {*}
18
- * @Author: zhiwei.Wang
19
- * @Date: 2024-07-04 10:51
20
- */
21
- export declare const interceptorsRequestError: (err: RequestConfig["interceptorsRequestError"]) => any;
22
- /**
23
- * @title: 请求后拦截
24
- * @description:
25
- * @param {any} response
26
- * @return {*}
27
- * @Author: zhiwei.Wang
28
- * @Date: 2024-07-04 10:51
29
- */
30
- export declare const interceptorsResponse: (response: RequestConfig["interceptorsResponse"]) => any;
31
- /**
32
- * @title: 请求后错误拦截
33
- * @description:
34
- * @param {any} response
35
- * @return {*}
36
- * @Author: zhiwei.Wang
37
- * @Date: 2024-07-04 10:51
38
- */
39
- export declare const interceptorsResponseError: (response: RequestConfig["interceptorsResponseError"]) => any;
40
- export declare const requestCallback: (resData: {
41
- res?: any;
42
- props: RequestWrapperProps;
43
- resolve: (value: unknown) => void;
44
- reject: () => void;
45
- err?: any;
46
- }) => void;
@@ -1,7 +0,0 @@
1
- export interface RouteItem {
2
- path: string;
3
- component: any;
4
- exact?: boolean;
5
- routes?: RouteItem[];
6
- }
7
- export declare const routes: RouteItem[];
@@ -1,28 +0,0 @@
1
- import App from '../app';
2
- import React from 'react';
3
- import type { ApplicationInterface } from '../applicationManager/application';
4
- export interface RouterOptions {
5
- routes?: Record<string, RouteType>;
6
- basename?: string;
7
- }
8
- export interface RouteType extends ApplicationInterface {
9
- }
10
- export declare class RouterManager {
11
- routes: Record<string, RouteType>;
12
- options: RouterOptions;
13
- app: App;
14
- constructor(options: RouterOptions | undefined, app: App);
15
- init(): void;
16
- getRoutes(): Record<string, RouteType>;
17
- getBasename(): string | undefined;
18
- setBasename(basename: string): void;
19
- add(name: string, route: any): void;
20
- get(name: string): RouteType;
21
- has(name: string): boolean;
22
- remove(name: string): void;
23
- renderComponent(item: RouteType, children?: React.ReactNode): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
24
- getPageByRoute(route: string): ApplicationInterface | undefined;
25
- getRouterComponent({ fallback }: {
26
- fallback?: React.ReactNode;
27
- }): React.JSX.Element[];
28
- }
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- /**
3
- * Socket监控页面组件
4
- */
5
- declare const SocketMonitorPage: React.FC;
6
- export default SocketMonitorPage;
@@ -1,2 +0,0 @@
1
- import SocketMonitorPage from './SocketMonitorPage';
2
- export { SocketMonitorPage };
@@ -1,33 +0,0 @@
1
- /**
2
- * Socket模块常量
3
- */
4
- /** 默认配置选项 */
5
- export declare const DEFAULT_SOCKET_OPTIONS: {
6
- autoConnect: boolean;
7
- reconnection: boolean;
8
- reconnectionAttempts: number;
9
- reconnectionDelay: number;
10
- reconnectionDelayMax: number;
11
- heartbeat: boolean;
12
- heartbeatInterval: number;
13
- heartbeatTimeout: number;
14
- timeout: number;
15
- };
16
- /** 默认心跳消息 */
17
- export declare const DEFAULT_HEARTBEAT_MESSAGE: {
18
- type: string;
19
- };
20
- /** 默认心跳响应事件 */
21
- export declare const DEFAULT_HEARTBEAT_RESPONSE = "pong";
22
- /** 最小心跳间隔(毫秒) */
23
- export declare const MIN_HEARTBEAT_INTERVAL = 1000;
24
- /** 最小重连延迟(毫秒) */
25
- export declare const MIN_RECONNECTION_DELAY = 500;
26
- /** 连接状态码映射 */
27
- export declare const WS_STATUS_MAP: {
28
- 0: string;
29
- 1: string;
30
- 2: string;
31
- 3: string;
32
- 4: string;
33
- };
@@ -1,31 +0,0 @@
1
- /**
2
- * Socket标准事件类型
3
- */
4
- export declare enum SocketEvents {
5
- /** 连接成功事件 */
6
- CONNECT = "connect",
7
- /** 连接断开事件 */
8
- DISCONNECT = "disconnect",
9
- /** 连接错误事件 */
10
- ERROR = "error",
11
- /** 接收消息事件 */
12
- MESSAGE = "message",
13
- /** 发送消息事件 */
14
- SEND = "send",
15
- /** 重连中事件 */
16
- RECONNECTING = "reconnecting",
17
- /** 重连尝试事件 */
18
- RECONNECT_ATTEMPT = "reconnect_attempt",
19
- /** 重连成功事件 */
20
- RECONNECT = "reconnect",
21
- /** 重连失败事件 */
22
- RECONNECT_ERROR = "reconnect_error",
23
- /** 重连次数超限 */
24
- RECONNECT_FAILED = "reconnect_failed",
25
- /** 心跳发送事件 */
26
- HEARTBEAT = "heartbeat",
27
- /** 心跳响应事件 */
28
- HEARTBEAT_RESPONSE = "heartbeat_response",
29
- /** 心跳超时事件 */
30
- HEARTBEAT_TIMEOUT = "heartbeat_timeout"
31
- }
@@ -1,66 +0,0 @@
1
- import { HeartbeatOptions, SocketMessage } from "./types";
2
- /**
3
- * Socket心跳管理器
4
- * 处理WebSocket连接的心跳检测
5
- */
6
- export declare class HeartbeatManager {
7
- private options;
8
- private intervalTimer;
9
- private timeoutTimer;
10
- private lastHeartbeatTime;
11
- private lastHeartbeatResponse;
12
- private active;
13
- private sendHeartbeat;
14
- private onTimeout;
15
- private onResponse;
16
- /**
17
- * 创建心跳管理器
18
- * @param options 心跳配置选项
19
- * @param sendHeartbeat 发送心跳的回调函数
20
- * @param callbacks 回调函数集合
21
- */
22
- constructor(options: HeartbeatOptions, sendHeartbeat: (msg: SocketMessage) => void, callbacks?: {
23
- onTimeout?: () => void;
24
- onResponse?: () => void;
25
- });
26
- /**
27
- * 启动心跳检测
28
- */
29
- start(): void;
30
- /**
31
- * 停止心跳检测
32
- */
33
- stop(): void;
34
- /**
35
- * 重启心跳检测
36
- */
37
- restart(): void;
38
- /**
39
- * 接收到心跳响应
40
- */
41
- receiveHeartbeatResponse(): void;
42
- /**
43
- * 获取上次心跳时间
44
- */
45
- getLastHeartbeatTime(): number;
46
- /**
47
- * 获取上次心跳响应时间
48
- */
49
- getLastHeartbeatResponseTime(): number;
50
- /**
51
- * 获取心跳是否活跃
52
- */
53
- isActive(): boolean;
54
- /**
55
- * 安排下一次心跳
56
- */
57
- private scheduleHeartbeat;
58
- /**
59
- * 发送心跳消息
60
- */
61
- private sendHeartbeatMessage;
62
- /**
63
- * 清除所有计时器
64
- */
65
- private clearTimers;
66
- }
@@ -1,61 +0,0 @@
1
- import { Socket } from './socket';
2
- import { SocketOptions, SocketStatus, SocketMessage } from './types';
3
- import { SocketEvents } from './events';
4
- import { SocketMonitor, SocketMonitorOptions, SocketHistoryItem, SocketStatusItem, SocketStats } from './monitor';
5
- import * as components from './components';
6
- /**
7
- * 创建Socket实例
8
- * @param url WebSocket连接URL
9
- * @param options Socket配置选项
10
- */
11
- export declare function createSocket(url: string, options?: Partial<Omit<SocketOptions, 'url'>>): Socket;
12
- declare const _default: {
13
- /**
14
- * 创建新的Socket实例
15
- */
16
- create: (url: string, options?: Partial<Omit<SocketOptions, "url">>, key?: string) => Socket;
17
- /**
18
- * 获取指定键的Socket实例
19
- */
20
- get: (key: string) => Socket | undefined;
21
- /**
22
- * 移除Socket实例
23
- */
24
- remove: (key: string) => boolean;
25
- /**
26
- * 关闭并移除所有Socket实例
27
- */
28
- closeAll: () => void;
29
- /**
30
- * 检查指定键的Socket是否存在
31
- */
32
- has: (key: string) => boolean;
33
- /**
34
- * 获取所有Socket标识键
35
- */
36
- getKeys: () => string[];
37
- /**
38
- * 获取所有Socket实例
39
- */
40
- getAllSockets: () => Socket[];
41
- /**
42
- * 为指定的Socket启用监控
43
- */
44
- enableMonitoring: (key: string, options?: SocketMonitorOptions) => SocketMonitor | null;
45
- /**
46
- * 获取指定Socket的监控器
47
- */
48
- getMonitor: (key: string) => SocketMonitor | null;
49
- /**
50
- * 获取所有Socket的监控信息
51
- */
52
- getAllMonitors: () => Map<string, SocketMonitor | null>;
53
- /**
54
- * 监控组件
55
- */
56
- components: typeof components;
57
- };
58
- export default _default;
59
- export { Socket, SocketMonitor };
60
- export type { SocketOptions, SocketMessage, SocketMonitorOptions, SocketHistoryItem, SocketStatusItem, SocketStats };
61
- export { SocketStatus, SocketEvents };