@pisell/pisellos 3.0.76 → 3.0.77

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 (308) hide show
  1. package/dist/core/index.js +1 -2
  2. package/dist/effects/index.d.ts +3 -5
  3. package/dist/effects/index.js +8 -40
  4. package/dist/modules/Account/index.js +3 -2
  5. package/dist/modules/AccountList/index.d.ts +1 -7
  6. package/dist/modules/AccountList/index.js +14 -81
  7. package/dist/modules/AccountList/types.d.ts +0 -28
  8. package/dist/modules/AccountList/types.js +0 -8
  9. package/dist/modules/BaseModule.d.ts +0 -3
  10. package/dist/modules/BaseModule.js +0 -15
  11. package/dist/modules/Cart/index.d.ts +0 -1
  12. package/dist/modules/Cart/index.js +1 -2
  13. package/dist/modules/Discount/index.d.ts +0 -1
  14. package/dist/modules/Discount/index.js +1 -1
  15. package/dist/modules/Guests/index.js +9 -9
  16. package/dist/modules/Order/index.d.ts +1 -25
  17. package/dist/modules/Order/index.js +3 -224
  18. package/dist/modules/Order/types.d.ts +0 -45
  19. package/dist/modules/Order/types.js +0 -8
  20. package/dist/modules/Order/utils.js +1 -1
  21. package/dist/modules/Payment/index.d.ts +9 -184
  22. package/dist/modules/Payment/index.js +109 -2084
  23. package/dist/modules/Payment/types.d.ts +30 -772
  24. package/dist/modules/Payment/types.js +12 -236
  25. package/dist/modules/ProductList/index.d.ts +1 -12
  26. package/dist/modules/ProductList/index.js +15 -37
  27. package/dist/modules/Resource/index.js +1 -1
  28. package/dist/modules/Rules/index.d.ts +1 -2
  29. package/dist/modules/Rules/index.js +26 -66
  30. package/dist/modules/Rules/types.d.ts +0 -1
  31. package/dist/modules/Schedule/index.d.ts +0 -9
  32. package/dist/modules/Schedule/index.js +0 -77
  33. package/dist/modules/index.d.ts +0 -1
  34. package/dist/modules/index.js +0 -1
  35. package/dist/plugins/window.d.ts +0 -1
  36. package/dist/solution/BookingByStep/index.js +13 -43
  37. package/dist/solution/BookingByStep/utils/capacity.js +1 -1
  38. package/dist/solution/BookingByStep/utils/products.d.ts +0 -6
  39. package/dist/solution/BookingByStep/utils/products.js +0 -10
  40. package/dist/solution/BuyTickets/index.js +8 -7
  41. package/dist/solution/ShopDiscount/index.d.ts +10 -10
  42. package/dist/solution/ShopDiscount/index.js +57 -107
  43. package/dist/solution/ShopDiscount/types.d.ts +0 -8
  44. package/dist/solution/ShopDiscount/utils.js +1 -0
  45. package/dist/solution/index.d.ts +0 -2
  46. package/dist/solution/index.js +1 -3
  47. package/dist/types/index.d.ts +1 -4
  48. package/lib/core/index.js +1 -1
  49. package/lib/effects/index.d.ts +3 -5
  50. package/lib/effects/index.js +1 -17
  51. package/lib/modules/Account/index.js +3 -2
  52. package/lib/modules/AccountList/index.d.ts +1 -7
  53. package/lib/modules/AccountList/index.js +0 -27
  54. package/lib/modules/AccountList/types.d.ts +0 -28
  55. package/lib/modules/BaseModule.d.ts +0 -3
  56. package/lib/modules/BaseModule.js +0 -9
  57. package/lib/modules/Cart/index.d.ts +0 -1
  58. package/lib/modules/Cart/index.js +2 -5
  59. package/lib/modules/Discount/index.d.ts +0 -1
  60. package/lib/modules/Discount/index.js +1 -1
  61. package/lib/modules/Guests/index.js +9 -9
  62. package/lib/modules/Order/index.d.ts +1 -25
  63. package/lib/modules/Order/index.js +1 -186
  64. package/lib/modules/Order/types.d.ts +0 -45
  65. package/lib/modules/Order/utils.js +1 -1
  66. package/lib/modules/Payment/index.d.ts +9 -184
  67. package/lib/modules/Payment/index.js +51 -1084
  68. package/lib/modules/Payment/types.d.ts +30 -772
  69. package/lib/modules/Payment/types.js +6 -79
  70. package/lib/modules/ProductList/index.d.ts +1 -12
  71. package/lib/modules/ProductList/index.js +12 -31
  72. package/lib/modules/Resource/index.js +1 -1
  73. package/lib/modules/Rules/index.d.ts +1 -2
  74. package/lib/modules/Rules/index.js +24 -41
  75. package/lib/modules/Rules/types.d.ts +0 -1
  76. package/lib/modules/Schedule/index.d.ts +0 -9
  77. package/lib/modules/Schedule/index.js +0 -60
  78. package/lib/modules/index.d.ts +0 -1
  79. package/lib/modules/index.js +0 -2
  80. package/lib/plugins/window.d.ts +0 -1
  81. package/lib/solution/BookingByStep/index.js +6 -18
  82. package/lib/solution/BookingByStep/utils/capacity.js +1 -1
  83. package/lib/solution/BookingByStep/utils/products.d.ts +0 -6
  84. package/lib/solution/BookingByStep/utils/products.js +2 -8
  85. package/lib/solution/BuyTickets/index.js +8 -7
  86. package/lib/solution/ShopDiscount/index.d.ts +10 -10
  87. package/lib/solution/ShopDiscount/index.js +21 -47
  88. package/lib/solution/ShopDiscount/types.d.ts +0 -8
  89. package/lib/solution/index.d.ts +0 -2
  90. package/lib/solution/index.js +1 -5
  91. package/lib/types/index.d.ts +1 -4
  92. package/package.json +1 -3
  93. package/dist/modules/Customer/constants.d.ts +0 -7
  94. package/dist/modules/Customer/constants.js +0 -12
  95. package/dist/modules/Customer/index.d.ts +0 -122
  96. package/dist/modules/Customer/index.js +0 -696
  97. package/dist/modules/Customer/types.d.ts +0 -146
  98. package/dist/modules/Customer/types.js +0 -41
  99. package/dist/modules/Payment/cash.d.ts +0 -19
  100. package/dist/modules/Payment/cash.js +0 -97
  101. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
  102. package/dist/modules/Payment/cashRecommendationAlgorithm.js +0 -423
  103. package/dist/modules/Payment/eftpos.d.ts +0 -11
  104. package/dist/modules/Payment/eftpos.js +0 -80
  105. package/dist/modules/Payment/mx51.d.ts +0 -0
  106. package/dist/modules/Payment/mx51.js +0 -0
  107. package/dist/modules/Payment/utils.d.ts +0 -17
  108. package/dist/modules/Payment/utils.js +0 -62
  109. package/dist/modules/Payment/walletpass.d.ts +0 -99
  110. package/dist/modules/Payment/walletpass.js +0 -711
  111. package/dist/plugins/app-types/app/app.d.ts +0 -83
  112. package/dist/plugins/app-types/app/const.d.ts +0 -4
  113. package/dist/plugins/app-types/app/index.d.ts +0 -14
  114. package/dist/plugins/app-types/applicationManager/application.d.ts +0 -50
  115. package/dist/plugins/app-types/applicationManager/index.d.ts +0 -13
  116. package/dist/plugins/app-types/config.d.ts +0 -3
  117. package/dist/plugins/app-types/cookie/index.d.ts +0 -13
  118. package/dist/plugins/app-types/data/index.d.ts +0 -8
  119. package/dist/plugins/app-types/history/config.d.ts +0 -24
  120. package/dist/plugins/app-types/history/index.d.ts +0 -20
  121. package/dist/plugins/app-types/history/type.d.ts +0 -2
  122. package/dist/plugins/app-types/hooks/index.d.ts +0 -12
  123. package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  124. package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  125. package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  126. package/dist/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  127. package/dist/plugins/app-types/index.d.ts +0 -6
  128. package/dist/plugins/app-types/indexDB/index.d.ts +0 -178
  129. package/dist/plugins/app-types/locales/en.d.ts +0 -3
  130. package/dist/plugins/app-types/locales/index.d.ts +0 -37
  131. package/dist/plugins/app-types/locales/original.d.ts +0 -3
  132. package/dist/plugins/app-types/locales/type.d.ts +0 -19
  133. package/dist/plugins/app-types/locales/zh-CN.d.ts +0 -3
  134. package/dist/plugins/app-types/locales/zh-HK.d.ts +0 -3
  135. package/dist/plugins/app-types/logger/feishu.d.ts +0 -11
  136. package/dist/plugins/app-types/logger/index.d.ts +0 -122
  137. package/dist/plugins/app-types/menuManager/hooks.d.ts +0 -17
  138. package/dist/plugins/app-types/menuManager/index.d.ts +0 -28
  139. package/dist/plugins/app-types/models/global.d.ts +0 -32
  140. package/dist/plugins/app-types/models/index.d.ts +0 -45
  141. package/dist/plugins/app-types/models/type.d.ts +0 -2
  142. package/dist/plugins/app-types/package.json +0 -15
  143. package/dist/plugins/app-types/plugin/index.d.ts +0 -0
  144. package/dist/plugins/app-types/pubsub/example.d.ts +0 -5
  145. package/dist/plugins/app-types/pubsub/index.d.ts +0 -63
  146. package/dist/plugins/app-types/request/cache.d.ts +0 -46
  147. package/dist/plugins/app-types/request/cancelToken.d.ts +0 -38
  148. package/dist/plugins/app-types/request/config.d.ts +0 -3
  149. package/dist/plugins/app-types/request/constants.d.ts +0 -2
  150. package/dist/plugins/app-types/request/index.d.ts +0 -24
  151. package/dist/plugins/app-types/request/pisell2Request.d.ts +0 -6
  152. package/dist/plugins/app-types/request/type.d.ts +0 -41
  153. package/dist/plugins/app-types/request/utils.d.ts +0 -46
  154. package/dist/plugins/app-types/routes/config.d.ts +0 -7
  155. package/dist/plugins/app-types/routes/index.d.ts +0 -28
  156. package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  157. package/dist/plugins/app-types/socket/components/index.d.ts +0 -2
  158. package/dist/plugins/app-types/socket/constants.d.ts +0 -33
  159. package/dist/plugins/app-types/socket/events.d.ts +0 -31
  160. package/dist/plugins/app-types/socket/heartbeat.d.ts +0 -66
  161. package/dist/plugins/app-types/socket/index.d.ts +0 -61
  162. package/dist/plugins/app-types/socket/monitor.d.ts +0 -169
  163. package/dist/plugins/app-types/socket/reconnect.d.ts +0 -61
  164. package/dist/plugins/app-types/socket/socket.d.ts +0 -129
  165. package/dist/plugins/app-types/socket/types.d.ts +0 -85
  166. package/dist/plugins/app-types/storage/index.d.ts +0 -17
  167. package/dist/plugins/app-types/tasks/index.d.ts +0 -77
  168. package/dist/plugins/app-types/tasks/type.d.ts +0 -62
  169. package/dist/plugins/app-types/tasks/useTasks.d.ts +0 -5
  170. package/dist/plugins/app-types/type.d.ts +0 -2
  171. package/dist/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  172. package/dist/plugins/app-types/variables/config.d.ts +0 -3
  173. package/dist/plugins/app-types/variables/index.d.ts +0 -6
  174. package/dist/plugins/app-types/variables/type.d.ts +0 -2
  175. package/dist/plugins/app-types/website/index.d.ts +0 -6
  176. package/dist/plugins/app.d.ts +0 -8
  177. package/dist/plugins/app.js +0 -1
  178. package/dist/solution/BookingTicket/index.d.ts +0 -184
  179. package/dist/solution/BookingTicket/index.js +0 -698
  180. package/dist/solution/BookingTicket/types.d.ts +0 -68
  181. package/dist/solution/BookingTicket/types.js +0 -43
  182. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  183. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -159
  184. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
  185. package/dist/solution/BookingTicket/utils/scan/handleScan.js +0 -189
  186. package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -85
  187. package/dist/solution/BookingTicket/utils/scan/index.js +0 -294
  188. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  189. package/dist/solution/BookingTicket/utils/scan/scanCache.js +0 -305
  190. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  191. package/dist/solution/Checkout/index.d.ts +0 -432
  192. package/dist/solution/Checkout/index.js +0 -4452
  193. package/dist/solution/Checkout/types.d.ts +0 -727
  194. package/dist/solution/Checkout/types.js +0 -104
  195. package/dist/solution/Checkout/utils/index.d.ts +0 -121
  196. package/dist/solution/Checkout/utils/index.js +0 -511
  197. package/dist/utils/task.d.ts +0 -40
  198. package/dist/utils/task.js +0 -171
  199. package/dist/utils/watch.d.ts +0 -102
  200. package/dist/utils/watch.js +0 -294
  201. package/lib/modules/Customer/constants.d.ts +0 -7
  202. package/lib/modules/Customer/constants.js +0 -39
  203. package/lib/modules/Customer/index.d.ts +0 -122
  204. package/lib/modules/Customer/index.js +0 -439
  205. package/lib/modules/Customer/types.d.ts +0 -146
  206. package/lib/modules/Customer/types.js +0 -37
  207. package/lib/modules/Payment/cash.d.ts +0 -19
  208. package/lib/modules/Payment/cash.js +0 -64
  209. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
  210. package/lib/modules/Payment/cashRecommendationAlgorithm.js +0 -342
  211. package/lib/modules/Payment/eftpos.d.ts +0 -11
  212. package/lib/modules/Payment/eftpos.js +0 -51
  213. package/lib/modules/Payment/mx51.d.ts +0 -0
  214. package/lib/modules/Payment/mx51.js +0 -0
  215. package/lib/modules/Payment/utils.d.ts +0 -17
  216. package/lib/modules/Payment/utils.js +0 -67
  217. package/lib/modules/Payment/walletpass.d.ts +0 -99
  218. package/lib/modules/Payment/walletpass.js +0 -484
  219. package/lib/plugins/app-types/app/app.d.ts +0 -83
  220. package/lib/plugins/app-types/app/const.d.ts +0 -4
  221. package/lib/plugins/app-types/app/index.d.ts +0 -14
  222. package/lib/plugins/app-types/applicationManager/application.d.ts +0 -50
  223. package/lib/plugins/app-types/applicationManager/index.d.ts +0 -13
  224. package/lib/plugins/app-types/config.d.ts +0 -3
  225. package/lib/plugins/app-types/cookie/index.d.ts +0 -13
  226. package/lib/plugins/app-types/data/index.d.ts +0 -8
  227. package/lib/plugins/app-types/history/config.d.ts +0 -24
  228. package/lib/plugins/app-types/history/index.d.ts +0 -20
  229. package/lib/plugins/app-types/history/type.d.ts +0 -2
  230. package/lib/plugins/app-types/hooks/index.d.ts +0 -12
  231. package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  232. package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  233. package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  234. package/lib/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  235. package/lib/plugins/app-types/index.d.ts +0 -6
  236. package/lib/plugins/app-types/indexDB/index.d.ts +0 -178
  237. package/lib/plugins/app-types/locales/en.d.ts +0 -3
  238. package/lib/plugins/app-types/locales/index.d.ts +0 -37
  239. package/lib/plugins/app-types/locales/original.d.ts +0 -3
  240. package/lib/plugins/app-types/locales/type.d.ts +0 -19
  241. package/lib/plugins/app-types/locales/zh-CN.d.ts +0 -3
  242. package/lib/plugins/app-types/locales/zh-HK.d.ts +0 -3
  243. package/lib/plugins/app-types/logger/feishu.d.ts +0 -11
  244. package/lib/plugins/app-types/logger/index.d.ts +0 -122
  245. package/lib/plugins/app-types/menuManager/hooks.d.ts +0 -17
  246. package/lib/plugins/app-types/menuManager/index.d.ts +0 -28
  247. package/lib/plugins/app-types/models/global.d.ts +0 -32
  248. package/lib/plugins/app-types/models/index.d.ts +0 -45
  249. package/lib/plugins/app-types/models/type.d.ts +0 -2
  250. package/lib/plugins/app-types/package.json +0 -15
  251. package/lib/plugins/app-types/plugin/index.d.ts +0 -0
  252. package/lib/plugins/app-types/pubsub/example.d.ts +0 -5
  253. package/lib/plugins/app-types/pubsub/index.d.ts +0 -63
  254. package/lib/plugins/app-types/request/cache.d.ts +0 -46
  255. package/lib/plugins/app-types/request/cancelToken.d.ts +0 -38
  256. package/lib/plugins/app-types/request/config.d.ts +0 -3
  257. package/lib/plugins/app-types/request/constants.d.ts +0 -2
  258. package/lib/plugins/app-types/request/index.d.ts +0 -24
  259. package/lib/plugins/app-types/request/pisell2Request.d.ts +0 -6
  260. package/lib/plugins/app-types/request/type.d.ts +0 -41
  261. package/lib/plugins/app-types/request/utils.d.ts +0 -46
  262. package/lib/plugins/app-types/routes/config.d.ts +0 -7
  263. package/lib/plugins/app-types/routes/index.d.ts +0 -28
  264. package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  265. package/lib/plugins/app-types/socket/components/index.d.ts +0 -2
  266. package/lib/plugins/app-types/socket/constants.d.ts +0 -33
  267. package/lib/plugins/app-types/socket/events.d.ts +0 -31
  268. package/lib/plugins/app-types/socket/heartbeat.d.ts +0 -66
  269. package/lib/plugins/app-types/socket/index.d.ts +0 -61
  270. package/lib/plugins/app-types/socket/monitor.d.ts +0 -169
  271. package/lib/plugins/app-types/socket/reconnect.d.ts +0 -61
  272. package/lib/plugins/app-types/socket/socket.d.ts +0 -129
  273. package/lib/plugins/app-types/socket/types.d.ts +0 -85
  274. package/lib/plugins/app-types/storage/index.d.ts +0 -17
  275. package/lib/plugins/app-types/tasks/index.d.ts +0 -77
  276. package/lib/plugins/app-types/tasks/type.d.ts +0 -62
  277. package/lib/plugins/app-types/tasks/useTasks.d.ts +0 -5
  278. package/lib/plugins/app-types/type.d.ts +0 -2
  279. package/lib/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  280. package/lib/plugins/app-types/variables/config.d.ts +0 -3
  281. package/lib/plugins/app-types/variables/index.d.ts +0 -6
  282. package/lib/plugins/app-types/variables/type.d.ts +0 -2
  283. package/lib/plugins/app-types/website/index.d.ts +0 -6
  284. package/lib/plugins/app.d.ts +0 -8
  285. package/lib/plugins/app.js +0 -17
  286. package/lib/solution/BookingTicket/index.d.ts +0 -184
  287. package/lib/solution/BookingTicket/index.js +0 -426
  288. package/lib/solution/BookingTicket/types.d.ts +0 -68
  289. package/lib/solution/BookingTicket/types.js +0 -72
  290. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  291. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -117
  292. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
  293. package/lib/solution/BookingTicket/utils/scan/handleScan.js +0 -132
  294. package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -85
  295. package/lib/solution/BookingTicket/utils/scan/index.js +0 -216
  296. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  297. package/lib/solution/BookingTicket/utils/scan/scanCache.js +0 -231
  298. package/lib/solution/Checkout/appointmentDemo.json +0 -1
  299. package/lib/solution/Checkout/index.d.ts +0 -432
  300. package/lib/solution/Checkout/index.js +0 -2776
  301. package/lib/solution/Checkout/types.d.ts +0 -727
  302. package/lib/solution/Checkout/types.js +0 -63
  303. package/lib/solution/Checkout/utils/index.d.ts +0 -121
  304. package/lib/solution/Checkout/utils/index.js +0 -362
  305. package/lib/utils/task.d.ts +0 -40
  306. package/lib/utils/task.js +0 -109
  307. package/lib/utils/watch.d.ts +0 -102
  308. package/lib/utils/watch.js +0 -217
