@jetthai/cuora 1.1.483-dev.4 → 1.1.483
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 +10 -19
- package/.husky/post-checkout +3 -3
- package/.husky/pre-push +1 -1
- package/.prettierignore +1 -2
- package/AGENTS.md +10 -19
- package/AI_PROMPT_SOURCE.md +10 -19
- package/CHANGELOG.md +23 -346
- package/CLAUDE.md +10 -19
- package/GEMINI.md +10 -19
- package/package.json +1 -1
- package/scripts/auto-version.js +0 -1
- package/scripts/branch-auto-npm-publish.js +2 -9
- package/src/api/payment.js +0 -1
- package/src/machine/auth_otp_v3.js +20 -59
- package/src/machine/honor_board_cash.js +18 -15
- package/src/machine/reward_cash.js +2 -2
- package/src/machine/user_sign_up.js +0 -3
- package/src/util/constant.js +0 -4
- package/test/auth_otp_v3.test.js +0 -323
package/CHANGELOG.md
CHANGED
|
@@ -2,107 +2,52 @@
|
|
|
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.483-dev.4](https://github.com/jetthai/cuora-module/compare/v1.1.483-dev.2...v1.1.483-dev.4) (2026-11-16)
|
|
6
|
-
|
|
7
|
-
### [1.1.483-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.483-dev.1...v1.1.483-dev.2) (2026-11-13)
|
|
8
|
-
|
|
9
5
|
### [1.1.483](https://github.com/jetthai/cuora-module/compare/v1.1.482...v1.1.483) (2026-11-09)
|
|
10
6
|
|
|
11
|
-
### [1.1.482](https://github.com/jetthai/cuora-module/compare/v1.1.481
|
|
12
|
-
|
|
7
|
+
### [1.1.482](https://github.com/jetthai/cuora-module/compare/v1.1.481...v1.1.482) (2026-11-02)
|
|
13
8
|
|
|
14
9
|
### Bug Fixes
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### [1.1.483-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.483-dev.0...v1.1.483-dev.1) (2026-11-12)
|
|
19
|
-
|
|
20
|
-
### [1.1.483-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.481-dev.1...v1.1.483-dev.0) (2026-11-11)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### Bug Fixes
|
|
24
|
-
|
|
25
|
-
* **otp:** confirm auto verification from user status ([6adee39](https://github.com/jetthai/cuora-module/commit/6adee399a61ec5ac81c89a30036f89b222cf3920))
|
|
26
|
-
* **otp:** require contact data before provider completion ([03b2ee3](https://github.com/jetthai/cuora-module/commit/03b2ee306b4380103133d3709892341aca7db393))
|
|
27
|
-
|
|
28
|
-
### [1.1.481-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.481-dev.0...v1.1.481-dev.1) (2026-10-28)
|
|
29
|
-
|
|
30
|
-
### [1.1.481-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.481...v1.1.481-dev.0) (2026-10-28)
|
|
31
|
-
|
|
32
|
-
### [1.1.477-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.477...v1.1.477-dev.1) (2026-10-16)
|
|
11
|
+
- **activity:** getRewardList 參數 orderColum 修正為 orderColumn ([4bcecf8](https://github.com/jetthai/cuora-module/commit/4bcecf843f36c32fc57d909619c437c709131d88))
|
|
33
12
|
|
|
13
|
+
### [1.1.481](https://github.com/jetthai/cuora-module/compare/v1.1.480...v1.1.481) (2026-10-20)
|
|
34
14
|
|
|
35
15
|
### ⚠ BREAKING CHANGES
|
|
36
16
|
|
|
37
|
-
|
|
38
|
-
BIND_BANK_DONE 或 BIND_BANK_SKIP,否則會停在此關卡。目前僅 client-pwa-cash 使用本套件。
|
|
17
|
+
- 下游在 OTP 關卡送出 OTP_VERIFIED / OTP_SKIP 後,必須在 bindBankChecking 送出
|
|
18
|
+
BIND_BANK_DONE 或 BIND_BANK_SKIP,否則會停在此關卡。目前僅 client-pwa-cash 使用本套件。
|
|
39
19
|
|
|
40
20
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
41
21
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
|
|
45
|
-
* **payment:** 恢復 setBonusSetting API ([ba1118d](https://github.com/jetthai/cuora-module/commit/ba1118dabbdd6ae5ca2b68ddf281c8dd6d67a59d))
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
### Bug Fixes
|
|
49
|
-
|
|
50
|
-
* **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
51
|
-
* **otp:** confirm auto verification from user status ([b3b40d8](https://github.com/jetthai/cuora-module/commit/b3b40d8dd42d438486a2110f85564ab3d839ea72))
|
|
52
|
-
* **otp:** require contact data before provider completion ([f70058b](https://github.com/jetthai/cuora-module/commit/f70058b6bcbbc6d048049326700a79249d043a03))
|
|
53
|
-
* **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
|
|
54
|
-
* **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
55
|
-
* **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
56
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
* [JT-1784011020] feat(auth): 新增 bindBankChecking 關卡,綁銀行完成前不進入 loginSuccess ([2b26e99](https://github.com/jetthai/cuora-module/commit/2b26e99eba3d37e8f954724b53da8ee3f75bec18))
|
|
60
|
-
|
|
61
|
-
### [1.1.477-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.477-dev.0...v1.1.477-dev.1) (2026-10-16)
|
|
62
|
-
|
|
63
|
-
### [1.1.477-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.477...v1.1.477-dev.0) (2026-10-16)
|
|
64
|
-
|
|
65
|
-
### [1.1.476-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.476...v1.1.476-dev.1) (2026-10-14)
|
|
22
|
+
- [JT-1784011020] feat(auth): 新增 bindBankChecking 關卡,綁銀行完成前不進入 loginSuccess ([c9b5210](https://github.com/jetthai/cuora-module/commit/c9b5210b8f1abb9adca7c79207e89d66191daf8f))
|
|
66
23
|
|
|
24
|
+
### [1.1.480](https://github.com/jetthai/cuora-module/compare/v1.1.479...v1.1.480) (2026-10-19)
|
|
67
25
|
|
|
68
26
|
### ⚠ BREAKING CHANGES
|
|
69
27
|
|
|
70
|
-
|
|
71
|
-
BIND_BANK_DONE 或 BIND_BANK_SKIP,否則會停在此關卡。目前僅 client-pwa-cash 使用本套件。
|
|
72
|
-
|
|
73
|
-
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
74
|
-
* **export:** 移除頂層 export util 與 Request.sourceUpdate/sourceGenerate
|
|
28
|
+
- **export:** 移除頂層 export util 與 Request.sourceUpdate/sourceGenerate
|
|
75
29
|
|
|
76
30
|
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
77
|
-
* **api,machine:** 移除 39 個 api 方法、2 個常數與 14 個 machine 事件
|
|
78
31
|
|
|
79
|
-
|
|
80
|
-
* **machine:** 移除公開 export machine.bonus、machine.vip_table 與 util 的 max
|
|
32
|
+
- **api,machine:** 移除 39 個 api 方法、2 個常數與 14 個 machine 事件
|
|
81
33
|
|
|
82
34
|
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
83
35
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
* **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
|
|
87
|
-
* **payment:** 恢復 setBonusSetting API ([ba1118d](https://github.com/jetthai/cuora-module/commit/ba1118dabbdd6ae5ca2b68ddf281c8dd6d67a59d))
|
|
36
|
+
- **machine:** 移除公開 export machine.bonus、machine.vip_table 與 util 的 max
|
|
88
37
|
|
|
38
|
+
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
89
39
|
|
|
90
40
|
### Bug Fixes
|
|
91
41
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
* **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
98
|
-
* **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
99
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
42
|
+
- **machine:** 移除三處幽靈 action 引用 ([49009da](https://github.com/jetthai/cuora-module/commit/49009dae604088b819134e0d40f7719fb8e8874d))
|
|
43
|
+
|
|
44
|
+
- **api,machine:** 移除 39 個零呼叫端 API 與 14 個無觸發來源的 machine 事件 ([14fa754](https://github.com/jetthai/cuora-module/commit/14fa75459aba9558cde1a3485d64cbdf2f8294b2))
|
|
45
|
+
- **export:** 移除四個無消費者的對外符號 ([55afe6f](https://github.com/jetthai/cuora-module/commit/55afe6fbfadca8944dd9820d6333ee5b93e0ed25))
|
|
46
|
+
- **machine:** 移除 client-pwa-cash 未使用的 bonus、vip_table 與 util/max ([f49977b](https://github.com/jetthai/cuora-module/commit/f49977bfd480d961f5dc37435b3c60447eb198c0))
|
|
100
47
|
|
|
48
|
+
### [1.1.479](https://github.com/jetthai/cuora-module/compare/v1.1.478...v1.1.479) (2026-10-19)
|
|
101
49
|
|
|
102
|
-
|
|
103
|
-
* **api,machine:** 移除 39 個零呼叫端 API 與 14 個無觸發來源的 machine 事件 ([14fa754](https://github.com/jetthai/cuora-module/commit/14fa75459aba9558cde1a3485d64cbdf2f8294b2))
|
|
104
|
-
* **export:** 移除四個無消費者的對外符號 ([55afe6f](https://github.com/jetthai/cuora-module/commit/55afe6fbfadca8944dd9820d6333ee5b93e0ed25))
|
|
105
|
-
* **machine:** 移除 client-pwa-cash 未使用的 bonus、vip_table 與 util/max ([f49977b](https://github.com/jetthai/cuora-module/commit/f49977bfd480d961f5dc37435b3c60447eb198c0))
|
|
50
|
+
### [1.1.478](https://github.com/jetthai/cuora-module/compare/v1.1.477...v1.1.478) (2026-10-16)
|
|
106
51
|
|
|
107
52
|
### [1.1.477](https://github.com/jetthai/cuora-module/compare/v1.1.476...v1.1.477) (2026-10-16)
|
|
108
53
|
|
|
@@ -110,69 +55,6 @@ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
|
110
55
|
|
|
111
56
|
- **activity:** activity_cash 明細略過(resolve null)時 setProgressSummary 不再拋錯卡死 machine ([67cd813](https://github.com/jetthai/cuora-module/commit/67cd8137f1cbb310d43d02c068ed0a896e2c6623))
|
|
112
57
|
|
|
113
|
-
### [1.1.476-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.476-dev.0...v1.1.476-dev.1) (2026-10-14)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
### Bug Fixes
|
|
117
|
-
|
|
118
|
-
* **activity:** activity_cash 明細略過(resolve null)時 setProgressSummary 不再拋錯卡死 machine ([67cd813](https://github.com/jetthai/cuora-module/commit/67cd8137f1cbb310d43d02c068ed0a896e2c6623))
|
|
119
|
-
|
|
120
|
-
### [1.1.476](https://github.com/jetthai/cuora-module/compare/v1.1.475...v1.1.476) (2026-10-13)
|
|
121
|
-
|
|
122
|
-
### [1.1.475](https://github.com/jetthai/cuora-module/compare/v1.1.473...v1.1.475) (2026-10-12)
|
|
123
|
-
|
|
124
|
-
### [1.1.476-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.473-dev.0...v1.1.476-dev.0) (2026-10-13)
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
### ⚠ BREAKING CHANGES
|
|
128
|
-
|
|
129
|
-
* 下游在 OTP 關卡送出 OTP_VERIFIED / OTP_SKIP 後,必須在 bindBankChecking 送出
|
|
130
|
-
BIND_BANK_DONE 或 BIND_BANK_SKIP,否則會停在此關卡。目前僅 client-pwa-cash 使用本套件。
|
|
131
|
-
|
|
132
|
-
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
133
|
-
|
|
134
|
-
* [JT-1784011020] feat(auth): 新增 bindBankChecking 關卡,綁銀行完成前不進入 loginSuccess ([2b26e99](https://github.com/jetthai/cuora-module/commit/2b26e99eba3d37e8f954724b53da8ee3f75bec18))
|
|
135
|
-
|
|
136
|
-
### [1.1.473-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.473...v1.1.473-dev.0) (2026-10-07)
|
|
137
|
-
|
|
138
|
-
### [1.1.472-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.472...v1.1.472-dev.2) (2026-10-01)
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
### ⚠ BREAKING CHANGES
|
|
142
|
-
|
|
143
|
-
* **export:** 移除頂層 export util 與 Request.sourceUpdate/sourceGenerate
|
|
144
|
-
|
|
145
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
146
|
-
* **api,machine:** 移除 39 個 api 方法、2 個常數與 14 個 machine 事件
|
|
147
|
-
|
|
148
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
149
|
-
* **machine:** 移除公開 export machine.bonus、machine.vip_table 與 util 的 max
|
|
150
|
-
|
|
151
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
152
|
-
|
|
153
|
-
### Features
|
|
154
|
-
|
|
155
|
-
* **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
|
|
156
|
-
* **payment:** 恢復 setBonusSetting API ([ba1118d](https://github.com/jetthai/cuora-module/commit/ba1118dabbdd6ae5ca2b68ddf281c8dd6d67a59d))
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
### Bug Fixes
|
|
160
|
-
|
|
161
|
-
* **activity:** activity_cash 列表與明細回應格式異常時改走 onError,避免 machine 卡死 ([fea8494](https://github.com/jetthai/cuora-module/commit/fea8494d8c0ff084f8994cb58b8f1f7e3800024a))
|
|
162
|
-
* **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
163
|
-
* **machine:** 移除三處幽靈 action 引用 ([49009da](https://github.com/jetthai/cuora-module/commit/49009dae604088b819134e0d40f7719fb8e8874d))
|
|
164
|
-
* **otp:** confirm auto verification from user status ([b3b40d8](https://github.com/jetthai/cuora-module/commit/b3b40d8dd42d438486a2110f85564ab3d839ea72))
|
|
165
|
-
* **otp:** require contact data before provider completion ([f70058b](https://github.com/jetthai/cuora-module/commit/f70058b6bcbbc6d048049326700a79249d043a03))
|
|
166
|
-
* **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
|
|
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
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
* **api,machine:** 移除 39 個零呼叫端 API 與 14 個無觸發來源的 machine 事件 ([14fa754](https://github.com/jetthai/cuora-module/commit/14fa75459aba9558cde1a3485d64cbdf2f8294b2))
|
|
173
|
-
* **export:** 移除四個無消費者的對外符號 ([55afe6f](https://github.com/jetthai/cuora-module/commit/55afe6fbfadca8944dd9820d6333ee5b93e0ed25))
|
|
174
|
-
* **machine:** 移除 client-pwa-cash 未使用的 bonus、vip_table 與 util/max ([f49977b](https://github.com/jetthai/cuora-module/commit/f49977bfd480d961f5dc37435b3c60447eb198c0))
|
|
175
|
-
|
|
176
58
|
### [1.1.476](https://github.com/jetthai/cuora-module/compare/v1.1.475...v1.1.476) (2026-10-13)
|
|
177
59
|
|
|
178
60
|
### Bug Fixes
|
|
@@ -185,135 +67,27 @@ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
|
185
67
|
|
|
186
68
|
### [1.1.473](https://github.com/jetthai/cuora-module/compare/v1.1.472...v1.1.473) (2026-10-05)
|
|
187
69
|
|
|
188
|
-
### [1.1.472-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.472-dev.1...v1.1.472-dev.2) (2026-10-01)
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
### Bug Fixes
|
|
192
|
-
|
|
193
|
-
* **otp:** confirm auto verification from user status ([b3b40d8](https://github.com/jetthai/cuora-module/commit/b3b40d8dd42d438486a2110f85564ab3d839ea72))
|
|
194
|
-
* **otp:** require contact data before provider completion ([f70058b](https://github.com/jetthai/cuora-module/commit/f70058b6bcbbc6d048049326700a79249d043a03))
|
|
195
|
-
|
|
196
|
-
### [1.1.472-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.472-dev.0...v1.1.472-dev.1) (2026-10-01)
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
### Bug Fixes
|
|
200
|
-
|
|
201
|
-
* **activity:** activity_cash 列表與明細回應格式異常時改走 onError,避免 machine 卡死 ([fea8494](https://github.com/jetthai/cuora-module/commit/fea8494d8c0ff084f8994cb58b8f1f7e3800024a))
|
|
202
|
-
|
|
203
70
|
### [1.1.472](https://github.com/jetthai/cuora-module/compare/v1.1.471...v1.1.472) (2026-09-24)
|
|
204
71
|
|
|
205
72
|
### [1.1.471](https://github.com/jetthai/cuora-module/compare/v1.1.470...v1.1.471) (2026-09-23)
|
|
206
73
|
|
|
207
|
-
### [1.1.472-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.471-dev.1...v1.1.472-dev.0) (2026-09-29)
|
|
208
|
-
|
|
209
|
-
### [1.1.471-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.471-dev.0...v1.1.471-dev.1) (2026-09-24)
|
|
210
|
-
|
|
211
|
-
### [1.1.471-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.470-dev.2...v1.1.471-dev.0) (2026-09-23)
|
|
212
|
-
|
|
213
74
|
### [1.1.470](https://github.com/jetthai/cuora-module/compare/v1.1.469...v1.1.470) (2026-09-14)
|
|
214
75
|
|
|
215
|
-
### [1.1.469](https://github.com/jetthai/cuora-module/compare/v1.1.468...v1.1.469) (2026-09-13)
|
|
216
|
-
|
|
217
|
-
### [1.1.470-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.470-dev.1...v1.1.470-dev.2) (2026-09-17)
|
|
218
|
-
|
|
219
|
-
### [1.1.470-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.470-dev.0...v1.1.470-dev.1) (2026-09-17)
|
|
220
|
-
|
|
221
|
-
### Features
|
|
222
|
-
|
|
223
|
-
* **payment:** 恢復 setBonusSetting API ([ba1118d](https://github.com/jetthai/cuora-module/commit/ba1118dabbdd6ae5ca2b68ddf281c8dd6d67a59d))
|
|
224
|
-
|
|
225
|
-
### [1.1.470-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.468-dev.1...v1.1.470-dev.0) (2026-09-14)
|
|
226
|
-
|
|
227
|
-
### [1.1.468-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.468-dev.0...v1.1.468-dev.1) (2026-09-13)
|
|
228
|
-
|
|
229
|
-
### [1.1.468-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.468...v1.1.468-dev.0) (2026-09-12)
|
|
230
|
-
|
|
231
|
-
### [1.1.467-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.467...v1.1.467-dev.2) (2026-09-10)
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
### ⚠ BREAKING CHANGES
|
|
235
|
-
|
|
236
|
-
* **export:** 移除頂層 export util 與 Request.sourceUpdate/sourceGenerate
|
|
237
|
-
|
|
238
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
239
|
-
* **api,machine:** 移除 39 個 api 方法、2 個常數與 14 個 machine 事件
|
|
240
|
-
|
|
241
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
242
|
-
* **machine:** 移除公開 export machine.bonus、machine.vip_table 與 util 的 max
|
|
243
|
-
|
|
244
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
245
|
-
|
|
246
|
-
### Features
|
|
247
|
-
|
|
248
|
-
* **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
### Bug Fixes
|
|
252
|
-
|
|
253
|
-
* **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
|
|
254
|
-
* **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
255
|
-
* **machine:** user_sign_up 的 registrationData 補上 agentId ([833e8c9](https://github.com/jetthai/cuora-module/commit/833e8c90c0ff554cff651bdb7045ed514d42035e))
|
|
256
|
-
* **machine:** 移除三處幽靈 action 引用 ([49009da](https://github.com/jetthai/cuora-module/commit/49009dae604088b819134e0d40f7719fb8e8874d))
|
|
257
|
-
* **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
|
|
258
|
-
* **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
259
|
-
* **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
260
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
* **api,machine:** 移除 39 個零呼叫端 API 與 14 個無觸發來源的 machine 事件 ([14fa754](https://github.com/jetthai/cuora-module/commit/14fa75459aba9558cde1a3485d64cbdf2f8294b2))
|
|
264
|
-
* **export:** 移除四個無消費者的對外符號 ([55afe6f](https://github.com/jetthai/cuora-module/commit/55afe6fbfadca8944dd9820d6333ee5b93e0ed25))
|
|
265
|
-
* **machine:** 移除 client-pwa-cash 未使用的 bonus、vip_table 與 util/max ([f49977b](https://github.com/jetthai/cuora-module/commit/f49977bfd480d961f5dc37435b3c60447eb198c0))
|
|
266
|
-
|
|
267
|
-
### [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)
|
|
268
|
-
|
|
269
|
-
|
|
270
76
|
### Bug Fixes
|
|
271
77
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
### [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)
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
### ⚠ BREAKING CHANGES
|
|
278
|
-
|
|
279
|
-
* **export:** 移除頂層 export util 與 Request.sourceUpdate/sourceGenerate
|
|
280
|
-
|
|
281
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
282
|
-
* **api,machine:** 移除 39 個 api 方法、2 個常數與 14 個 machine 事件
|
|
283
|
-
|
|
284
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
285
|
-
* **machine:** 移除公開 export machine.bonus、machine.vip_table 與 util 的 max
|
|
78
|
+
- **machine:** user_sign_up 的 registrationData 補上 agentId ([833e8c9](https://github.com/jetthai/cuora-module/commit/833e8c90c0ff554cff651bdb7045ed514d42035e))
|
|
286
79
|
|
|
287
|
-
|
|
80
|
+
### [1.1.469](https://github.com/jetthai/cuora-module/compare/v1.1.468...v1.1.469) (2026-09-13)
|
|
288
81
|
|
|
289
82
|
### Bug Fixes
|
|
290
83
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
* **api,machine:** 移除 39 個零呼叫端 API 與 14 個無觸發來源的 machine 事件 ([14fa754](https://github.com/jetthai/cuora-module/commit/14fa75459aba9558cde1a3485d64cbdf2f8294b2))
|
|
295
|
-
* **export:** 移除四個無消費者的對外符號 ([55afe6f](https://github.com/jetthai/cuora-module/commit/55afe6fbfadca8944dd9820d6333ee5b93e0ed25))
|
|
296
|
-
* **machine:** 移除 client-pwa-cash 未使用的 bonus、vip_table 與 util/max ([f49977b](https://github.com/jetthai/cuora-module/commit/f49977bfd480d961f5dc37435b3c60447eb198c0))
|
|
297
|
-
|
|
298
|
-
### [1.1.467-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.467...v1.1.467-dev.0) (2026-09-09)
|
|
299
|
-
|
|
300
|
-
### [1.1.466-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.466...v1.1.466-dev.0) (2026-09-06)
|
|
84
|
+
- **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
|
|
301
85
|
|
|
86
|
+
### [1.1.468](https://github.com/jetthai/cuora-module/compare/v1.1.467...v1.1.468) (2026-09-11)
|
|
302
87
|
|
|
303
88
|
### Features
|
|
304
89
|
|
|
305
|
-
|
|
306
|
-
* **payment:** 新增 getPaymentPromotions API 描述符 ([0319692](https://github.com/jetthai/cuora-module/commit/03196925d989333e4bdb11cd933c18b6ace65d83))
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
### Bug Fixes
|
|
310
|
-
|
|
311
|
-
* **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
|
|
312
|
-
* **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
313
|
-
* **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
|
|
314
|
-
* **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
315
|
-
* **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
316
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
90
|
+
- **payment:** 新增 getPaymentPromotions API 描述符 ([0319692](https://github.com/jetthai/cuora-module/commit/03196925d989333e4bdb11cd933c18b6ace65d83))
|
|
317
91
|
|
|
318
92
|
### [1.1.467](https://github.com/jetthai/cuora-module/compare/v1.1.466...v1.1.467) (2026-09-06)
|
|
319
93
|
|
|
@@ -323,74 +97,15 @@ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
|
323
97
|
|
|
324
98
|
### [1.1.466](https://github.com/jetthai/cuora-module/compare/v1.1.465...v1.1.466) (2026-08-31)
|
|
325
99
|
|
|
326
|
-
### [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)
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
### Bug Fixes
|
|
330
|
-
|
|
331
|
-
* **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
|
|
332
|
-
|
|
333
|
-
### [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)
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
### Bug Fixes
|
|
337
|
-
|
|
338
|
-
* **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
|
|
339
|
-
|
|
340
|
-
### [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)
|
|
341
|
-
|
|
342
|
-
### [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)
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
### Features
|
|
346
|
-
|
|
347
|
-
* **payment:** 新增 getPaymentPromotions API 描述符 ([0319692](https://github.com/jetthai/cuora-module/commit/03196925d989333e4bdb11cd933c18b6ace65d83))
|
|
348
|
-
|
|
349
|
-
### [1.1.465](https://github.com/jetthai/cuora-module/compare/v1.1.464...v1.1.465) (2026-08-17)
|
|
350
|
-
|
|
351
|
-
### [1.1.464](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.464) (2026-08-16)
|
|
352
|
-
|
|
353
|
-
### [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)
|
|
354
|
-
|
|
355
100
|
### [1.1.465](https://github.com/jetthai/cuora-module/compare/v1.1.464...v1.1.465) (2026-08-17)
|
|
356
101
|
|
|
357
|
-
### [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)
|
|
358
|
-
|
|
359
102
|
### [1.1.464](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.464) (2026-08-16)
|
|
360
103
|
|
|
361
|
-
|
|
362
104
|
### Bug Fixes
|
|
363
105
|
|
|
364
106
|
- **deposit:** 切換存款活動不再重設使用者已選的通道 ([b9c1de2](https://github.com/jetthai/cuora-module/commit/b9c1de2f3665c56f52d7b074e892837e836d02fa))
|
|
365
107
|
- **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
|
|
366
108
|
|
|
367
|
-
### [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)
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
### Bug Fixes
|
|
371
|
-
|
|
372
|
-
* **deposit:** 切換存款活動不再重設使用者已選的通道 ([b9c1de2](https://github.com/jetthai/cuora-module/commit/b9c1de2f3665c56f52d7b074e892837e836d02fa))
|
|
373
|
-
|
|
374
|
-
### [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)
|
|
375
|
-
|
|
376
|
-
### [1.1.463-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.463-dev.0) (2026-08-13)
|
|
377
|
-
|
|
378
|
-
### [1.1.455-dev.8](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.455-dev.8) (2026-08-09)
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
### Features
|
|
382
|
-
|
|
383
|
-
* **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
### Bug Fixes
|
|
387
|
-
|
|
388
|
-
* **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
389
|
-
* **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
390
|
-
* **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
391
|
-
* **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
|
|
392
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
393
|
-
|
|
394
109
|
### [1.1.463](https://github.com/jetthai/cuora-module/compare/v1.1.462...v1.1.463) (2026-08-12)
|
|
395
110
|
|
|
396
111
|
### [1.1.462](https://github.com/jetthai/cuora-module/compare/v1.1.461...v1.1.462) (2026-08-10)
|
|
@@ -407,44 +122,6 @@ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
|
407
122
|
|
|
408
123
|
### [1.1.456](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.456) (2026-08-09)
|
|
409
124
|
|
|
410
|
-
### [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)
|
|
411
|
-
|
|
412
|
-
### [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)
|
|
413
|
-
|
|
414
|
-
### [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)
|
|
415
|
-
|
|
416
|
-
### [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)
|
|
417
|
-
|
|
418
|
-
### [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)
|
|
419
|
-
|
|
420
|
-
### [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)
|
|
421
|
-
|
|
422
|
-
### [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)
|
|
423
|
-
|
|
424
|
-
### [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)
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
### Bug Fixes
|
|
428
|
-
|
|
429
|
-
- **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
|
|
430
|
-
|
|
431
|
-
### [1.1.455-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.455-dev.0) (2026-08-04)
|
|
432
|
-
|
|
433
|
-
### [1.1.454-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.453...v1.1.454-dev.0) (2026-07-29)
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
### Features
|
|
437
|
-
|
|
438
|
-
- **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
### Bug Fixes
|
|
442
|
-
|
|
443
|
-
- **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
444
|
-
- **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
445
|
-
- **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
446
|
-
- **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
447
|
-
|
|
448
125
|
### [1.1.455](https://github.com/jetthai/cuora-module/compare/v1.1.453...v1.1.455) (2026-08-03)
|
|
449
126
|
|
|
450
127
|
### Bug Fixes
|
package/CLAUDE.md
CHANGED
|
@@ -148,7 +148,7 @@ State machines **do not directly reference each other**; they communicate indire
|
|
|
148
148
|
| `ERR_F106` | OTP verification failed |
|
|
149
149
|
| `ERR_G106` | Insufficient balance (→ deposit state) |
|
|
150
150
|
| `ERR_G124` / `ERR_G125` | Free game settlement / forfeit |
|
|
151
|
-
| `ERR_800` | Cancelled request (
|
|
151
|
+
| `ERR_800` | Cancelled request (handled silently) |
|
|
152
152
|
| `ERR_998` | Network error / 404 (reported to Sentry) |
|
|
153
153
|
|
|
154
154
|
When `error.extend` contains `unfinished_` → unfinished game; the gameCode is everything after the first underscore, taken via `error.extend.split(/_(.+)/)[1]`.
|
|
@@ -172,13 +172,6 @@ Token 5min TTL → fetchUserInfo success → extendToken resets TTL → poll aga
|
|
|
172
172
|
- **Injection**: the request interceptor automatically adds `Authorization: Bearer {token}`
|
|
173
173
|
- **TTL**: token 300 seconds, account info 31 days, cookie data 7 days
|
|
174
174
|
|
|
175
|
-
**Token revocation & foreground gate** (`request.js`): `revokeToken(token)` and `beginTokenGate(promise, timeoutMs = 3000)` are public `Request` methods with **no caller inside this package** — the downstream frontends call them on logout-class errors and when the app returns to the foreground; changing their signatures or semantics is a public-interface change.
|
|
176
|
-
|
|
177
|
-
- **Only the current identity can be revoked**: `revokeToken` only takes effect when `token === getToken()`, so a late error from a previous identity cannot revoke a newly logged-in token. Once in effect, it cancels in-flight requests carrying that token (for the scope, see item 11 of 2.9), and any later non-public `send()` still carrying it rejects `ERR_800` immediately without hitting the network; public requests are unaffected (the token stays in storage while revoked, and `getConfig` around autoLogin must not be wrongly rejected). There is no "un-revoke" API — logging in again changes the token, which lifts the revocation naturally.
|
|
178
|
-
- **The token to revoke comes from the error object**: when a token-carrying request fails, `send()` attaches a **non-enumerable** `error.requestToken` (the Bearer token at send time). It is non-enumerable so it doesn't leak through `JSON.stringify` / Sentry serialization — **never make it enumerable, and never copy it into enumerable fields, logs, or Sentry extra**. Cancellation `ERR_800` errors and the missing-token `ERR_A103` don't carry this field.
|
|
179
|
-
- **While a gate is active**: non-public requests first wait for the probe promise to settle (success and failure both release it) or for the timeout; once released, they re-check whether the token has been revoked and whether it still exists (missing → `ERR_A103`).
|
|
180
|
-
- **Hard-coded `'self'` coupling**: `send()` decides which request skips the gate by checking whether the descriptor's raw `url` (query stripped, before V2 conversion) is `'self'`, which corresponds to `getUserInfo` in `api/user.js` (`updateUserInfo`, sharing the same url, skips it too). Changing `getUserInfo`'s url (adding a leading slash, changing the path) requires updating this check in lockstep, otherwise `/self` gets blocked by the gate as well — a probe sent after the gate is created would then wait on its own gate until the timeout.
|
|
181
|
-
|
|
182
175
|
**inline vs login states** (the most central concept in `auth.js`):
|
|
183
176
|
|
|
184
177
|
- `inline`: authenticated but `rank < 0` (the account has not finished ranking/activation); polling continues until rank takes effect
|
|
@@ -334,20 +327,19 @@ io(`${socketURL}/frontend`, {
|
|
|
334
327
|
```
|
|
335
328
|
1. A state machine service calls request.send(api.xxx(params))
|
|
336
329
|
2. api.xxx(params) returns a descriptor object
|
|
337
|
-
3.
|
|
338
|
-
4.
|
|
330
|
+
3. _checkToken(req): non-public endpoints check the token; if missing, throw ERR_A103
|
|
331
|
+
4. isBlocked check: under maintenance and not a config request → silently blocked
|
|
339
332
|
5. _createConfig(req):
|
|
340
333
|
a. Strip the query string from the URL
|
|
341
334
|
b. Match against supportVersion2List (supports :param dynamic-path regex matching)
|
|
342
335
|
c. If matched → _convertUrlToKebabCase() (look up the specifyingPath mapping first, otherwise auto-convert)
|
|
343
336
|
d. GET → params goes in the params field; POST → params goes in the data field
|
|
344
337
|
e. pickBy filters out null/undefined values
|
|
345
|
-
6.
|
|
346
|
-
7.
|
|
347
|
-
8.
|
|
348
|
-
9.
|
|
349
|
-
10.
|
|
350
|
-
11. Error handling (in order): cancellation → reject ERR_800 (never reaches errorHandler); token-carrying requests get a non-enumerable requestToken attached to the error; ERR_F108 → isBlocked + errorHandler; stale-identity error → thrown directly (see item 14 of 2.9); ERR_998 → thrown directly; everything else → errorHandler (skipped when the descriptor carries silent: true, still thrown); non-cancellation error whose code is already ERR_800 → resolves undefined
|
|
338
|
+
6. Request interceptor: injects X-TH1GAMES-VERSION, X-TH1GAMES-PLATFORM, Authorization
|
|
339
|
+
7. Custom paramsSerializer: special encoding for the q parameter (avoids double-encoding)
|
|
340
|
+
8. axios.request(config)
|
|
341
|
+
9. Response interceptor: response.data.error present → reject; Network Error / 404 → ERR_998 + Sentry
|
|
342
|
+
10. Error handling: ERR_F108 → isBlocked + errorHandler; ERR_998 → thrown directly; ERR_800 (cancelled) → silent; everything else → errorHandler (skipped when the descriptor carries silent: true, still thrown)
|
|
351
343
|
```
|
|
352
344
|
|
|
353
345
|
**V1→V2 conversion**: `supportVersion2List` supports dynamic paths (e.g. `payment/v2/:paymentType/transaction`, where `:param` is replaced by `[^/]+`); special paths are hard-coded in `specifyingPath`, and the rest are auto-converted via `/([a-z])([A-Z])/g`. **When adding an endpoint that needs V2 conversion, it must be added to the list manually.**
|
|
@@ -364,10 +356,9 @@ io(`${socketURL}/frontend`, {
|
|
|
364
356
|
8. **`appSecret` marks public endpoints**: nearly all `isPublic: true` endpoints require an `appSecret` parameter, **but the auth endpoints do not**.
|
|
365
357
|
9. **Unfinished-game infinite retry**: the `unfinishedGame` state in `error.js` returns to itself on `onError`, with **no backoff strategy and no retry cap** (a known issue, see "Known Technical Debt").
|
|
366
358
|
10. **`isMobile` is a string, not a boolean**: in `common.js`, `isMobile = userAgent?.device?.type` returns `'mobile'`/`'tablet'`/`undefined`, so comparisons must be string-based (e.g. `isMobile === 'mobile' ? 'y' : null`).
|
|
367
|
-
11. **
|
|
359
|
+
11. **Requests carry no CancelToken by default**: the cancellation feature of `send(req, customToken)` is **opt-in**. In axios <0.22 the cancel handler is never unsubscribed — a shared long-lived token accumulates one handler per request, causing overnight OOM when left running (TI-15555). **Do not "helpfully" add the CancelToken back onto the shared path.**
|
|
368
360
|
12. **`silent: true` only skips errorHandler**: the error is still thrown to the caller's `onError`, and `ERR_F108` is still routed as usual; but every other error code — **including logout-class codes such as `ERR_A104`, and `ERR_G106` insufficient balance** — never reaches the error machine. Use it only for background requests whose session invalidation is already covered by `fetchUserInfo` polling; never add it to user-initiated requests.
|
|
369
|
-
13. **`send()` does not guarantee an object, and `assign()` must never throw**: non-config requests during maintenance (`isBlocked`) and
|
|
370
|
-
14. **Late errors from a stale identity never reach errorHandler**: when the token a request was sent with differs from the current token (and a current token exists), the error is only thrown to the caller's `onError` and not forwarded to errorHandler — so a late logout-class error from an old session can't log out a newly logged-in identity. When there is no current token (TTL expired or already cleared), routing is unchanged so that `ERR_A204`-style popups aren't swallowed; the `ERR_F108` check comes before this one and still routes as usual.
|
|
361
|
+
13. **`send()` does not guarantee an object, and `assign()` must never throw**: non-config requests during maintenance (`isBlocked`) and `ERR_800` cancellations make `send()` **resolve `undefined`** (they never reach `onError`); a 200 response with a non-JSON body resolves a string, so destructuring `{ data }` yields `undefined`. When an `assign()` throws, XState v4 clears the event queue and the state is not updated — the machine stays in the current invoke state and `after`-based polling stops until an external event (e.g. `REFRESH`) moves it out. **Validate response shapes inside the service and `throw` there (reject → `onError`)**; every assign in `onDone` must handle every value the service can resolve, including deliberate `return null` early exits.
|
|
371
362
|
|
|
372
363
|
---
|
|
373
364
|
|
package/GEMINI.md
CHANGED
|
@@ -148,7 +148,7 @@ State machines **do not directly reference each other**; they communicate indire
|
|
|
148
148
|
| `ERR_F106` | OTP verification failed |
|
|
149
149
|
| `ERR_G106` | Insufficient balance (→ deposit state) |
|
|
150
150
|
| `ERR_G124` / `ERR_G125` | Free game settlement / forfeit |
|
|
151
|
-
| `ERR_800` | Cancelled request (
|
|
151
|
+
| `ERR_800` | Cancelled request (handled silently) |
|
|
152
152
|
| `ERR_998` | Network error / 404 (reported to Sentry) |
|
|
153
153
|
|
|
154
154
|
When `error.extend` contains `unfinished_` → unfinished game; the gameCode is everything after the first underscore, taken via `error.extend.split(/_(.+)/)[1]`.
|
|
@@ -172,13 +172,6 @@ Token 5min TTL → fetchUserInfo success → extendToken resets TTL → poll aga
|
|
|
172
172
|
- **Injection**: the request interceptor automatically adds `Authorization: Bearer {token}`
|
|
173
173
|
- **TTL**: token 300 seconds, account info 31 days, cookie data 7 days
|
|
174
174
|
|
|
175
|
-
**Token revocation & foreground gate** (`request.js`): `revokeToken(token)` and `beginTokenGate(promise, timeoutMs = 3000)` are public `Request` methods with **no caller inside this package** — the downstream frontends call them on logout-class errors and when the app returns to the foreground; changing their signatures or semantics is a public-interface change.
|
|
176
|
-
|
|
177
|
-
- **Only the current identity can be revoked**: `revokeToken` only takes effect when `token === getToken()`, so a late error from a previous identity cannot revoke a newly logged-in token. Once in effect, it cancels in-flight requests carrying that token (for the scope, see item 11 of 2.9), and any later non-public `send()` still carrying it rejects `ERR_800` immediately without hitting the network; public requests are unaffected (the token stays in storage while revoked, and `getConfig` around autoLogin must not be wrongly rejected). There is no "un-revoke" API — logging in again changes the token, which lifts the revocation naturally.
|
|
178
|
-
- **The token to revoke comes from the error object**: when a token-carrying request fails, `send()` attaches a **non-enumerable** `error.requestToken` (the Bearer token at send time). It is non-enumerable so it doesn't leak through `JSON.stringify` / Sentry serialization — **never make it enumerable, and never copy it into enumerable fields, logs, or Sentry extra**. Cancellation `ERR_800` errors and the missing-token `ERR_A103` don't carry this field.
|
|
179
|
-
- **While a gate is active**: non-public requests first wait for the probe promise to settle (success and failure both release it) or for the timeout; once released, they re-check whether the token has been revoked and whether it still exists (missing → `ERR_A103`).
|
|
180
|
-
- **Hard-coded `'self'` coupling**: `send()` decides which request skips the gate by checking whether the descriptor's raw `url` (query stripped, before V2 conversion) is `'self'`, which corresponds to `getUserInfo` in `api/user.js` (`updateUserInfo`, sharing the same url, skips it too). Changing `getUserInfo`'s url (adding a leading slash, changing the path) requires updating this check in lockstep, otherwise `/self` gets blocked by the gate as well — a probe sent after the gate is created would then wait on its own gate until the timeout.
|
|
181
|
-
|
|
182
175
|
**inline vs login states** (the most central concept in `auth.js`):
|
|
183
176
|
|
|
184
177
|
- `inline`: authenticated but `rank < 0` (the account has not finished ranking/activation); polling continues until rank takes effect
|
|
@@ -334,20 +327,19 @@ io(`${socketURL}/frontend`, {
|
|
|
334
327
|
```
|
|
335
328
|
1. A state machine service calls request.send(api.xxx(params))
|
|
336
329
|
2. api.xxx(params) returns a descriptor object
|
|
337
|
-
3.
|
|
338
|
-
4.
|
|
330
|
+
3. _checkToken(req): non-public endpoints check the token; if missing, throw ERR_A103
|
|
331
|
+
4. isBlocked check: under maintenance and not a config request → silently blocked
|
|
339
332
|
5. _createConfig(req):
|
|
340
333
|
a. Strip the query string from the URL
|
|
341
334
|
b. Match against supportVersion2List (supports :param dynamic-path regex matching)
|
|
342
335
|
c. If matched → _convertUrlToKebabCase() (look up the specifyingPath mapping first, otherwise auto-convert)
|
|
343
336
|
d. GET → params goes in the params field; POST → params goes in the data field
|
|
344
337
|
e. pickBy filters out null/undefined values
|
|
345
|
-
6.
|
|
346
|
-
7.
|
|
347
|
-
8.
|
|
348
|
-
9.
|
|
349
|
-
10.
|
|
350
|
-
11. Error handling (in order): cancellation → reject ERR_800 (never reaches errorHandler); token-carrying requests get a non-enumerable requestToken attached to the error; ERR_F108 → isBlocked + errorHandler; stale-identity error → thrown directly (see item 14 of 2.9); ERR_998 → thrown directly; everything else → errorHandler (skipped when the descriptor carries silent: true, still thrown); non-cancellation error whose code is already ERR_800 → resolves undefined
|
|
338
|
+
6. Request interceptor: injects X-TH1GAMES-VERSION, X-TH1GAMES-PLATFORM, Authorization
|
|
339
|
+
7. Custom paramsSerializer: special encoding for the q parameter (avoids double-encoding)
|
|
340
|
+
8. axios.request(config)
|
|
341
|
+
9. Response interceptor: response.data.error present → reject; Network Error / 404 → ERR_998 + Sentry
|
|
342
|
+
10. Error handling: ERR_F108 → isBlocked + errorHandler; ERR_998 → thrown directly; ERR_800 (cancelled) → silent; everything else → errorHandler (skipped when the descriptor carries silent: true, still thrown)
|
|
351
343
|
```
|
|
352
344
|
|
|
353
345
|
**V1→V2 conversion**: `supportVersion2List` supports dynamic paths (e.g. `payment/v2/:paymentType/transaction`, where `:param` is replaced by `[^/]+`); special paths are hard-coded in `specifyingPath`, and the rest are auto-converted via `/([a-z])([A-Z])/g`. **When adding an endpoint that needs V2 conversion, it must be added to the list manually.**
|
|
@@ -364,10 +356,9 @@ io(`${socketURL}/frontend`, {
|
|
|
364
356
|
8. **`appSecret` marks public endpoints**: nearly all `isPublic: true` endpoints require an `appSecret` parameter, **but the auth endpoints do not**.
|
|
365
357
|
9. **Unfinished-game infinite retry**: the `unfinishedGame` state in `error.js` returns to itself on `onError`, with **no backoff strategy and no retry cap** (a known issue, see "Known Technical Debt").
|
|
366
358
|
10. **`isMobile` is a string, not a boolean**: in `common.js`, `isMobile = userAgent?.device?.type` returns `'mobile'`/`'tablet'`/`undefined`, so comparisons must be string-based (e.g. `isMobile === 'mobile' ? 'y' : null`).
|
|
367
|
-
11. **
|
|
359
|
+
11. **Requests carry no CancelToken by default**: the cancellation feature of `send(req, customToken)` is **opt-in**. In axios <0.22 the cancel handler is never unsubscribed — a shared long-lived token accumulates one handler per request, causing overnight OOM when left running (TI-15555). **Do not "helpfully" add the CancelToken back onto the shared path.**
|
|
368
360
|
12. **`silent: true` only skips errorHandler**: the error is still thrown to the caller's `onError`, and `ERR_F108` is still routed as usual; but every other error code — **including logout-class codes such as `ERR_A104`, and `ERR_G106` insufficient balance** — never reaches the error machine. Use it only for background requests whose session invalidation is already covered by `fetchUserInfo` polling; never add it to user-initiated requests.
|
|
369
|
-
13. **`send()` does not guarantee an object, and `assign()` must never throw**: non-config requests during maintenance (`isBlocked`) and
|
|
370
|
-
14. **Late errors from a stale identity never reach errorHandler**: when the token a request was sent with differs from the current token (and a current token exists), the error is only thrown to the caller's `onError` and not forwarded to errorHandler — so a late logout-class error from an old session can't log out a newly logged-in identity. When there is no current token (TTL expired or already cleared), routing is unchanged so that `ERR_A204`-style popups aren't swallowed; the `ERR_F108` check comes before this one and still routes as usual.
|
|
361
|
+
13. **`send()` does not guarantee an object, and `assign()` must never throw**: non-config requests during maintenance (`isBlocked`) and `ERR_800` cancellations make `send()` **resolve `undefined`** (they never reach `onError`); a 200 response with a non-JSON body resolves a string, so destructuring `{ data }` yields `undefined`. When an `assign()` throws, XState v4 clears the event queue and the state is not updated — the machine stays in the current invoke state and `after`-based polling stops until an external event (e.g. `REFRESH`) moves it out. **Validate response shapes inside the service and `throw` there (reject → `onError`)**; every assign in `onDone` must handle every value the service can resolve, including deliberate `return null` early exits.
|
|
371
362
|
|
|
372
363
|
---
|
|
373
364
|
|