@jetthai/cuora 1.1.468-dev.1 → 1.1.469
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/sync-ai-prompts.md +1 -88
- package/.claude/settings.local.json +1 -3
- package/.github/copilot-instructions.md +57 -64
- package/.husky/post-checkout +3 -3
- package/.husky/pre-push +1 -1
- package/.prettierignore +1 -2
- package/AGENTS.md +57 -64
- package/AI_PROMPT_SOURCE.md +57 -64
- package/CHANGELOG.md +4 -180
- package/CLAUDE.md +57 -64
- package/GEMINI.md +57 -64
- package/README.md +12 -11
- package/package.json +1 -1
- package/scripts/auto-version.js +0 -1
- package/scripts/branch-auto-npm-publish.js +2 -9
- package/src/api/account.js +1 -0
- package/src/api/activity.js +37 -0
- package/src/api/auth.js +31 -0
- package/src/api/game.js +10 -0
- package/src/api/payment.js +52 -0
- package/src/api/user.js +22 -4
- package/src/index.js +2 -2
- package/src/machine/activity/activity.js +209 -0
- package/src/machine/activity/activity_cash.js +15 -23
- package/src/machine/activity/diamond_shop_activity_cash.js +1 -0
- package/src/machine/activity/diamond_shop_activity_fc.js +196 -0
- package/src/machine/activity/diamond_shop_activity_vn.js +178 -0
- package/src/machine/activity/fafafa_activity.js +10 -0
- package/src/machine/activity/index.js +12 -0
- package/src/machine/activity/invite_friends_activity.js +114 -0
- package/src/machine/activity/mini_game_activity.js +68 -0
- package/src/machine/activity/return_bonus_activity.js +153 -0
- package/src/machine/auth.js +68 -16
- package/src/machine/auth_otp_v2.js +177 -0
- package/src/machine/auth_otp_v3.js +3 -0
- package/src/machine/bank_binding_amb.js +146 -0
- package/src/machine/bonus.js +76 -0
- package/src/machine/common.js +55 -0
- package/src/machine/deposit/amb.js +93 -0
- package/src/machine/deposit/crypto_bank.js +330 -0
- package/src/machine/deposit/crypto_qrcode.js +148 -0
- package/src/machine/deposit/crypto_way.js +252 -0
- package/src/machine/deposit/deposit_fc.js +272 -0
- package/src/machine/deposit/direct.js +310 -0
- package/src/machine/deposit/float.js +375 -0
- package/src/machine/deposit/index.js +28 -0
- package/src/machine/deposit/krway.js +151 -0
- package/src/machine/deposit/loadcard_vn.js +351 -0
- package/src/machine/deposit/manual_cash.js +8 -0
- package/src/machine/deposit/manual_vn.js +458 -0
- package/src/machine/deposit/qrcode_v2.js +338 -0
- package/src/machine/deposit/usdt.js +144 -0
- package/src/machine/deposit/virtual_bank_vn.js +269 -0
- package/src/machine/deposit/vpay.js +368 -0
- package/src/machine/game_hot_new.js +79 -0
- package/src/machine/game_info.js +12 -1
- package/src/machine/game_replay.js +46 -0
- package/src/machine/game_search_v2.js +401 -0
- package/src/machine/game_v2_1.js +89 -1
- package/src/machine/honor_board.js +132 -0
- package/src/machine/inbox.js +12 -0
- package/src/machine/index.js +32 -0
- package/src/machine/merge.js +57 -0
- package/src/machine/payment_data.js +86 -0
- package/src/machine/promotions.js +170 -0
- package/src/machine/reward.js +255 -0
- package/src/machine/reward_cash.js +39 -0
- package/src/machine/reward_fc.js +98 -0
- package/src/machine/side.js +154 -0
- package/src/machine/side_v2.js +211 -0
- package/src/machine/user_reset_password.js +13 -0
- package/src/machine/user_sign_up.js +1 -6
- package/src/machine/vip_table.js +57 -0
- package/src/machine/websocket.js +4 -0
- package/src/machine/welcome.js +110 -0
- package/src/machine/withdraw/index.js +6 -0
- package/src/machine/withdraw/withdraw_crypto_cash.js +327 -0
- package/src/machine/withdraw/withdraw_krway.js +223 -0
- package/src/machine/withdraw/withdraw_manual.js +536 -0
- package/src/request/request.js +28 -0
- package/src/util/constant.js +1 -0
- package/src/util/index.js +4 -1
- package/src/util/math.js +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,96 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
### [1.1.
|
|
6
|
-
|
|
7
|
-
### [1.1.468-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.468...v1.1.468-dev.0) (2026-09-12)
|
|
8
|
-
|
|
9
|
-
### [1.1.467-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.467...v1.1.467-dev.2) (2026-09-10)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
### ⚠ BREAKING CHANGES
|
|
13
|
-
|
|
14
|
-
* **export:** 移除頂層 export util 與 Request.sourceUpdate/sourceGenerate
|
|
15
|
-
|
|
16
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
17
|
-
* **api,machine:** 移除 39 個 api 方法、2 個常數與 14 個 machine 事件
|
|
18
|
-
|
|
19
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
20
|
-
* **machine:** 移除公開 export machine.bonus、machine.vip_table 與 util 的 max
|
|
21
|
-
|
|
22
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
23
|
-
|
|
24
|
-
### Features
|
|
25
|
-
|
|
26
|
-
* **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
### Bug Fixes
|
|
30
|
-
|
|
31
|
-
* **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
|
|
32
|
-
* **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
33
|
-
* **machine:** user_sign_up 的 registrationData 補上 agentId ([833e8c9](https://github.com/jetthai/cuora-module/commit/833e8c90c0ff554cff651bdb7045ed514d42035e))
|
|
34
|
-
* **machine:** 移除三處幽靈 action 引用 ([49009da](https://github.com/jetthai/cuora-module/commit/49009dae604088b819134e0d40f7719fb8e8874d))
|
|
35
|
-
* **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
|
|
36
|
-
* **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
37
|
-
* **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
38
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* **api,machine:** 移除 39 個零呼叫端 API 與 14 個無觸發來源的 machine 事件 ([14fa754](https://github.com/jetthai/cuora-module/commit/14fa75459aba9558cde1a3485d64cbdf2f8294b2))
|
|
42
|
-
* **export:** 移除四個無消費者的對外符號 ([55afe6f](https://github.com/jetthai/cuora-module/commit/55afe6fbfadca8944dd9820d6333ee5b93e0ed25))
|
|
43
|
-
* **machine:** 移除 client-pwa-cash 未使用的 bonus、vip_table 與 util/max ([f49977b](https://github.com/jetthai/cuora-module/commit/f49977bfd480d961f5dc37435b3c60447eb198c0))
|
|
44
|
-
|
|
45
|
-
### [1.1.467-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.467-dev.1...v1.1.467-dev.2) (2026-09-10)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
### Bug Fixes
|
|
49
|
-
|
|
50
|
-
* **machine:** user_sign_up 的 registrationData 補上 agentId ([833e8c9](https://github.com/jetthai/cuora-module/commit/833e8c90c0ff554cff651bdb7045ed514d42035e))
|
|
51
|
-
|
|
52
|
-
### [1.1.467-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.467-dev.0...v1.1.467-dev.1) (2026-09-09)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
### ⚠ BREAKING CHANGES
|
|
56
|
-
|
|
57
|
-
* **export:** 移除頂層 export util 與 Request.sourceUpdate/sourceGenerate
|
|
58
|
-
|
|
59
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
60
|
-
* **api,machine:** 移除 39 個 api 方法、2 個常數與 14 個 machine 事件
|
|
61
|
-
|
|
62
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
63
|
-
* **machine:** 移除公開 export machine.bonus、machine.vip_table 與 util 的 max
|
|
64
|
-
|
|
65
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
5
|
+
### [1.1.469](https://github.com/jetthai/cuora-module/compare/v1.1.468...v1.1.469) (2026-09-13)
|
|
66
6
|
|
|
67
7
|
### Bug Fixes
|
|
68
8
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
* **api,machine:** 移除 39 個零呼叫端 API 與 14 個無觸發來源的 machine 事件 ([14fa754](https://github.com/jetthai/cuora-module/commit/14fa75459aba9558cde1a3485d64cbdf2f8294b2))
|
|
73
|
-
* **export:** 移除四個無消費者的對外符號 ([55afe6f](https://github.com/jetthai/cuora-module/commit/55afe6fbfadca8944dd9820d6333ee5b93e0ed25))
|
|
74
|
-
* **machine:** 移除 client-pwa-cash 未使用的 bonus、vip_table 與 util/max ([f49977b](https://github.com/jetthai/cuora-module/commit/f49977bfd480d961f5dc37435b3c60447eb198c0))
|
|
75
|
-
|
|
76
|
-
### [1.1.467-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.467...v1.1.467-dev.0) (2026-09-09)
|
|
77
|
-
|
|
78
|
-
### [1.1.466-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.466...v1.1.466-dev.0) (2026-09-06)
|
|
9
|
+
- **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
|
|
79
10
|
|
|
11
|
+
### [1.1.468](https://github.com/jetthai/cuora-module/compare/v1.1.467...v1.1.468) (2026-09-11)
|
|
80
12
|
|
|
81
13
|
### Features
|
|
82
14
|
|
|
83
|
-
|
|
84
|
-
* **payment:** 新增 getPaymentPromotions API 描述符 ([0319692](https://github.com/jetthai/cuora-module/commit/03196925d989333e4bdb11cd933c18b6ace65d83))
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
### Bug Fixes
|
|
88
|
-
|
|
89
|
-
* **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
|
|
90
|
-
* **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
91
|
-
* **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
|
|
92
|
-
* **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
93
|
-
* **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
94
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
15
|
+
- **payment:** 新增 getPaymentPromotions API 描述符 ([0319692](https://github.com/jetthai/cuora-module/commit/03196925d989333e4bdb11cd933c18b6ace65d83))
|
|
95
16
|
|
|
96
17
|
### [1.1.467](https://github.com/jetthai/cuora-module/compare/v1.1.466...v1.1.467) (2026-09-06)
|
|
97
18
|
|
|
@@ -101,74 +22,15 @@ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
|
101
22
|
|
|
102
23
|
### [1.1.466](https://github.com/jetthai/cuora-module/compare/v1.1.465...v1.1.466) (2026-08-31)
|
|
103
24
|
|
|
104
|
-
### [1.1.465-dev.4](https://github.com/jetthai/cuora-module/compare/v1.1.465-dev.3...v1.1.465-dev.4) (2026-08-24)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
### Bug Fixes
|
|
108
|
-
|
|
109
|
-
* **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
|
|
110
|
-
|
|
111
|
-
### [1.1.465-dev.3](https://github.com/jetthai/cuora-module/compare/v1.1.465-dev.2...v1.1.465-dev.3) (2026-08-19)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
### Bug Fixes
|
|
115
|
-
|
|
116
|
-
* **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
|
|
117
|
-
|
|
118
|
-
### [1.1.465-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.465-dev.1...v1.1.465-dev.2) (2026-08-19)
|
|
119
|
-
|
|
120
|
-
### [1.1.465-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.465-dev.0...v1.1.465-dev.1) (2026-08-19)
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
### Features
|
|
124
|
-
|
|
125
|
-
* **payment:** 新增 getPaymentPromotions API 描述符 ([0319692](https://github.com/jetthai/cuora-module/commit/03196925d989333e4bdb11cd933c18b6ace65d83))
|
|
126
|
-
|
|
127
25
|
### [1.1.465](https://github.com/jetthai/cuora-module/compare/v1.1.464...v1.1.465) (2026-08-17)
|
|
128
26
|
|
|
129
27
|
### [1.1.464](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.464) (2026-08-16)
|
|
130
28
|
|
|
131
|
-
### [1.1.465-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.463-dev.3...v1.1.465-dev.0) (2026-08-17)
|
|
132
|
-
|
|
133
|
-
### [1.1.465](https://github.com/jetthai/cuora-module/compare/v1.1.464...v1.1.465) (2026-08-17)
|
|
134
|
-
|
|
135
|
-
### [1.1.463-dev.3](https://github.com/jetthai/cuora-module/compare/v1.1.463-dev.2...v1.1.463-dev.3) (2026-08-17)
|
|
136
|
-
|
|
137
|
-
### [1.1.464](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.464) (2026-08-16)
|
|
138
|
-
|
|
139
|
-
|
|
140
29
|
### Bug Fixes
|
|
141
30
|
|
|
142
31
|
- **deposit:** 切換存款活動不再重設使用者已選的通道 ([b9c1de2](https://github.com/jetthai/cuora-module/commit/b9c1de2f3665c56f52d7b074e892837e836d02fa))
|
|
143
32
|
- **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
|
|
144
33
|
|
|
145
|
-
### [1.1.463-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.463-dev.1...v1.1.463-dev.2) (2026-08-16)
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
### Bug Fixes
|
|
149
|
-
|
|
150
|
-
* **deposit:** 切換存款活動不再重設使用者已選的通道 ([b9c1de2](https://github.com/jetthai/cuora-module/commit/b9c1de2f3665c56f52d7b074e892837e836d02fa))
|
|
151
|
-
|
|
152
|
-
### [1.1.463-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.463-dev.0...v1.1.463-dev.1) (2026-08-13)
|
|
153
|
-
|
|
154
|
-
### [1.1.463-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.463-dev.0) (2026-08-13)
|
|
155
|
-
|
|
156
|
-
### [1.1.455-dev.8](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.455-dev.8) (2026-08-09)
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
### Features
|
|
160
|
-
|
|
161
|
-
* **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
### Bug Fixes
|
|
165
|
-
|
|
166
|
-
* **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
167
|
-
* **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
168
|
-
* **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
169
|
-
* **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
|
|
170
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
171
|
-
|
|
172
34
|
### [1.1.463](https://github.com/jetthai/cuora-module/compare/v1.1.462...v1.1.463) (2026-08-12)
|
|
173
35
|
|
|
174
36
|
### [1.1.462](https://github.com/jetthai/cuora-module/compare/v1.1.461...v1.1.462) (2026-08-10)
|
|
@@ -185,44 +47,6 @@ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
|
185
47
|
|
|
186
48
|
### [1.1.456](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.456) (2026-08-09)
|
|
187
49
|
|
|
188
|
-
### [1.1.455-dev.8](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.7...v1.1.455-dev.8) (2026-08-09)
|
|
189
|
-
|
|
190
|
-
### [1.1.455-dev.7](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.6...v1.1.455-dev.7) (2026-08-07)
|
|
191
|
-
|
|
192
|
-
### [1.1.455-dev.6](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.5...v1.1.455-dev.6) (2026-08-07)
|
|
193
|
-
|
|
194
|
-
### [1.1.455-dev.5](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.4...v1.1.455-dev.5) (2026-08-07)
|
|
195
|
-
|
|
196
|
-
### [1.1.455-dev.4](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.3...v1.1.455-dev.4) (2026-08-07)
|
|
197
|
-
|
|
198
|
-
### [1.1.455-dev.3](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.2...v1.1.455-dev.3) (2026-08-07)
|
|
199
|
-
|
|
200
|
-
### [1.1.455-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.1...v1.1.455-dev.2) (2026-08-06)
|
|
201
|
-
|
|
202
|
-
### [1.1.455-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.455-dev.0...v1.1.455-dev.1) (2026-08-04)
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
### Bug Fixes
|
|
206
|
-
|
|
207
|
-
- **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
|
|
208
|
-
|
|
209
|
-
### [1.1.455-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.455-dev.0) (2026-08-04)
|
|
210
|
-
|
|
211
|
-
### [1.1.454-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.453...v1.1.454-dev.0) (2026-07-29)
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
### Features
|
|
215
|
-
|
|
216
|
-
- **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
### Bug Fixes
|
|
220
|
-
|
|
221
|
-
- **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
222
|
-
- **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
223
|
-
- **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
224
|
-
- **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
225
|
-
|
|
226
50
|
### [1.1.455](https://github.com/jetthai/cuora-module/compare/v1.1.453...v1.1.455) (2026-08-03)
|
|
227
51
|
|
|
228
52
|
### Bug Fixes
|
package/CLAUDE.md
CHANGED
|
@@ -99,9 +99,7 @@ state machine service → request.send(api.xxx(params)) → Request class → AP
|
|
|
99
99
|
| Request | `src/request/` | Token injection, V1→V2 path conversion, maintenance-mode detection, custom serialization, request cancellation |
|
|
100
100
|
| API | `src/api/` | Each function returns a **request descriptor object** (it does not send the request) |
|
|
101
101
|
| Machine | `src/machine/` | XState v4 state machines, factory pattern receiving `request` |
|
|
102
|
-
| Util | `src/util/` | storage (with `maxAge` TTL), constant,
|
|
103
|
-
|
|
104
|
-
> **deviceToken does not live in this package**: `auth.js` / `user_sign_up.js` obtain the device token by calling `request.config.getDt?.()` — the implementation is injected by the downstream frontend when it constructs `request`; this package only calls it. Whether it is called is decided by `siteConfig.dtVerify` (login flow) or the `deviceTokenEnable` context (registration flow); when nothing is injected, `?.()` returns `undefined` instead of throwing.
|
|
102
|
+
| Util | `src/util/` | storage (with `maxAge` TTL), deviceToken, constant, math |
|
|
105
103
|
|
|
106
104
|
**API descriptor object structure**:
|
|
107
105
|
|
|
@@ -180,13 +178,16 @@ Token 5min TTL → fetchUserInfo success → extendToken resets TTL → poll aga
|
|
|
180
178
|
|
|
181
179
|
**Polling interval**: base `tick: 2000ms`, **multiplied by 5 while in a game** (becoming 10 seconds) to reduce server load during play.
|
|
182
180
|
|
|
183
|
-
**Login method routing** (
|
|
181
|
+
**Login method routing** (7 kinds):
|
|
184
182
|
|
|
185
183
|
| Event | Method | Special Handling |
|
|
186
184
|
| ---------------- | -------------------- | --------------------------------------------------------------- |
|
|
187
185
|
| `LOGIN_ID` | Account + password | reCAPTCHA header |
|
|
188
186
|
| `LOGIN_PHONE` | Phone number | reCAPTCHA header + country code |
|
|
189
187
|
| `LOGIN_EMAIL` | Email | reCAPTCHA header |
|
|
188
|
+
| `LOGIN_LOCAL` | Local account | Additionally stores `cuora_tempuser` (24h TTL) |
|
|
189
|
+
| `LOGIN_GUEST` | Guest | No auth credentials |
|
|
190
|
+
| `LOGIN_APP` | OAuth App | provider + accessToken |
|
|
190
191
|
| `LOGIN_TELEGRAM` | Telegram | additionalUserInfo |
|
|
191
192
|
| `LOGIN_3PARTY` | Third-party redirect | **Does not switch state**; uses `window.location.href` directly |
|
|
192
193
|
|
|
@@ -196,33 +197,33 @@ Token 5min TTL → fetchUserInfo success → extendToken resets TTL → poll aga
|
|
|
196
197
|
|
|
197
198
|
### 2.2 Canonical Deposit Pattern
|
|
198
199
|
|
|
199
|
-
|
|
200
|
+
All deposit state machines follow a unified core flow, with variants per payment method:
|
|
200
201
|
|
|
201
202
|
```
|
|
202
|
-
loading (
|
|
203
|
-
→
|
|
204
|
-
→
|
|
205
|
-
→
|
|
206
|
-
|
|
207
|
-
|
|
203
|
+
loading (fetch siteConfig + bankList in parallel)
|
|
204
|
+
→ promotion (routing: has a minimum deposit → calculating, none → loaded)
|
|
205
|
+
→ loaded (user selects bank/amount)
|
|
206
|
+
→ debouncing (CALCULATE event, 1000ms debounce)
|
|
207
|
+
→ calculating (calls getDepositExpectedResult)
|
|
208
|
+
→ loaded/calculated (show the calculation result)
|
|
209
|
+
→ submitting → submitted
|
|
208
210
|
```
|
|
209
211
|
|
|
210
|
-
**
|
|
211
|
-
|
|
212
|
-
| Aspect | Convention |
|
|
213
|
-
| ------------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
214
|
-
| Constructor | `(request, context) => createMachine()` — initial data is **preloaded by the caller**, not fetched by the machine |
|
|
215
|
-
| loading phase | `always` transitions immediately, with no async request |
|
|
216
|
-
| Global events | `internal: false` (forces external transitions, ensuring entry/exit re-run) |
|
|
217
|
-
| Debounce | `debouncing` uses `after: { 1000 }` + `cond`, not a separate CALCULATE event |
|
|
212
|
+
**Cash vs Non-Cash variants**:
|
|
218
213
|
|
|
219
|
-
|
|
214
|
+
| Aspect | Non-Cash (e.g. `direct.js`) | Cash (e.g. `direct_cash.js`) |
|
|
215
|
+
| ------------- | ---------------------------------------- | ----------------------------------------------- |
|
|
216
|
+
| Constructor | `(request) => createMachine()` | `(request, context) => createMachine()` |
|
|
217
|
+
| Initial data | Fetched asynchronously (init → fetching) | Preloaded via the context parameter |
|
|
218
|
+
| loading phase | Two sub-states (init + fetching) | `always` jumps straight to checking |
|
|
219
|
+
| Global events | `internal: true` (default) | `internal: false` (forces external transitions) |
|
|
220
|
+
| Bank list | Re-fetched every time | `bankMap` cache (keyed by method) |
|
|
220
221
|
|
|
221
|
-
|
|
222
|
+
**Promotion & Bonus preview**: the `SET_PROMOTION` global event sets the promotion context; if `siteConfig.bonusPreviewEnable === true` and `promotion.activityNo !== 'none'`, `getBonusPreview` is additionally called.
|
|
222
223
|
|
|
223
|
-
>
|
|
224
|
+
> ⚠️ **Naming inconsistency (easy to trip on)**: Non-Cash uses `promotion?.activityNo`, Cash uses `promotion?.promotionsNo`.
|
|
224
225
|
|
|
225
|
-
**resultMap cache** (`usdt_cash.js`): caches keyed by `selectedNetwork.value` to avoid re-fetching the same network address.
|
|
226
|
+
**resultMap cache** (`usdt.js`, `usdt_cash.js`): caches keyed by `selectedNetwork.value` to avoid re-fetching the same network address.
|
|
226
227
|
|
|
227
228
|
> ⚠️ **V2 API response format is inconsistent**: the same endpoint may return `{ data: {...} }` or just `{...}`, so every machine needs defensive handling:
|
|
228
229
|
>
|
|
@@ -233,36 +234,26 @@ loading (always + setInitData: takes paymentDetail from the factory context para
|
|
|
233
234
|
> })
|
|
234
235
|
> ```
|
|
235
236
|
|
|
236
|
-
**processing state check**: `
|
|
237
|
+
**processing state check**: `crypto_bank.js` and `manual_cash.js` check at initialization whether there is an in-progress deposit order, and if so jump straight to `submitted` to prevent duplicate submission.
|
|
237
238
|
|
|
238
239
|
### 2.3 Withdrawal Flow & OTP
|
|
239
240
|
|
|
240
|
-
|
|
241
|
+
**Five-step eligibility validation chain** (`withdraw_manual.js`); failing any step transitions to the corresponding blocking state:
|
|
241
242
|
|
|
242
243
|
```
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
244
|
+
1. haveProcessing → is there a withdrawal in progress? (yes → inProcessing)
|
|
245
|
+
2. isBankNotBound → is a bank account bound? (no → unbound)
|
|
246
|
+
3. isNotWithdrawMinDepositAmount → is the minimum deposit threshold met?
|
|
247
|
+
4. isPassWithdrawCooldownTime → still within the cooldown?
|
|
248
|
+
5. isNotWIthdrawServiceTime → within the service window?
|
|
249
|
+
All passed → withdrawable
|
|
249
250
|
```
|
|
250
251
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
**Double-wallet withdrawal rule gate** (`doubleWalletWithdrawLimitCheck` — the least intuitive part; the point is to save API calls):
|
|
254
|
-
|
|
255
|
-
| Value | Behavior |
|
|
256
|
-
| ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
257
|
-
| `'0'` | Fetch only the CASH `withdrawRule` |
|
|
258
|
-
| `'1'` | Fetch only the ACTIVITY `withdrawRule`; regardless of whether it qualifies, the CASH rule takes no part in the gate |
|
|
259
|
-
| `'2'` | Fetch ACTIVITY first; if **not withdrawable**, adopt it directly (skipping CASH); only when it **qualifies** does it go on to fetch CASH as the basis |
|
|
260
|
-
|
|
261
|
-
`enableWithdraw` deliberately uses a truthy comparison (`!activityRule?.enableWithdraw`) to align with client-pwa-ssr, avoiding misjudgment when the backend returns a non-boolean truthy value such as `1`.
|
|
252
|
+
**OTP parallel states**: after a withdrawal is submitted, if the response contains `request_id` plus `number`/`email`, it enters OTP verification. `countdown` (decrementing the TTL each second) and `verification` (`idle → acknowledging → submitted`) run **in parallel**, so the countdown does not block verification actions.
|
|
262
253
|
|
|
263
|
-
**
|
|
254
|
+
**Withdrawal rules system**: the `withdrawRules` array is matched against the balance, using `findLastIndex` to find the **last** matching rule (the highest amount tier), which determines `maxWithdrawAmount`.
|
|
264
255
|
|
|
265
|
-
|
|
256
|
+
**Attachment types**: `withdraw` (normal withdrawal) vs `pool` (bonus / free-credit redemption, which calls the `restore` API).
|
|
266
257
|
|
|
267
258
|
### 2.4 Game Management
|
|
268
259
|
|
|
@@ -278,11 +269,11 @@ There are only 4 guards: `hasNoBank` (`REFRESH` only reloads when no account is
|
|
|
278
269
|
|
|
279
270
|
**receiveStatus enum**: `0` in progress / not yet eligible (→ `progress_status`), `1` claimed (→ `received`, terminal), `2` claimable (→ `receiveable`).
|
|
280
271
|
|
|
281
|
-
**Red-dot unread state
|
|
272
|
+
**Red-dot unread state**:
|
|
282
273
|
|
|
283
|
-
-
|
|
274
|
+
- `noRedActivity = [2, 4, 13, 20, 90, 91, 92]` — these activity types **never show a red dot**
|
|
275
|
+
- For other activities the read state is stored in localStorage under the key `unread_${activityNo}_${uidSite}`
|
|
284
276
|
- Whenever `activityList` is updated, **clone the whole array** to avoid direct mutation
|
|
285
|
-
- The old `noRedActivity` type allowlist **no longer exists**; today every activity type is treated the same
|
|
286
277
|
|
|
287
278
|
**Activity polling**: base interval `tick * 10 = 20 seconds`; **polling pauses while in a game (`isPlaying === true`)**. Fetching promotions additionally requires `hasToken`.
|
|
288
279
|
|
|
@@ -314,9 +305,10 @@ io(`${socketURL}/frontend`, {
|
|
|
314
305
|
|
|
315
306
|
### 2.7 Configuration & Live Info (Common Machine)
|
|
316
307
|
|
|
317
|
-
**
|
|
308
|
+
**4 parallel sub-machines**: `config` (siteConfig + layoutConfig, event-triggered), `feed` (feeds + mailbox + promotions, 20-second polling), `getAnnouncements` (event-triggered), and `broadcast` (switching every 5 seconds).
|
|
318
309
|
|
|
319
310
|
- **siteConfig decoding**: the response is an encoded string; the `setConfig` action base64-decodes it to obtain the actual configuration (`loginMethods`, `paymentMethods`, `csChat`, etc.). **The downstream frontends' stores do not decode it a second time.**
|
|
311
|
+
- **Broadcast rotation**: `picking` (5s) → `display` (5s) → `picking`, selecting `type === '0'` entries from `broadcastList`; already-shown items are added to `sentNormalBroadcastList` and not repeated
|
|
320
312
|
- **Mailbox filtering**: if `customerMessageEnable === false`, the count of CUSTOMER-type messages is deducted from the mailbox total
|
|
321
313
|
|
|
322
314
|
### 2.8 API Request Lifecycle
|
|
@@ -361,19 +353,19 @@ io(`${socketURL}/frontend`, {
|
|
|
361
353
|
|
|
362
354
|
> Every item below exists in the code in **two competing forms** — exploring the code cannot tell you which one is the standard, so it must be written down explicitly. New code always follows the "Target" column; existing code is not proactively refactored en masse (scope discipline).
|
|
363
355
|
|
|
364
|
-
| Item | Current state
|
|
365
|
-
| ------------------------- |
|
|
366
|
-
| HTTP method casing | `'GET'` and `'get'` coexist (`request.js` calls `toUpperCase()` internally, so behavior is unaffected)
|
|
367
|
-
| Import paths | Some files self-reference via the `@jetthai/cuora` package name
|
|
368
|
-
| lodash extension | `'lodash/pickBy.js'` and `'lodash/pickBy'` coexist
|
|
369
|
-
| URL leading slash | A few APIs carry a leading slash
|
|
370
|
-
| Query parameter placement | A few write them straight into the URL (`register?${qs}`, `mail?include=cl`), bypassing serialization
|
|
371
|
-
| Initial state naming | `idle`
|
|
372
|
-
| Magic numbers and strings | Activity type IDs, error codes, TTLs, polling ticks, `'DEPOSIT'`/`'WITHDRAW'`, `receiveStatus`, `connectStatus` are scattered around
|
|
373
|
-
| Error handling | Three forms coexist: silent fallback to `idle` (most common, loses error info), transition to `fail`, infinite retry
|
|
374
|
-
| Parameter naming | e.g. `
|
|
375
|
-
| Parameter validation | The API layer has no validation at all (e.g.
|
|
376
|
-
| Deprecated APIs |
|
|
356
|
+
| Item | Current state | Target |
|
|
357
|
+
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
358
|
+
| HTTP method casing | `'GET'` and `'get'` coexist (`request.js` calls `toUpperCase()` internally, so behavior is unaffected) | Consistently lowercase `'get'`/`'post'`/`'put'`/`'delete'` |
|
|
359
|
+
| Import paths | Some files self-reference via the `@jetthai/cuora` package name | Consistently relative paths (`'../../api/payment.js'`) |
|
|
360
|
+
| lodash extension | `'lodash/pickBy.js'` and `'lodash/pickBy'` coexist | Consistently **without** the extension |
|
|
361
|
+
| URL leading slash | A few APIs carry a leading slash | Omit it (unless deliberately bypassing `url-join`, in which case comment the reason) |
|
|
362
|
+
| Query parameter placement | A few write them straight into the URL (`register?${qs}`, `mail?include=cl`), bypassing serialization | Always use the `params` field |
|
|
363
|
+
| Initial state naming | `idle` / `loading` / `fetching` / `init` / `preparing` are used interchangeably | By semantics: `idle` (awaiting action), `loading` (initial load), `fetching` (re-fetch), `submitting` / `submitted` |
|
|
364
|
+
| Magic numbers and strings | Activity type IDs, error codes, TTLs, polling ticks, `'DEPOSIT'`/`'WITHDRAW'`, `receiveStatus`, `connectStatus` are scattered around | Centralize in `util/constant.js` (`ERROR_CODES` / `TTL` / `INTERVAL` / `TRANSFER_TYPE` / `RECEIVE_STATUS`) |
|
|
365
|
+
| Error handling | Three forms coexist: silent fallback to `idle` (most common, loses error info), transition to `fail`, infinite retry | `onError` with `actions: 'setError'` to preserve the error in context; distinguish recoverable from unrecoverable; retries must have a cap |
|
|
366
|
+
| Parameter naming | e.g. `addFavoriteGame(code)` is semantically unclear | Concrete names (`gameCode`) |
|
|
367
|
+
| Parameter validation | The API layer has no validation at all (e.g. `makeTransaction({ paymentMethod })` injects straight into the URL) | Validate at the system boundary: path parameters non-undefined and free of path-traversal characters, amounts positive |
|
|
368
|
+
| Deprecated APIs | In `api/user.js`, V1 `passwordRecovery` coexists with the V2 `passwordV2*` family, with V1 unmarked | Add `@deprecated` first, then remove once confirmed unreferenced |
|
|
377
369
|
|
|
378
370
|
---
|
|
379
371
|
|
|
@@ -385,11 +377,12 @@ io(`${socketURL}/frontend`, {
|
|
|
385
377
|
- **No request caching** — high-frequency endpoints (`fetchUserInfo` every 2–10 seconds, `getConfig` on every state machine initialization, `getPaymentDetail` on every entry to a deposit/withdrawal page, `getActivityList` every 20 seconds) all hit the server directly. Consider TTL caching or `stale-while-revalidate`.
|
|
386
378
|
- **No rate limiting or backoff** — polling runs at a fixed interval and does not change on errors. Consider exponential backoff on errors.
|
|
387
379
|
- **No automatic token refresh** — the response interceptor in `request.js` does not handle 401, so an expired token simply fails.
|
|
380
|
+
- **FingerprintJS bundling** — the FingerprintJS embedded in `src/lib/` is loaded at module initialization even when disabled. Consider switching to a dynamic `import()` for lazy loading.
|
|
388
381
|
- **No code splitting** — `machine/index.js` eagerly imports every state machine + the APIs + Socket.IO + lodash, so importing `machine` loads everything. Consider supporting individual imports to enable tree-shaking.
|
|
389
|
-
- **Timer management** — countdowns are largely implemented with self-referencing `after: { 1000 }` transitions
|
|
390
|
-
- **Large state machine files** — `game_v2_1.js
|
|
382
|
+
- **Timer management** — countdowns are largely implemented with self-referencing `after: { 1000 }` transitions, producing one state transition per second (including a context clone + event dispatch). Consider a callback service + `setInterval`, and **compute elapsed time** rather than decrementing step by step to avoid cumulative drift.
|
|
383
|
+
- **Large state machine files** — `game_v2_1.js`, `auth.js`, `withdraw_manual.js`, `inbox.js`, `manual_vn.js`, `common.js`, and `game_search_v2.js` all exceed 300 lines and could be split into composable sub-machines.
|
|
391
384
|
- **Unused context fields** — several state machines declare context fields that are never assigned or read.
|
|
392
|
-
- **lodash
|
|
385
|
+
- **lodash can be replaced with natives** — only a handful of functions are actually used; `padStart` / `toNumber` can be swapped for natives directly, and `findLastIndex` is supported in modern browsers.
|
|
393
386
|
|
|
394
387
|
---
|
|
395
388
|
|