@@ -1,72 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/solution/BookingTicket/types.ts
20
- var types_exports = {};
21
- __export(types_exports, {
22
- BookingTicketHooks: () => BookingTicketHooks,
23
- createModule: () => createModule
24
- });
25
- module.exports = __toCommonJS(types_exports);
26
- var import_modules = require("../../modules");
27
- var import_Customer = require("../../modules/Customer");
28
- function createModule(moduleName, solutionName, name, version) {
29
- switch (moduleName) {
30
- case "cart":
31
- return new import_modules.CartModule(
32
- `${solutionName}_${name || moduleName}`,
33
- version
34
- );
35
- case "products":
36
- return new import_modules.ProductList(
37
- `${solutionName}_${name || moduleName}`,
38
- version
39
- );
40
- case "accountList":
41
- return new import_modules.AccountListModule(
42
- `${solutionName}_${name || moduleName}`,
43
- version
44
- );
45
- case "customer":
46
- return new import_Customer.CustomerModule(
47
- `${solutionName}_${name || moduleName}`,
48
- version
49
- );
50
- case "order":
51
- return new import_modules.OrderModule(
52
- `${solutionName}_${name || moduleName}`,
53
- version
54
- );
55
- default:
56
- throw new Error(`Unknown module type: ${moduleName}`);
57
- }
58
- }
59
- var BookingTicketHooks = /* @__PURE__ */ ((BookingTicketHooks2) => {
60
- BookingTicketHooks2["onInited"] = "bookingTicket:onInited";
61
- BookingTicketHooks2["onDestroy"] = "bookingTicket:onDestroy";
62
- BookingTicketHooks2["onProductsLoaded"] = "bookingTicket:onProductsLoaded";
63
- BookingTicketHooks2["onCustomerSelected"] = "bookingTicket:onCustomerSelected";
64
- BookingTicketHooks2["onCustomerListUpdate"] = "bookingTicket:onCustomerListUpdate";
65
- BookingTicketHooks2["onCustomerListReset"] = "bookingTicket:onCustomerListReset";
66
- return BookingTicketHooks2;
67
- })(BookingTicketHooks || {});
68
- // Annotate the CommonJS export names for ESM import in node:
69
- 0 && (module.exports = {
70
- BookingTicketHooks,
71
- createModule
72
- });
@@ -1,22 +0,0 @@
1
- import { RequestPlugin } from '../../../../plugins';
2
- /**
3
- * 搜索通用识别码
4
- */
5
- export declare const searchWalletPass: (request: RequestPlugin, code: string) => Promise<{
6
- searchType: string;
7
- response: any;
8
- }>;
9
- /**
10
- * 搜索钱包
11
- */
12
- export declare const searchWallet: (request: RequestPlugin, code: string) => Promise<{
13
- searchType: string;
14
- response: any;
15
- }>;
16
- /**
17
- * 搜索商品
18
- */
19
- export declare const searchProduct: (request: RequestPlugin, code: string) => Promise<{
20
- searchType: string;
21
- response: any;
22
- }>;
@@ -1,117 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/solution/BookingTicket/utils/scan/cloudSearch.ts
20
- var cloudSearch_exports = {};
21
- __export(cloudSearch_exports, {
22
- searchProduct: () => searchProduct,
23
- searchWallet: () => searchWallet,
24
- searchWalletPass: () => searchWalletPass
25
- });
26
- module.exports = __toCommonJS(cloudSearch_exports);
27
- var searchWalletPass = async (request, code) => {
28
- const params = {
29
- code,
30
- translate_flag: 1,
31
- // 翻译识别码名称 0:不翻译 1:翻译
32
- relation_product: 1,
33
- // 组装关联商品: 0不处理 1处理
34
- with: ["customer"],
35
- tags: [
36
- "point_card",
37
- // 积分卡
38
- "gift_card",
39
- // 充值卡
40
- "product_voucher",
41
- // 代金券
42
- "product_discount_card",
43
- // 折扣卡
44
- "good_pass",
45
- // 商品券
46
- "session_ticket",
47
- // 场次票
48
- "appointment_ticket"
49
- // 预约类门票
50
- ]
51
- };
52
- try {
53
- const res = await (request == null ? void 0 : request.get(
54
- "/machinecode/batch-search",
55
- params
56
- ));
57
- if ((res == null ? void 0 : res.code) == 200 && !!(res == null ? void 0 : res.data)) {
58
- return { searchType: "walletPass", response: res };
59
- }
60
- throw new Error("没有找到对应的识别码");
61
- } catch (error) {
62
- throw error;
63
- }
64
- };
65
- var searchWallet = async (request, code) => {
66
- const params = { code, with_customer: 1 };
67
- try {
68
- const res = await (request == null ? void 0 : request.post(
69
- "/wallet/detail/search",
70
- params
71
- ));
72
- if ((res == null ? void 0 : res.code) == 200 && !!(res == null ? void 0 : res.data)) {
73
- return { searchType: "wallet", response: res };
74
- }
75
- throw new Error("没有找到对应的识别码");
76
- } catch (error) {
77
- throw error;
78
- }
79
- };
80
- var searchProduct = async (request, code) => {
81
- var _a, _b;
82
- const params = {
83
- exact_search: code,
84
- open_bundle: 0,
85
- // 套餐子信息
86
- open_quotation: 1,
87
- // 报价单
88
- skip: 1,
89
- num: 20,
90
- status: "published",
91
- with: ["variantGroup"],
92
- with_count: ["bundleGroup", "optionGroup"],
93
- exclude_extension_type: [
94
- "product_party",
95
- "product_event",
96
- "product_series_event",
97
- "product_package_ticket",
98
- "ticket",
99
- "event_item"
100
- ]
101
- };
102
- try {
103
- const res = await (request == null ? void 0 : request.post("/product/query", params));
104
- if ((res == null ? void 0 : res.code) == 200 && ((_b = (_a = res == null ? void 0 : res.data) == null ? void 0 : _a.list) == null ? void 0 : _b.length) > 0) {
105
- return { searchType: "product", response: res };
106
- }
107
- throw new Error("没有找到对应的识别码");
108
- } catch (error) {
109
- throw error;
110
- }
111
- };
112
- // Annotate the CommonJS export names for ESM import in node:
113
- 0 && (module.exports = {
114
- searchProduct,
115
- searchWallet,
116
- searchWalletPass
117
- });
@@ -1,22 +0,0 @@
1
- import { RequestPlugin } from '../../../../plugins';
2
- /**
3
- * 处理全局扫码
4
- * @param request 请求插件
5
- * @returns 处理结果
6
- */
7
- export declare const handleGlobalScan: (request: RequestPlugin, localSearch: (v: string) => any[]) => (scanResult: {
8
- type: string;
9
- value: string;
10
- }) => Promise<any>;
11
- /**
12
- * 处理客户扫码
13
- * @param request 请求插件
14
- * @returns 处理结果
15
- */
16
- export declare const handleCustomerScan: () => () => Promise<{}>;
17
- /**
18
- * 处理钱包扫码
19
- * @param request 请求插件
20
- * @returns 处理结果
21
- */
22
- export declare const handleUniversalScan: () => () => Promise<{}>;
@@ -1,132 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/solution/BookingTicket/utils/scan/handleScan.ts
30
- var handleScan_exports = {};
31
- __export(handleScan_exports, {
32
- handleCustomerScan: () => handleCustomerScan,
33
- handleGlobalScan: () => handleGlobalScan,
34
- handleUniversalScan: () => handleUniversalScan
35
- });
36
- module.exports = __toCommonJS(handleScan_exports);
37
- var import_cloudSearch = require("./cloudSearch");
38
- var import_scanCache = __toESM(require("./scanCache"));
39
- var promiseAny = async (promises) => {
40
- if (promises.length === 0) {
41
- throw new Error("No promises provided");
42
- }
43
- const errors = [];
44
- let completedCount = 0;
45
- return new Promise((resolve, reject) => {
46
- promises.forEach((promise, index) => {
47
- promise.then((result) => {
48
- resolve(result);
49
- }).catch((error) => {
50
- errors[index] = error;
51
- completedCount++;
52
- if (completedCount === promises.length) {
53
- const errorMessage = `All promises were rejected. Errors: ${errors.map((e) => e.message).join(", ")}`;
54
- const combinedError = new Error(errorMessage);
55
- combinedError.errors = errors;
56
- reject(combinedError);
57
- }
58
- });
59
- });
60
- });
61
- };
62
- var handleScanFn = (getRequestList, localSearch) => {
63
- return async (scanResult) => {
64
- const { value } = scanResult || {};
65
- if (localSearch) {
66
- try {
67
- const localResult = localSearch == null ? void 0 : localSearch(value);
68
- if ((localResult == null ? void 0 : localResult.length) > 0) {
69
- console.log("本地搜索到数据>>>>>>>", localResult);
70
- return {
71
- searchType: "local_product",
72
- response: { data: { list: localResult } }
73
- };
74
- } else {
75
- console.log("本地搜索无数据>>>>>>>");
76
- }
77
- } catch (error) {
78
- console.error("本地搜索到数据失败>>>>>>>", error);
79
- }
80
- }
81
- try {
82
- if (import_scanCache.default.has(value)) {
83
- const result = import_scanCache.default.get(value);
84
- console.log("缓存中搜索到数据>>>>>>>", result);
85
- return result;
86
- } else {
87
- console.log("缓存中无数据>>>>>>>");
88
- }
89
- } catch (error) {
90
- console.error("缓存中搜索数据失败>>>>>>>", error);
91
- }
92
- const requestList = (getRequestList == null ? void 0 : getRequestList(value)) || [];
93
- if (requestList.length === 0) {
94
- throw new Error("requestList is empty");
95
- }
96
- try {
97
- const result = await promiseAny(requestList);
98
- import_scanCache.default.set(value, result);
99
- return result;
100
- } catch (error) {
101
- throw error;
102
- }
103
- };
104
- };
105
- var handleGlobalScan = (request, localSearch) => {
106
- const getRequestList = (value) => {
107
- let requestList = [];
108
- if (value.startsWith("WL")) {
109
- requestList = [(0, import_cloudSearch.searchWallet)(request, value)];
110
- } else {
111
- requestList = [
112
- (0, import_cloudSearch.searchWalletPass)(request, value),
113
- (0, import_cloudSearch.searchWallet)(request, value),
114
- (0, import_cloudSearch.searchProduct)(request, value)
115
- ];
116
- }
117
- return requestList;
118
- };
119
- return handleScanFn(getRequestList, localSearch);
120
- };
121
- var handleCustomerScan = () => {
122
- return () => Promise.resolve({});
123
- };
124
- var handleUniversalScan = () => {
125
- return () => Promise.resolve({});
126
- };
127
- // Annotate the CommonJS export names for ESM import in node:
128
- 0 && (module.exports = {
129
- handleCustomerScan,
130
- handleGlobalScan,
131
- handleUniversalScan
132
- });
@@ -1,85 +0,0 @@
1
- import { WatchEventItem } from '../../../../utils/watch';
2
- import { BookingTicketImpl } from '../../index';
3
- import Tasks from '../../../../utils/task';
4
- interface ScanResult {
5
- type: ScanResultType;
6
- value: string;
7
- data?: {
8
- [key: string]: any;
9
- };
10
- }
11
- declare enum ScanResultType {
12
- Scanner = "scanner",
13
- NFC = "nfc",
14
- NativeScanner = "nativeScanner"
15
- }
16
- export default class Scan {
17
- private solution;
18
- private watchKey;
19
- private listenerConfig;
20
- constructor(solution: BookingTicketImpl, watchKey: string);
21
- /**
22
- * 初始化外设扫码结果监听
23
- */
24
- initPeripheralsListener(): void;
25
- /**
26
- * 处理扫码事件
27
- * @param eventKey 事件key
28
- * @param value 扫码结果
29
- */
30
- handleScan(result: {
31
- type: string;
32
- value: string;
33
- }): void;
34
- /**
35
- * 生成uuid
36
- * @returns uuid
37
- */
38
- generateUuid(): string;
39
- /**
40
- * 添加扫码信息监听
41
- * @param watchKey 监听的key
42
- * @param event 事件
43
- */
44
- addListener(event: WatchEventItem, scanCallback?: (result: ScanResult) => Promise<any>): {
45
- remove: () => void;
46
- };
47
- /**
48
- * 移除扫码信息监听
49
- * @param watchKey 监听的key
50
- * @param event 事件
51
- */
52
- removeListener(event: WatchEventItem): void;
53
- /**
54
- * 移除所有监听
55
- */
56
- removeAllListeners(): void;
57
- /**
58
- * 启用所有监听
59
- */
60
- enableAllListeners(): void;
61
- /**
62
- * 禁用所有监听,并清空任务执行队列
63
- */
64
- disableAllListeners(): void;
65
- /**
66
- * 清空监听对应的任务执行队列,不传入eventKey则清空所有监听对应的任务执行队列
67
- * @param eventKey 事件key
68
- */
69
- clearTaskQueue(eventKey?: string): void;
70
- /**
71
- * 获取监听配置
72
- * @param eventKey 事件key
73
- * @returns 监听配置
74
- */
75
- getListenerConfig(eventKey: string): {
76
- scanCallback?: ((result: ScanResult) => Promise<any>) | undefined;
77
- task: Tasks;
78
- } | undefined;
79
- /**
80
- * 扫码任务执行函数
81
- * @param args 参数
82
- */
83
- scanTaskAction(...args: any[]): Promise<void>;
84
- }
85
- export {};
@@ -1,216 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/solution/BookingTicket/utils/scan/index.ts
30
- var scan_exports = {};
31
- __export(scan_exports, {
32
- default: () => Scan
33
- });
34
- module.exports = __toCommonJS(scan_exports);
35
- var import_watch = __toESM(require("../../../../utils/watch"));
36
- var import_task = __toESM(require("../../../../utils/task"));
37
- var Scan = class {
38
- constructor(solution, watchKey) {
39
- this.listenerConfig = /* @__PURE__ */ new Map();
40
- this.solution = solution;
41
- this.watchKey = watchKey;
42
- this.initPeripheralsListener();
43
- }
44
- /**
45
- * 初始化外设扫码结果监听
46
- */
47
- initPeripheralsListener() {
48
- var _a, _b, _c, _d, _e;
49
- (_e = (_d = (_c = (_b = (_a = this.solution) == null ? void 0 : _a.window) == null ? void 0 : _b.interaction) == null ? void 0 : _c.utils) == null ? void 0 : _d.mountFunction) == null ? void 0 : _e.call(
50
- _d,
51
- "global",
52
- "peripheralsResult",
53
- (strVal) => {
54
- try {
55
- const result = JSON.parse(strVal);
56
- console.log("nativeScannerResult>>>>>>>", result);
57
- this.handleScan(result);
58
- } catch (err) {
59
- console.error(err);
60
- }
61
- }
62
- );
63
- }
64
- /**
65
- * 处理扫码事件
66
- * @param eventKey 事件key
67
- * @param value 扫码结果
68
- */
69
- handleScan(result) {
70
- const lastEnableEventKey = import_watch.default.getLastEnableEventKey(this.watchKey);
71
- if (lastEnableEventKey) {
72
- const listenerConfig = this.listenerConfig.get(lastEnableEventKey);
73
- if (listenerConfig) {
74
- listenerConfig.task.addTask({
75
- uuid: this.generateUuid(),
76
- type: lastEnableEventKey,
77
- actionParams: {
78
- scanResult: result
79
- }
80
- });
81
- }
82
- }
83
- }
84
- /**
85
- * 生成uuid
86
- * @returns uuid
87
- */
88
- generateUuid() {
89
- return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15) + Date.now().toString(36);
90
- }
91
- /**
92
- * 添加扫码信息监听
93
- * @param watchKey 监听的key
94
- * @param event 事件
95
- */
96
- addListener(event, scanCallback) {
97
- import_watch.default.subscribe(this.watchKey, event);
98
- const task = new import_task.default();
99
- task.addAction(
100
- event.key,
101
- (...args) => this.scanTaskAction(event.key, ...args)
102
- );
103
- this.listenerConfig.set(event.key, { scanCallback, task });
104
- return {
105
- remove: () => {
106
- this.removeListener(event);
107
- }
108
- };
109
- }
110
- /**
111
- * 移除扫码信息监听
112
- * @param watchKey 监听的key
113
- * @param event 事件
114
- */
115
- removeListener(event) {
116
- var _a, _b;
117
- import_watch.default.unsubscribe(this.watchKey, event);
118
- (_b = (_a = this.listenerConfig.get(event.key)) == null ? void 0 : _a.task) == null ? void 0 : _b.clear();
119
- this.listenerConfig.delete(event.key);
120
- }
121
- /**
122
- * 移除所有监听
123
- */
124
- removeAllListeners() {
125
- var _a, _b, _c, _d;
126
- import_watch.default.clearEvent(this.watchKey);
127
- (_b = (_a = this.listenerConfig) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(_a, (item) => {
128
- var _a2;
129
- (_a2 = item == null ? void 0 : item.task) == null ? void 0 : _a2.clear();
130
- });
131
- (_d = (_c = this.listenerConfig) == null ? void 0 : _c.clear) == null ? void 0 : _d.call(_c);
132
- }
133
- /**
134
- * 启用所有监听
135
- */
136
- enableAllListeners() {
137
- import_watch.default.enableAllEventByWatchKey(this.watchKey);
138
- }
139
- /**
140
- * 禁用所有监听,并清空任务执行队列
141
- */
142
- disableAllListeners() {
143
- var _a, _b;
144
- import_watch.default.disabledAllEventByWatchKey(this.watchKey);
145
- (_b = (_a = this.listenerConfig) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(_a, (item) => {
146
- var _a2;
147
- (_a2 = item == null ? void 0 : item.task) == null ? void 0 : _a2.clearTaskQueue();
148
- });
149
- }
150
- /**
151
- * 清空监听对应的任务执行队列,不传入eventKey则清空所有监听对应的任务执行队列
152
- * @param eventKey 事件key
153
- */
154
- clearTaskQueue(eventKey) {
155
- var _a, _b, _c;
156
- console.log("clearTaskQueue>>>>>>>", eventKey);
157
- if (eventKey) {
158
- (_a = this.listenerConfig.get(eventKey)) == null ? void 0 : _a.task.clearTaskQueue();
159
- } else {
160
- (_c = (_b = this.listenerConfig) == null ? void 0 : _b.forEach) == null ? void 0 : _c.call(_b, (item) => {
161
- var _a2;
162
- (_a2 = item == null ? void 0 : item.task) == null ? void 0 : _a2.clearTaskQueue();
163
- });
164
- }
165
- }
166
- /**
167
- * 获取监听配置
168
- * @param eventKey 事件key
169
- * @returns 监听配置
170
- */
171
- getListenerConfig(eventKey) {
172
- var _a;
173
- return (_a = this.listenerConfig) == null ? void 0 : _a.get(eventKey);
174
- }
175
- /**
176
- * 扫码任务执行函数
177
- * @param args 参数
178
- */
179
- async scanTaskAction(...args) {
180
- const [eventKey, other] = args;
181
- const { type, value, data } = (other == null ? void 0 : other.scanResult) || {};
182
- const taskItemUuid = other == null ? void 0 : other.uuid;
183
- const { scanCallback, task } = this.getListenerConfig(eventKey) || {};
184
- if (scanCallback) {
185
- try {
186
- const result = await scanCallback({ type, value });
187
- console.log(`${eventKey}_result>>>>>>>`, result);
188
- if (taskItemUuid && (task == null ? void 0 : task.isTaskExist(taskItemUuid))) {
189
- import_watch.default.publishByEventKey(this.watchKey, eventKey, {
190
- type: eventKey,
191
- status: "success",
192
- scanType: type,
193
- scanCode: value,
194
- scanData: data,
195
- result
196
- });
197
- } else {
198
- console.warn(`${eventKey}_result_task_not_exist>>>>>>>`, task);
199
- }
200
- } catch (error) {
201
- console.log(`${eventKey}_result_error>>>>>>>`, error);
202
- if (taskItemUuid && (task == null ? void 0 : task.isTaskExist(taskItemUuid))) {
203
- import_watch.default.publishByEventKey(this.watchKey, eventKey, {
204
- type: eventKey,
205
- status: "failed",
206
- scanType: type,
207
- scanCode: value,
208
- scanData: data
209
- });
210
- } else {
211
- console.warn(`${eventKey}_result_error_task_not_exist>>>>>>>`, task);
212
- }
213
- }
214
- }
215
- }
216
- };