@jetthai/cuora 1.1.481-dev.1 → 1.1.482
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/.husky/post-checkout +3 -3
- package/.husky/pre-push +1 -1
- package/.prettierignore +1 -2
- package/CHANGELOG.md +24 -326
- package/package.json +1 -1
- package/scripts/auto-version.js +0 -1
- package/scripts/branch-auto-npm-publish.js +2 -9
- package/src/api/activity.js +2 -2
- package/src/api/payment.js +0 -1
- package/src/machine/auth_otp_v3.js +16 -30
- package/src/machine/honor_board_cash.js +18 -15
- package/src/machine/user_sign_up.js +0 -3
- package/src/request/request.js +2 -77
- package/test/auth_otp_v3.test.js +0 -192
|
@@ -6,96 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
## Step 0 — 分析專案並更新 AI_PROMPT_SOURCE.md
|
|
10
|
-
|
|
11
|
-
在同步之前,先掃描專案的實際狀態,確保 `AI_PROMPT_SOURCE.md` 中的數據與程式碼一致。
|
|
12
|
-
|
|
13
|
-
### Part A — 數據校準
|
|
14
|
-
|
|
15
|
-
驗證並更新文件中的統計數據,確保與程式碼一致:
|
|
16
|
-
|
|
17
|
-
1. **版本號**:讀取 `package.json` 的 `version` 欄位,更新文件中的版本號
|
|
18
|
-
2. **檔案數量統計**:
|
|
19
|
-
- `src/` 下的 `.js` 檔案總數
|
|
20
|
-
- `src/api/` 檔案數
|
|
21
|
-
- `src/machine/` 檔案總數(含子目錄),以及狀態機數量(= 總數 - index 檔案數)
|
|
22
|
-
- `src/machine/activity/`、`src/machine/deposit/`、`src/machine/withdraw/` 各自檔案數
|
|
23
|
-
- `src/util/` 檔案數
|
|
24
|
-
3. **API 函式數量**:對每個 `src/api/*.js` 模組,計算 `=>` 的出現次數以統計函式數
|
|
25
|
-
4. **行數驗證**:驗證以下檔案的實際行數:
|
|
26
|
-
- `src/request/request.js`、`src/request/config.js`
|
|
27
|
-
- 所有超過 300 行的狀態機檔案(用於「大型狀態機檔案」表格)
|
|
28
|
-
5. **supportVersion2List 端點數**:計算 `request.js` 中 `supportVersion2List` 陣列的實際項目數
|
|
29
|
-
6. **specifyingPath 映射數**:計算 `_convertUrlToKebabCase` 中 `specifyingPath` 的 key 數量
|
|
30
|
-
7. **關鍵行號參照**:驗證文件中引用的行號(如 `request.js:207`、`request.js:254` 等)是否仍然正確,若偏移則更新
|
|
31
|
-
8. **依賴套件版本**:讀取 `package.json` 的 `dependencies`,更新版本號
|
|
32
|
-
|
|
33
|
-
### Part B — Know-How 與架構驗證
|
|
34
|
-
|
|
35
|
-
檢查 `1.7 核心業務流程與關鍵 Know-How` 章節的內容是否仍然反映程式碼的實際行為:
|
|
36
|
-
|
|
37
|
-
1. **認證流程**:讀取 `src/machine/auth.js`,驗證:
|
|
38
|
-
|
|
39
|
-
- Token TTL、輪詢間隔、延展機制是否有變
|
|
40
|
-
- inline vs login 狀態判斷邏輯(`rank >= 0`)是否有變
|
|
41
|
-
- 登入方式是否有新增或移除(檢查全域 `on:` 事件列表)
|
|
42
|
-
- OTP 流程是否有調整
|
|
43
|
-
|
|
44
|
-
2. **存款流程**:抽樣讀取 2-3 個 deposit 狀態機,驗證:
|
|
45
|
-
|
|
46
|
-
- canonical 流程(loading → promotion → loaded → debouncing → calculating → submitting → submitted)是否有變
|
|
47
|
-
- Cash vs Non-Cash 變體的差異描述是否仍然正確
|
|
48
|
-
- 是否有新增的存款類型或支付方式
|
|
49
|
-
|
|
50
|
-
3. **提款流程**:讀取 `src/machine/withdraw/withdraw_manual.js`,驗證:
|
|
51
|
-
|
|
52
|
-
- 五步驟資格驗證鏈是否有調整
|
|
53
|
-
- OTP 平行狀態是否有變
|
|
54
|
-
|
|
55
|
-
4. **WebSocket**:讀取 `src/machine/websocket.js`,驗證:
|
|
56
|
-
|
|
57
|
-
- 連線參數、重連策略是否有變
|
|
58
|
-
- 事件轉發映射表是否有新增事件
|
|
59
|
-
|
|
60
|
-
5. **Error Machine**:讀取 `src/machine/error.js`,驗證:
|
|
61
|
-
|
|
62
|
-
- 錯誤代碼分類是否有新增
|
|
63
|
-
- 路由邏輯是否有調整
|
|
64
|
-
|
|
65
|
-
6. **Common Machine**:讀取 `src/machine/common.js`,驗證:
|
|
66
|
-
|
|
67
|
-
- 4 個平行子機器的結構是否有變
|
|
68
|
-
- siteConfig 解碼方式是否有變
|
|
69
|
-
|
|
70
|
-
7. **API 請求生命週期**:讀取 `src/request/request.js`,驗證:
|
|
71
|
-
|
|
72
|
-
- 攔截器邏輯、V2 轉換流程是否有變
|
|
73
|
-
- isBlocked 維護模式機制是否有變
|
|
74
|
-
|
|
75
|
-
8. **新增狀態機**:比對 `src/machine/` 目錄與文件中的狀態機分類表,若有新增檔案:
|
|
76
|
-
- 判斷歸類(核心/存款/提款/活動/遊戲/使用者/UI)
|
|
77
|
-
- 更新分類表中的數量與代表檔案
|
|
78
|
-
|
|
79
|
-
### Part C — Clean Code 規範驗證
|
|
80
|
-
|
|
81
|
-
檢查「二、程式碼品質標準」中列出的問題是否已修正:
|
|
82
|
-
|
|
83
|
-
1. **已修正的問題**:若問題已被修正(如 HTTP 方法大小寫已統一),將該項標記為已修正或移除
|
|
84
|
-
2. **新增的問題**:若發現新的程式碼品質問題,添加到對應章節
|
|
85
|
-
|
|
86
|
-
### 執行方式
|
|
87
|
-
|
|
88
|
-
- 使用 shell 指令(`wc -l`、`grep -c`、`find` 等)取得實際數據
|
|
89
|
-
- 使用 Agent subagent 平行分析多個核心檔案
|
|
90
|
-
- 將每項差異直接修正到 `AI_PROMPT_SOURCE.md` 中
|
|
91
|
-
- 若無差異則跳過,不做無意義修改
|
|
92
|
-
- 完成後簡短回報哪些項目有更新
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
9
|
## Step 1 — 讀取來源檔
|
|
97
10
|
|
|
98
|
-
讀取 `AI_PROMPT_SOURCE.md`
|
|
11
|
+
讀取 `AI_PROMPT_SOURCE.md` 完整內容。
|
|
99
12
|
|
|
100
13
|
---
|
|
101
14
|
|
package/.husky/post-checkout
CHANGED
|
@@ -19,14 +19,14 @@ if [ "$match" = "1" ]; then
|
|
|
19
19
|
# 檢查本地是否有尚未推送的 commit,有的話跳過自動拉取(避免覆蓋本地變更)
|
|
20
20
|
LOCAL_AHEAD=$(git rev-list --count origin/"$CURRENT_BRANCH"..HEAD 2>/dev/null || echo 0)
|
|
21
21
|
if [ "$LOCAL_AHEAD" -gt 0 ]; then
|
|
22
|
-
echo "
|
|
22
|
+
echo "分支 '$CURRENT_BRANCH' 有 $LOCAL_AHEAD 個尚未推送的 commit,略過自動拉取。"
|
|
23
23
|
exit 0
|
|
24
24
|
fi
|
|
25
25
|
|
|
26
26
|
# 自動從遠端拉取最新程式碼(使用 rebase 保持線性歷史)
|
|
27
|
-
echo "
|
|
27
|
+
echo "正在從遠端自動拉取 '$CURRENT_BRANCH'..."
|
|
28
28
|
git pull --rebase origin "$CURRENT_BRANCH" || {
|
|
29
|
-
echo "
|
|
29
|
+
echo "拉取 '$CURRENT_BRANCH' 失敗,請手動處理。"
|
|
30
30
|
exit 1
|
|
31
31
|
}
|
|
32
32
|
fi
|
package/.husky/pre-push
CHANGED
|
@@ -21,7 +21,7 @@ BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
|
21
21
|
|
|
22
22
|
# 在 dev/qa 分支的 force push 跳過所有 pre-push hook(避免干擾強制推送)
|
|
23
23
|
if [ "$IS_FORCE" = true ] && { [ "$BRANCH" = "dev" ] || [ "$BRANCH" = "qa" ]; }; then
|
|
24
|
-
echo "
|
|
24
|
+
echo "偵測到在 $BRANCH 分支上強制推送,略過 pre-push hooks。"
|
|
25
25
|
exit 0
|
|
26
26
|
fi
|
|
27
27
|
|
package/.prettierignore
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
dist/
|
|
2
|
-
CHANGELOG.md
|
|
1
|
+
dist/
|
package/CHANGELOG.md
CHANGED
|
@@ -2,84 +2,50 @@
|
|
|
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.
|
|
5
|
+
### [1.1.482](https://github.com/jetthai/cuora-module/compare/v1.1.481...v1.1.482) (2026-11-02)
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Bug Fixes
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- **activity:** getRewardList 參數 orderColum 修正為 orderColumn ([4bcecf8](https://github.com/jetthai/cuora-module/commit/4bcecf843f36c32fc57d909619c437c709131d88))
|
|
10
10
|
|
|
11
|
+
### [1.1.481](https://github.com/jetthai/cuora-module/compare/v1.1.480...v1.1.481) (2026-10-20)
|
|
11
12
|
|
|
12
13
|
### ⚠ BREAKING CHANGES
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
BIND_BANK_DONE 或 BIND_BANK_SKIP,否則會停在此關卡。目前僅 client-pwa-cash 使用本套件。
|
|
15
|
+
- 下游在 OTP 關卡送出 OTP_VERIFIED / OTP_SKIP 後,必須在 bindBankChecking 送出
|
|
16
|
+
BIND_BANK_DONE 或 BIND_BANK_SKIP,否則會停在此關卡。目前僅 client-pwa-cash 使用本套件。
|
|
16
17
|
|
|
17
18
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
|
|
22
|
-
* **payment:** 恢復 setBonusSetting API ([ba1118d](https://github.com/jetthai/cuora-module/commit/ba1118dabbdd6ae5ca2b68ddf281c8dd6d67a59d))
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
### Bug Fixes
|
|
26
|
-
|
|
27
|
-
* **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
28
|
-
* **otp:** confirm auto verification from user status ([b3b40d8](https://github.com/jetthai/cuora-module/commit/b3b40d8dd42d438486a2110f85564ab3d839ea72))
|
|
29
|
-
* **otp:** require contact data before provider completion ([f70058b](https://github.com/jetthai/cuora-module/commit/f70058b6bcbbc6d048049326700a79249d043a03))
|
|
30
|
-
* **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
|
|
31
|
-
* **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
32
|
-
* **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
33
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
* [JT-1784011020] feat(auth): 新增 bindBankChecking 關卡,綁銀行完成前不進入 loginSuccess ([2b26e99](https://github.com/jetthai/cuora-module/commit/2b26e99eba3d37e8f954724b53da8ee3f75bec18))
|
|
37
|
-
|
|
38
|
-
### [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)
|
|
39
|
-
|
|
40
|
-
### [1.1.477-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.477...v1.1.477-dev.0) (2026-10-16)
|
|
41
|
-
|
|
42
|
-
### [1.1.476-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.476...v1.1.476-dev.1) (2026-10-14)
|
|
20
|
+
- [JT-1784011020] feat(auth): 新增 bindBankChecking 關卡,綁銀行完成前不進入 loginSuccess ([c9b5210](https://github.com/jetthai/cuora-module/commit/c9b5210b8f1abb9adca7c79207e89d66191daf8f))
|
|
43
21
|
|
|
22
|
+
### [1.1.480](https://github.com/jetthai/cuora-module/compare/v1.1.479...v1.1.480) (2026-10-19)
|
|
44
23
|
|
|
45
24
|
### ⚠ BREAKING CHANGES
|
|
46
25
|
|
|
47
|
-
|
|
48
|
-
BIND_BANK_DONE 或 BIND_BANK_SKIP,否則會停在此關卡。目前僅 client-pwa-cash 使用本套件。
|
|
49
|
-
|
|
50
|
-
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
51
|
-
* **export:** 移除頂層 export util 與 Request.sourceUpdate/sourceGenerate
|
|
26
|
+
- **export:** 移除頂層 export util 與 Request.sourceUpdate/sourceGenerate
|
|
52
27
|
|
|
53
28
|
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
54
|
-
* **api,machine:** 移除 39 個 api 方法、2 個常數與 14 個 machine 事件
|
|
55
29
|
|
|
56
|
-
|
|
57
|
-
* **machine:** 移除公開 export machine.bonus、machine.vip_table 與 util 的 max
|
|
30
|
+
- **api,machine:** 移除 39 個 api 方法、2 個常數與 14 個 machine 事件
|
|
58
31
|
|
|
59
32
|
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
60
33
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
* **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
|
|
64
|
-
* **payment:** 恢復 setBonusSetting API ([ba1118d](https://github.com/jetthai/cuora-module/commit/ba1118dabbdd6ae5ca2b68ddf281c8dd6d67a59d))
|
|
34
|
+
- **machine:** 移除公開 export machine.bonus、machine.vip_table 與 util 的 max
|
|
65
35
|
|
|
36
|
+
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
66
37
|
|
|
67
38
|
### Bug Fixes
|
|
68
39
|
|
|
69
|
-
|
|
70
|
-
* **machine:** 移除三處幽靈 action 引用 ([49009da](https://github.com/jetthai/cuora-module/commit/49009dae604088b819134e0d40f7719fb8e8874d))
|
|
71
|
-
* **otp:** confirm auto verification from user status ([b3b40d8](https://github.com/jetthai/cuora-module/commit/b3b40d8dd42d438486a2110f85564ab3d839ea72))
|
|
72
|
-
* **otp:** require contact data before provider completion ([f70058b](https://github.com/jetthai/cuora-module/commit/f70058b6bcbbc6d048049326700a79249d043a03))
|
|
73
|
-
* **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
|
|
74
|
-
* **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
75
|
-
* **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
76
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
40
|
+
- **machine:** 移除三處幽靈 action 引用 ([49009da](https://github.com/jetthai/cuora-module/commit/49009dae604088b819134e0d40f7719fb8e8874d))
|
|
77
41
|
|
|
42
|
+
- **api,machine:** 移除 39 個零呼叫端 API 與 14 個無觸發來源的 machine 事件 ([14fa754](https://github.com/jetthai/cuora-module/commit/14fa75459aba9558cde1a3485d64cbdf2f8294b2))
|
|
43
|
+
- **export:** 移除四個無消費者的對外符號 ([55afe6f](https://github.com/jetthai/cuora-module/commit/55afe6fbfadca8944dd9820d6333ee5b93e0ed25))
|
|
44
|
+
- **machine:** 移除 client-pwa-cash 未使用的 bonus、vip_table 與 util/max ([f49977b](https://github.com/jetthai/cuora-module/commit/f49977bfd480d961f5dc37435b3c60447eb198c0))
|
|
78
45
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
* **machine:** 移除 client-pwa-cash 未使用的 bonus、vip_table 與 util/max ([f49977b](https://github.com/jetthai/cuora-module/commit/f49977bfd480d961f5dc37435b3c60447eb198c0))
|
|
46
|
+
### [1.1.479](https://github.com/jetthai/cuora-module/compare/v1.1.478...v1.1.479) (2026-10-19)
|
|
47
|
+
|
|
48
|
+
### [1.1.478](https://github.com/jetthai/cuora-module/compare/v1.1.477...v1.1.478) (2026-10-16)
|
|
83
49
|
|
|
84
50
|
### [1.1.477](https://github.com/jetthai/cuora-module/compare/v1.1.476...v1.1.477) (2026-10-16)
|
|
85
51
|
|
|
@@ -87,69 +53,6 @@ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
|
87
53
|
|
|
88
54
|
- **activity:** activity_cash 明細略過(resolve null)時 setProgressSummary 不再拋錯卡死 machine ([67cd813](https://github.com/jetthai/cuora-module/commit/67cd8137f1cbb310d43d02c068ed0a896e2c6623))
|
|
89
55
|
|
|
90
|
-
### [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)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
### Bug Fixes
|
|
94
|
-
|
|
95
|
-
* **activity:** activity_cash 明細略過(resolve null)時 setProgressSummary 不再拋錯卡死 machine ([67cd813](https://github.com/jetthai/cuora-module/commit/67cd8137f1cbb310d43d02c068ed0a896e2c6623))
|
|
96
|
-
|
|
97
|
-
### [1.1.476](https://github.com/jetthai/cuora-module/compare/v1.1.475...v1.1.476) (2026-10-13)
|
|
98
|
-
|
|
99
|
-
### [1.1.475](https://github.com/jetthai/cuora-module/compare/v1.1.473...v1.1.475) (2026-10-12)
|
|
100
|
-
|
|
101
|
-
### [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)
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
### ⚠ BREAKING CHANGES
|
|
105
|
-
|
|
106
|
-
* 下游在 OTP 關卡送出 OTP_VERIFIED / OTP_SKIP 後,必須在 bindBankChecking 送出
|
|
107
|
-
BIND_BANK_DONE 或 BIND_BANK_SKIP,否則會停在此關卡。目前僅 client-pwa-cash 使用本套件。
|
|
108
|
-
|
|
109
|
-
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
110
|
-
|
|
111
|
-
* [JT-1784011020] feat(auth): 新增 bindBankChecking 關卡,綁銀行完成前不進入 loginSuccess ([2b26e99](https://github.com/jetthai/cuora-module/commit/2b26e99eba3d37e8f954724b53da8ee3f75bec18))
|
|
112
|
-
|
|
113
|
-
### [1.1.473-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.473...v1.1.473-dev.0) (2026-10-07)
|
|
114
|
-
|
|
115
|
-
### [1.1.472-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.472...v1.1.472-dev.2) (2026-10-01)
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
### ⚠ BREAKING CHANGES
|
|
119
|
-
|
|
120
|
-
* **export:** 移除頂層 export util 與 Request.sourceUpdate/sourceGenerate
|
|
121
|
-
|
|
122
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
123
|
-
* **api,machine:** 移除 39 個 api 方法、2 個常數與 14 個 machine 事件
|
|
124
|
-
|
|
125
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
126
|
-
* **machine:** 移除公開 export machine.bonus、machine.vip_table 與 util 的 max
|
|
127
|
-
|
|
128
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
129
|
-
|
|
130
|
-
### Features
|
|
131
|
-
|
|
132
|
-
* **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
|
|
133
|
-
* **payment:** 恢復 setBonusSetting API ([ba1118d](https://github.com/jetthai/cuora-module/commit/ba1118dabbdd6ae5ca2b68ddf281c8dd6d67a59d))
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
### Bug Fixes
|
|
137
|
-
|
|
138
|
-
* **activity:** activity_cash 列表與明細回應格式異常時改走 onError,避免 machine 卡死 ([fea8494](https://github.com/jetthai/cuora-module/commit/fea8494d8c0ff084f8994cb58b8f1f7e3800024a))
|
|
139
|
-
* **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
140
|
-
* **machine:** 移除三處幽靈 action 引用 ([49009da](https://github.com/jetthai/cuora-module/commit/49009dae604088b819134e0d40f7719fb8e8874d))
|
|
141
|
-
* **otp:** confirm auto verification from user status ([b3b40d8](https://github.com/jetthai/cuora-module/commit/b3b40d8dd42d438486a2110f85564ab3d839ea72))
|
|
142
|
-
* **otp:** require contact data before provider completion ([f70058b](https://github.com/jetthai/cuora-module/commit/f70058b6bcbbc6d048049326700a79249d043a03))
|
|
143
|
-
* **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
|
|
144
|
-
* **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
145
|
-
* **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
146
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
* **api,machine:** 移除 39 個零呼叫端 API 與 14 個無觸發來源的 machine 事件 ([14fa754](https://github.com/jetthai/cuora-module/commit/14fa75459aba9558cde1a3485d64cbdf2f8294b2))
|
|
150
|
-
* **export:** 移除四個無消費者的對外符號 ([55afe6f](https://github.com/jetthai/cuora-module/commit/55afe6fbfadca8944dd9820d6333ee5b93e0ed25))
|
|
151
|
-
* **machine:** 移除 client-pwa-cash 未使用的 bonus、vip_table 與 util/max ([f49977b](https://github.com/jetthai/cuora-module/commit/f49977bfd480d961f5dc37435b3c60447eb198c0))
|
|
152
|
-
|
|
153
56
|
### [1.1.476](https://github.com/jetthai/cuora-module/compare/v1.1.475...v1.1.476) (2026-10-13)
|
|
154
57
|
|
|
155
58
|
### Bug Fixes
|
|
@@ -162,135 +65,27 @@ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
|
162
65
|
|
|
163
66
|
### [1.1.473](https://github.com/jetthai/cuora-module/compare/v1.1.472...v1.1.473) (2026-10-05)
|
|
164
67
|
|
|
165
|
-
### [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)
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
### Bug Fixes
|
|
169
|
-
|
|
170
|
-
* **otp:** confirm auto verification from user status ([b3b40d8](https://github.com/jetthai/cuora-module/commit/b3b40d8dd42d438486a2110f85564ab3d839ea72))
|
|
171
|
-
* **otp:** require contact data before provider completion ([f70058b](https://github.com/jetthai/cuora-module/commit/f70058b6bcbbc6d048049326700a79249d043a03))
|
|
172
|
-
|
|
173
|
-
### [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)
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
### Bug Fixes
|
|
177
|
-
|
|
178
|
-
* **activity:** activity_cash 列表與明細回應格式異常時改走 onError,避免 machine 卡死 ([fea8494](https://github.com/jetthai/cuora-module/commit/fea8494d8c0ff084f8994cb58b8f1f7e3800024a))
|
|
179
|
-
|
|
180
68
|
### [1.1.472](https://github.com/jetthai/cuora-module/compare/v1.1.471...v1.1.472) (2026-09-24)
|
|
181
69
|
|
|
182
70
|
### [1.1.471](https://github.com/jetthai/cuora-module/compare/v1.1.470...v1.1.471) (2026-09-23)
|
|
183
71
|
|
|
184
|
-
### [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)
|
|
185
|
-
|
|
186
|
-
### [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)
|
|
187
|
-
|
|
188
|
-
### [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)
|
|
189
|
-
|
|
190
72
|
### [1.1.470](https://github.com/jetthai/cuora-module/compare/v1.1.469...v1.1.470) (2026-09-14)
|
|
191
73
|
|
|
192
|
-
### [1.1.469](https://github.com/jetthai/cuora-module/compare/v1.1.468...v1.1.469) (2026-09-13)
|
|
193
|
-
|
|
194
|
-
### [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)
|
|
195
|
-
|
|
196
|
-
### [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)
|
|
197
|
-
|
|
198
|
-
### Features
|
|
199
|
-
|
|
200
|
-
* **payment:** 恢復 setBonusSetting API ([ba1118d](https://github.com/jetthai/cuora-module/commit/ba1118dabbdd6ae5ca2b68ddf281c8dd6d67a59d))
|
|
201
|
-
|
|
202
|
-
### [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)
|
|
203
|
-
|
|
204
|
-
### [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)
|
|
205
|
-
|
|
206
|
-
### [1.1.468-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.468...v1.1.468-dev.0) (2026-09-12)
|
|
207
|
-
|
|
208
|
-
### [1.1.467-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.467...v1.1.467-dev.2) (2026-09-10)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
### ⚠ BREAKING CHANGES
|
|
212
|
-
|
|
213
|
-
* **export:** 移除頂層 export util 與 Request.sourceUpdate/sourceGenerate
|
|
214
|
-
|
|
215
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
216
|
-
* **api,machine:** 移除 39 個 api 方法、2 個常數與 14 個 machine 事件
|
|
217
|
-
|
|
218
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
219
|
-
* **machine:** 移除公開 export machine.bonus、machine.vip_table 與 util 的 max
|
|
220
|
-
|
|
221
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
222
|
-
|
|
223
|
-
### Features
|
|
224
|
-
|
|
225
|
-
* **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
### Bug Fixes
|
|
229
|
-
|
|
230
|
-
* **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
|
|
231
|
-
* **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
232
|
-
* **machine:** user_sign_up 的 registrationData 補上 agentId ([833e8c9](https://github.com/jetthai/cuora-module/commit/833e8c90c0ff554cff651bdb7045ed514d42035e))
|
|
233
|
-
* **machine:** 移除三處幽靈 action 引用 ([49009da](https://github.com/jetthai/cuora-module/commit/49009dae604088b819134e0d40f7719fb8e8874d))
|
|
234
|
-
* **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
|
|
235
|
-
* **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
236
|
-
* **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
237
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
* **api,machine:** 移除 39 個零呼叫端 API 與 14 個無觸發來源的 machine 事件 ([14fa754](https://github.com/jetthai/cuora-module/commit/14fa75459aba9558cde1a3485d64cbdf2f8294b2))
|
|
241
|
-
* **export:** 移除四個無消費者的對外符號 ([55afe6f](https://github.com/jetthai/cuora-module/commit/55afe6fbfadca8944dd9820d6333ee5b93e0ed25))
|
|
242
|
-
* **machine:** 移除 client-pwa-cash 未使用的 bonus、vip_table 與 util/max ([f49977b](https://github.com/jetthai/cuora-module/commit/f49977bfd480d961f5dc37435b3c60447eb198c0))
|
|
243
|
-
|
|
244
|
-
### [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)
|
|
245
|
-
|
|
246
|
-
|
|
247
74
|
### Bug Fixes
|
|
248
75
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
### [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)
|
|
252
|
-
|
|
76
|
+
- **machine:** user_sign_up 的 registrationData 補上 agentId ([833e8c9](https://github.com/jetthai/cuora-module/commit/833e8c90c0ff554cff651bdb7045ed514d42035e))
|
|
253
77
|
|
|
254
|
-
###
|
|
255
|
-
|
|
256
|
-
* **export:** 移除頂層 export util 與 Request.sourceUpdate/sourceGenerate
|
|
257
|
-
|
|
258
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
259
|
-
* **api,machine:** 移除 39 個 api 方法、2 個常數與 14 個 machine 事件
|
|
260
|
-
|
|
261
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
262
|
-
* **machine:** 移除公開 export machine.bonus、machine.vip_table 與 util 的 max
|
|
263
|
-
|
|
264
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
78
|
+
### [1.1.469](https://github.com/jetthai/cuora-module/compare/v1.1.468...v1.1.469) (2026-09-13)
|
|
265
79
|
|
|
266
80
|
### Bug Fixes
|
|
267
81
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
* **api,machine:** 移除 39 個零呼叫端 API 與 14 個無觸發來源的 machine 事件 ([14fa754](https://github.com/jetthai/cuora-module/commit/14fa75459aba9558cde1a3485d64cbdf2f8294b2))
|
|
272
|
-
* **export:** 移除四個無消費者的對外符號 ([55afe6f](https://github.com/jetthai/cuora-module/commit/55afe6fbfadca8944dd9820d6333ee5b93e0ed25))
|
|
273
|
-
* **machine:** 移除 client-pwa-cash 未使用的 bonus、vip_table 與 util/max ([f49977b](https://github.com/jetthai/cuora-module/commit/f49977bfd480d961f5dc37435b3c60447eb198c0))
|
|
274
|
-
|
|
275
|
-
### [1.1.467-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.467...v1.1.467-dev.0) (2026-09-09)
|
|
276
|
-
|
|
277
|
-
### [1.1.466-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.466...v1.1.466-dev.0) (2026-09-06)
|
|
82
|
+
- **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
|
|
278
83
|
|
|
84
|
+
### [1.1.468](https://github.com/jetthai/cuora-module/compare/v1.1.467...v1.1.468) (2026-09-11)
|
|
279
85
|
|
|
280
86
|
### Features
|
|
281
87
|
|
|
282
|
-
|
|
283
|
-
* **payment:** 新增 getPaymentPromotions API 描述符 ([0319692](https://github.com/jetthai/cuora-module/commit/03196925d989333e4bdb11cd933c18b6ace65d83))
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
### Bug Fixes
|
|
287
|
-
|
|
288
|
-
* **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
|
|
289
|
-
* **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
290
|
-
* **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
|
|
291
|
-
* **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
292
|
-
* **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
293
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
88
|
+
- **payment:** 新增 getPaymentPromotions API 描述符 ([0319692](https://github.com/jetthai/cuora-module/commit/03196925d989333e4bdb11cd933c18b6ace65d83))
|
|
294
89
|
|
|
295
90
|
### [1.1.467](https://github.com/jetthai/cuora-module/compare/v1.1.466...v1.1.467) (2026-09-06)
|
|
296
91
|
|
|
@@ -300,74 +95,15 @@ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
|
300
95
|
|
|
301
96
|
### [1.1.466](https://github.com/jetthai/cuora-module/compare/v1.1.465...v1.1.466) (2026-08-31)
|
|
302
97
|
|
|
303
|
-
### [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)
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
### Bug Fixes
|
|
307
|
-
|
|
308
|
-
* **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
|
|
309
|
-
|
|
310
|
-
### [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)
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
### Bug Fixes
|
|
314
|
-
|
|
315
|
-
* **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
|
|
316
|
-
|
|
317
|
-
### [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)
|
|
318
|
-
|
|
319
|
-
### [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)
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
### Features
|
|
323
|
-
|
|
324
|
-
* **payment:** 新增 getPaymentPromotions API 描述符 ([0319692](https://github.com/jetthai/cuora-module/commit/03196925d989333e4bdb11cd933c18b6ace65d83))
|
|
325
|
-
|
|
326
98
|
### [1.1.465](https://github.com/jetthai/cuora-module/compare/v1.1.464...v1.1.465) (2026-08-17)
|
|
327
99
|
|
|
328
100
|
### [1.1.464](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.464) (2026-08-16)
|
|
329
101
|
|
|
330
|
-
### [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)
|
|
331
|
-
|
|
332
|
-
### [1.1.465](https://github.com/jetthai/cuora-module/compare/v1.1.464...v1.1.465) (2026-08-17)
|
|
333
|
-
|
|
334
|
-
### [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)
|
|
335
|
-
|
|
336
|
-
### [1.1.464](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.464) (2026-08-16)
|
|
337
|
-
|
|
338
|
-
|
|
339
102
|
### Bug Fixes
|
|
340
103
|
|
|
341
104
|
- **deposit:** 切換存款活動不再重設使用者已選的通道 ([b9c1de2](https://github.com/jetthai/cuora-module/commit/b9c1de2f3665c56f52d7b074e892837e836d02fa))
|
|
342
105
|
- **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
|
|
343
106
|
|
|
344
|
-
### [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)
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
### Bug Fixes
|
|
348
|
-
|
|
349
|
-
* **deposit:** 切換存款活動不再重設使用者已選的通道 ([b9c1de2](https://github.com/jetthai/cuora-module/commit/b9c1de2f3665c56f52d7b074e892837e836d02fa))
|
|
350
|
-
|
|
351
|
-
### [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)
|
|
352
|
-
|
|
353
|
-
### [1.1.463-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.463-dev.0) (2026-08-13)
|
|
354
|
-
|
|
355
|
-
### [1.1.455-dev.8](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.455-dev.8) (2026-08-09)
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
### Features
|
|
359
|
-
|
|
360
|
-
* **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
### Bug Fixes
|
|
364
|
-
|
|
365
|
-
* **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
366
|
-
* **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
367
|
-
* **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
368
|
-
* **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
|
|
369
|
-
* **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
370
|
-
|
|
371
107
|
### [1.1.463](https://github.com/jetthai/cuora-module/compare/v1.1.462...v1.1.463) (2026-08-12)
|
|
372
108
|
|
|
373
109
|
### [1.1.462](https://github.com/jetthai/cuora-module/compare/v1.1.461...v1.1.462) (2026-08-10)
|
|
@@ -384,44 +120,6 @@ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
|
384
120
|
|
|
385
121
|
### [1.1.456](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.456) (2026-08-09)
|
|
386
122
|
|
|
387
|
-
### [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)
|
|
388
|
-
|
|
389
|
-
### [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)
|
|
390
|
-
|
|
391
|
-
### [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)
|
|
392
|
-
|
|
393
|
-
### [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)
|
|
394
|
-
|
|
395
|
-
### [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)
|
|
396
|
-
|
|
397
|
-
### [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)
|
|
398
|
-
|
|
399
|
-
### [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)
|
|
400
|
-
|
|
401
|
-
### [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)
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
### Bug Fixes
|
|
405
|
-
|
|
406
|
-
- **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
|
|
407
|
-
|
|
408
|
-
### [1.1.455-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.455-dev.0) (2026-08-04)
|
|
409
|
-
|
|
410
|
-
### [1.1.454-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.453...v1.1.454-dev.0) (2026-07-29)
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
### Features
|
|
414
|
-
|
|
415
|
-
- **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
### Bug Fixes
|
|
419
|
-
|
|
420
|
-
- **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
|
|
421
|
-
- **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
|
|
422
|
-
- **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
|
|
423
|
-
- **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
|
|
424
|
-
|
|
425
123
|
### [1.1.455](https://github.com/jetthai/cuora-module/compare/v1.1.453...v1.1.455) (2026-08-03)
|
|
426
124
|
|
|
427
125
|
### Bug Fixes
|
package/package.json
CHANGED
package/scripts/auto-version.js
CHANGED
|
@@ -14,15 +14,8 @@ const { version } = JSON.parse(readFileSync('package.json', 'utf8'))
|
|
|
14
14
|
console.log(`Branch: ${branch}`)
|
|
15
15
|
console.log(`Version: ${version}`)
|
|
16
16
|
|
|
17
|
-
// 推送 commit 到遠端(--no-verify 避免觸發 pre-push hook 造成無限迴圈)
|
|
18
|
-
execSync(`git push --no-verify ${remote} ${branch}`, { stdio: 'inherit' })
|
|
19
|
-
|
|
20
|
-
// 單獨推送 tag;tag 已存在於 remote 時視為成功(不中斷 npm publish)
|
|
21
|
-
try {
|
|
22
|
-
execSync(`git push --no-verify ${remote} refs/tags/v${version}`, { stdio: 'inherit' })
|
|
23
|
-
} catch {
|
|
24
|
-
console.warn(`⚠ tag v${version} push 失敗(可能已存在),繼續 npm publish`)
|
|
25
|
-
}
|
|
17
|
+
// 推送 commit 與 tag 到遠端(--no-verify 避免觸發 pre-push hook 造成無限迴圈)
|
|
18
|
+
execSync(`git push --no-verify --follow-tags ${remote} ${branch}`, { stdio: 'inherit' })
|
|
26
19
|
|
|
27
20
|
// 發布到 npm,使用分支名稱作為 dist-tag(例如 npm install @jetthai/cuora@dev)
|
|
28
21
|
try {
|
package/src/api/activity.js
CHANGED
|
@@ -44,10 +44,10 @@ export default {
|
|
|
44
44
|
method: 'get',
|
|
45
45
|
params: { rewardType },
|
|
46
46
|
}),
|
|
47
|
-
getRewardList: ({ rewardType, count, appSecret,
|
|
47
|
+
getRewardList: ({ rewardType, count, appSecret, orderColumn, lang }) => ({
|
|
48
48
|
url: 'activities/rewards',
|
|
49
49
|
method: 'get',
|
|
50
|
-
params: { rewardType, count, appSecret,
|
|
50
|
+
params: { rewardType, count, appSecret, orderColumn, lang },
|
|
51
51
|
}),
|
|
52
52
|
getCashRainReward: ({ activityNo, appSecret }) => ({
|
|
53
53
|
url: `activities/cashRain`,
|
package/src/api/payment.js
CHANGED
|
@@ -48,29 +48,16 @@ export default function (request) {
|
|
|
48
48
|
{ target: 'notVerified', cond: 'isNotVerified' },
|
|
49
49
|
],
|
|
50
50
|
},
|
|
51
|
-
autoVerifying: {
|
|
52
|
-
invoke: {
|
|
53
|
-
src: 'fetchUserInfo',
|
|
54
|
-
onDone: {
|
|
55
|
-
target: 'checkingAutoVerification',
|
|
56
|
-
actions: 'setUserInfo',
|
|
57
|
-
},
|
|
58
|
-
onError: { target: 'fail' },
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
checkingAutoVerification: {
|
|
62
|
-
always: [{ target: 'verified', cond: 'isVerified' }, { target: 'fail' }],
|
|
63
|
-
},
|
|
64
51
|
notVerified: {
|
|
65
52
|
initial: 'checkingStatus',
|
|
66
53
|
states: {
|
|
67
54
|
checkingStatus: {
|
|
68
55
|
invoke: {
|
|
69
56
|
src: 'verify',
|
|
70
|
-
onDone:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
57
|
+
onDone: {
|
|
58
|
+
target: 'otp',
|
|
59
|
+
actions: 'setVerificationData',
|
|
60
|
+
},
|
|
74
61
|
onError: {
|
|
75
62
|
target: 'errorChecking',
|
|
76
63
|
actions: 'setError',
|
|
@@ -99,20 +86,20 @@ export default function (request) {
|
|
|
99
86
|
sendingPhone: {
|
|
100
87
|
invoke: {
|
|
101
88
|
src: 'sendPhone',
|
|
102
|
-
onDone:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
89
|
+
onDone: {
|
|
90
|
+
target: 'otp',
|
|
91
|
+
actions: 'setVerificationData',
|
|
92
|
+
},
|
|
106
93
|
onError: { target: 'phone' },
|
|
107
94
|
},
|
|
108
95
|
},
|
|
109
96
|
sendingEmail: {
|
|
110
97
|
invoke: {
|
|
111
98
|
src: 'sendEmail',
|
|
112
|
-
onDone:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
99
|
+
onDone: {
|
|
100
|
+
target: 'otp',
|
|
101
|
+
actions: 'setVerificationData',
|
|
102
|
+
},
|
|
116
103
|
onError: { target: 'email' },
|
|
117
104
|
},
|
|
118
105
|
},
|
|
@@ -226,11 +213,10 @@ export default function (request) {
|
|
|
226
213
|
}),
|
|
227
214
|
},
|
|
228
215
|
guards: {
|
|
229
|
-
doesNotNeedAcknowledge: (context, event) => event.data?.needAcknowledge === false,
|
|
230
216
|
isVerified: (context, event) => {
|
|
231
217
|
const { strategy, userInfo } = context
|
|
232
|
-
if (strategy === 'phone') return !!
|
|
233
|
-
if (strategy === 'email') return !!userInfo?.
|
|
218
|
+
if (strategy === 'phone') return !!userInfo?.phone_verification_status
|
|
219
|
+
if (strategy === 'email') return !!userInfo?.email_verification_status
|
|
234
220
|
return false
|
|
235
221
|
},
|
|
236
222
|
isNotVerified: (context, event) => {
|
|
@@ -242,11 +228,11 @@ export default function (request) {
|
|
|
242
228
|
},
|
|
243
229
|
isPhoneNotVerified: (context, event) => {
|
|
244
230
|
const { strategy, userInfo } = context
|
|
245
|
-
return strategy === 'phone' && !!userInfo && !
|
|
231
|
+
return strategy === 'phone' && !!userInfo && !userInfo.phone_verification_status && !userInfo.phone
|
|
246
232
|
},
|
|
247
233
|
isEmailNotVerified: (context, event) => {
|
|
248
234
|
const { strategy, userInfo } = context
|
|
249
|
-
return strategy === 'email' && !!userInfo && !userInfo.email
|
|
235
|
+
return strategy === 'email' && !!userInfo && !userInfo.email_verification_status && !userInfo.email
|
|
250
236
|
},
|
|
251
237
|
hasNoPhone: (context, event) => {
|
|
252
238
|
const { error } = context
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import { createMachine, assign } from 'xstate'
|
|
2
2
|
import activity from '../api/activity.js'
|
|
3
3
|
|
|
4
|
-
const TAB_KEY_BY_TYPE = {
|
|
5
|
-
CASH_RAIN: 'cashRain',
|
|
6
|
-
DEPOSIT: 'deposit',
|
|
7
|
-
FREE_ROULETTE_SPIN: 'roulette',
|
|
8
|
-
JACKPOT: 'jackpot',
|
|
9
|
-
WIN_SCORE: 'bigWin',
|
|
10
|
-
WIN_MULTIPLIER: 'maxBet',
|
|
11
|
-
WITHDRAW: 'withdraw',
|
|
12
|
-
LATEST_BET: 'latestBet',
|
|
13
|
-
}
|
|
14
|
-
|
|
15
4
|
export default function (request) {
|
|
16
5
|
const { appSecret } = request.config
|
|
17
6
|
return createMachine(
|
|
@@ -28,7 +17,6 @@ export default function (request) {
|
|
|
28
17
|
bigWin: {},
|
|
29
18
|
maxBet: {},
|
|
30
19
|
withdraw: {},
|
|
31
|
-
latestBet: {},
|
|
32
20
|
},
|
|
33
21
|
states: {
|
|
34
22
|
fetching: {
|
|
@@ -56,8 +44,24 @@ export default function (request) {
|
|
|
56
44
|
actions: {
|
|
57
45
|
setHonorBoardList: assign((context, event) => {
|
|
58
46
|
return {
|
|
59
|
-
|
|
60
|
-
|
|
47
|
+
tabs: (event.data || []).map((list) => {
|
|
48
|
+
switch (list.type) {
|
|
49
|
+
case 'CASH_RAIN':
|
|
50
|
+
return 'cashRain'
|
|
51
|
+
case 'DEPOSIT':
|
|
52
|
+
return 'deposit'
|
|
53
|
+
case 'FREE_ROULETTE_SPIN':
|
|
54
|
+
return 'roulette'
|
|
55
|
+
case 'JACKPOT':
|
|
56
|
+
return 'jackpot'
|
|
57
|
+
case 'WIN_SCORE':
|
|
58
|
+
return 'bigWin'
|
|
59
|
+
case 'WIN_MULTIPLIER':
|
|
60
|
+
return 'maxBet'
|
|
61
|
+
case 'WITHDRAW':
|
|
62
|
+
return 'withdraw'
|
|
63
|
+
}
|
|
64
|
+
}),
|
|
61
65
|
cashRain: (event.data || []).find((item) => item.type === 'CASH_RAIN') || {},
|
|
62
66
|
deposit: (event.data || []).find((item) => item.type === 'DEPOSIT') || {},
|
|
63
67
|
roulette: (event.data || []).find((item) => item.type === 'FREE_ROULETTE_SPIN') || {},
|
|
@@ -65,7 +69,6 @@ export default function (request) {
|
|
|
65
69
|
bigWin: (event.data || []).find((item) => item.type === 'WIN_SCORE') || {},
|
|
66
70
|
maxBet: (event.data || []).find((item) => item.type === 'WIN_MULTIPLIER') || {},
|
|
67
71
|
withdraw: (event.data || []).find((item) => item.type === 'WITHDRAW') || {},
|
|
68
|
-
latestBet: (event.data || []).find((item) => item.type === 'LATEST_BET') || {},
|
|
69
72
|
}
|
|
70
73
|
}),
|
|
71
74
|
},
|
|
@@ -107,7 +107,6 @@ export default function (request) {
|
|
|
107
107
|
return {
|
|
108
108
|
signUpData: {
|
|
109
109
|
provider: 'local',
|
|
110
|
-
birthday,
|
|
111
110
|
...pickBindData(event.data),
|
|
112
111
|
birthday,
|
|
113
112
|
email,
|
|
@@ -131,7 +130,6 @@ export default function (request) {
|
|
|
131
130
|
return {
|
|
132
131
|
signUpData: {
|
|
133
132
|
provider: 'phone',
|
|
134
|
-
birthday,
|
|
135
133
|
...pickBindData(event.data),
|
|
136
134
|
birthday,
|
|
137
135
|
email,
|
|
@@ -154,7 +152,6 @@ export default function (request) {
|
|
|
154
152
|
return {
|
|
155
153
|
signUpData: {
|
|
156
154
|
provider: 'email',
|
|
157
|
-
birthday,
|
|
158
155
|
...pickBindData(event.data),
|
|
159
156
|
birthday,
|
|
160
157
|
email,
|
package/src/request/request.js
CHANGED
|
@@ -5,8 +5,6 @@ import { getErr998SentryExtra } from '../util/err998SentryExtra.js'
|
|
|
5
5
|
// 暫停 ERR_998 上報:在組裝 Sentry 資料之前就中止,不建立事件;仍照常 reject ERR_998 給呼叫端。恢復時改回 false 即可
|
|
6
6
|
const IS_ERR_998_REPORT_PAUSED = true
|
|
7
7
|
|
|
8
|
-
const CANCELLED_MESSAGE = 'Requests Cancelled'
|
|
9
|
-
|
|
10
8
|
// const pickBy = require('lodash/pickBy')
|
|
11
9
|
const supportVersion2List = [
|
|
12
10
|
// 04-09 Update
|
|
@@ -162,9 +160,6 @@ export default class Request {
|
|
|
162
160
|
this.errorHandler = null
|
|
163
161
|
this.hosts = []
|
|
164
162
|
this.isBlocked = false
|
|
165
|
-
this.activeRequests = new Set() // { source, token }:僅追蹤非 public 且帶 token 的在途請求,供 revokeToken 取消
|
|
166
|
-
this.revokedToken = null
|
|
167
|
-
this.tokenGate = null
|
|
168
163
|
this.clientIp = '' // 由外部 plugin(如 clientIp.client.js)非同步寫入,用於 ERR_998 Sentry 回報
|
|
169
164
|
this.hostTester = null // 由外部 plugin(如 host.client.js)寫入,需提供 lastResults 陣列供 ERR_998 Sentry 回報使用
|
|
170
165
|
this.initialize()
|
|
@@ -242,75 +237,15 @@ export default class Request {
|
|
|
242
237
|
this.errorHandler = handler
|
|
243
238
|
}
|
|
244
239
|
|
|
245
|
-
// 作廢指定 token:取消同 token 的在途請求,並讓之後仍帶此 token 的 send() 直接 reject。
|
|
246
|
-
// 只在 token 仍是目前身分時作用,舊身分遲到的錯誤不得影響新身分;重新登入後 token 改變即自然恢復
|
|
247
|
-
revokeToken(token) {
|
|
248
|
-
if (!token || token !== this.getToken()) return
|
|
249
|
-
this.revokedToken = token
|
|
250
|
-
this.activeRequests.forEach((item) => {
|
|
251
|
-
if (item.token === token) item.source.cancel(CANCELLED_MESSAGE)
|
|
252
|
-
})
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// 回前景時先確認 token 仍有效:promise 結算(成功或失敗)或逾時即放行,之後的 send() 才會送出
|
|
256
|
-
beginTokenGate(promise, timeoutMs = 3000) {
|
|
257
|
-
let timer
|
|
258
|
-
const timeout = new Promise((resolve) => {
|
|
259
|
-
timer = setTimeout(resolve, timeoutMs)
|
|
260
|
-
})
|
|
261
|
-
const gate = Promise.race([Promise.resolve(promise).catch(() => {}), timeout]).then(() => {
|
|
262
|
-
clearTimeout(timer)
|
|
263
|
-
if (this.tokenGate === gate) this.tokenGate = null
|
|
264
|
-
})
|
|
265
|
-
this.tokenGate = gate
|
|
266
|
-
return gate
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// 帶 ERR_800 讓下游既有的 `if (!error.code)` 判斷(如 Sentry 上報)把取消視為預期錯誤
|
|
270
|
-
_cancelledError() {
|
|
271
|
-
return Object.assign(new Error(CANCELLED_MESSAGE), { code: 'ERR_800' })
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
_throwIfRevoked() {
|
|
275
|
-
if (this.revokedToken && this.getToken() === this.revokedToken) {
|
|
276
|
-
throw this._cancelledError()
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
_isCancelled(error) {
|
|
281
|
-
return !!this.axios.isCancel?.(error) || error?.message === CANCELLED_MESSAGE
|
|
282
|
-
}
|
|
283
|
-
|
|
284
240
|
async send(req, customToken) {
|
|
285
|
-
let tracked = null
|
|
286
|
-
let requestToken = null
|
|
287
241
|
try {
|
|
288
242
|
// 非 public 請求缺 token 直接 reject:reject → onError → leaving → 乾淨登出,且不送網路 → 洪水照止
|
|
289
243
|
if (!req.isPublic && !this.getToken()) return Promise.reject({ code: 'ERR_A103' })
|
|
290
244
|
|
|
291
|
-
// 公開請求不帶 token,作廢期間 token 仍留在 storage 也不可誤拒(如 autoLogin 前後的 getConfig)
|
|
292
|
-
if (!req.isPublic) this._throwIfRevoked()
|
|
293
|
-
|
|
294
|
-
// /self 是 gate 自己的探測請求,不可等待 gate,否則死鎖
|
|
295
|
-
if (this.tokenGate && !req.isPublic && req.url.split('?')[0] !== 'self') {
|
|
296
|
-
await this.tokenGate
|
|
297
|
-
this._throwIfRevoked()
|
|
298
|
-
if (!this.getToken()) return Promise.reject({ code: 'ERR_A103' })
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
requestToken = req.isPublic ? null : this.getToken()
|
|
302
|
-
|
|
303
245
|
// axios <0.22 對 cancelToken.promise 註冊的取消 handler 永不退訂(xhr.js 無 unsubscribe),
|
|
304
246
|
// 預設掛長壽命共用 token 會使 handler 隨請求數線性累積(掛機過夜 OOM,TI-15555)。
|
|
305
|
-
//
|
|
306
|
-
|
|
307
|
-
let cancelToken = customToken
|
|
308
|
-
if (!customToken && requestToken && this.axios.CancelToken) {
|
|
309
|
-
const source = this.axios.CancelToken.source()
|
|
310
|
-
tracked = { source, token: requestToken }
|
|
311
|
-
this.activeRequests.add(tracked)
|
|
312
|
-
cancelToken = source.token
|
|
313
|
-
}
|
|
247
|
+
// 故預設不掛 cancelToken,僅呼叫端明確傳入 customToken(自行管理其生命週期)時才附加。
|
|
248
|
+
const cancelToken = customToken
|
|
314
249
|
|
|
315
250
|
const requestConfig = this._createConfig(req, cancelToken)
|
|
316
251
|
const configUrls = ['getConfig', 'get-config']
|
|
@@ -321,19 +256,11 @@ export default class Request {
|
|
|
321
256
|
return data
|
|
322
257
|
}
|
|
323
258
|
} catch (error) {
|
|
324
|
-
if (this._isCancelled(error)) throw this._cancelledError()
|
|
325
|
-
// 不可列舉:避免 Bearer token 隨 JSON.stringify/Sentry 序列化外洩,但 error.requestToken 仍可讀取
|
|
326
|
-
if (requestToken && error && typeof error === 'object' && Object.isExtensible(error)) {
|
|
327
|
-
Object.defineProperty(error, 'requestToken', { value: requestToken, enumerable: false, configurable: true })
|
|
328
|
-
}
|
|
329
259
|
if (error.code === 'ERR_F108') {
|
|
330
260
|
this.isBlocked = true
|
|
331
261
|
this.errorHandler && this.errorHandler(error)
|
|
332
262
|
throw error
|
|
333
263
|
}
|
|
334
|
-
// 舊身分遲到的錯誤不進 errorHandler;目前沒 token(TTL 過期或已 CLEAR)時維持原路由,A204 等彈窗才不會被吞
|
|
335
|
-
const currentToken = this.getToken()
|
|
336
|
-
if (requestToken && currentToken && currentToken !== requestToken) throw error
|
|
337
264
|
if (error.code === 'ERR_998') {
|
|
338
265
|
throw error
|
|
339
266
|
}
|
|
@@ -343,8 +270,6 @@ export default class Request {
|
|
|
343
270
|
}
|
|
344
271
|
throw error
|
|
345
272
|
}
|
|
346
|
-
} finally {
|
|
347
|
-
if (tracked) this.activeRequests.delete(tracked)
|
|
348
273
|
}
|
|
349
274
|
}
|
|
350
275
|
|
package/test/auth_otp_v3.test.js
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import test from 'node:test'
|
|
2
|
-
import assert from 'node:assert/strict'
|
|
3
|
-
import { interpret } from 'xstate'
|
|
4
|
-
import authOtpV3 from '../src/machine/auth_otp_v3.js'
|
|
5
|
-
|
|
6
|
-
function waitForState(service, matches) {
|
|
7
|
-
if (service.state.matches(matches)) return Promise.resolve(service.state)
|
|
8
|
-
return new Promise((resolve, reject) => {
|
|
9
|
-
const timeout = setTimeout(() => reject(new Error(`Timed out waiting for ${matches}`)), 1000)
|
|
10
|
-
service.onTransition((state) => {
|
|
11
|
-
if (!state.matches(matches)) return
|
|
12
|
-
clearTimeout(timeout)
|
|
13
|
-
resolve(state)
|
|
14
|
-
})
|
|
15
|
-
})
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
test('phone entry skips OTP only after /self confirms phone verification', async () => {
|
|
19
|
-
let selfReads = 0
|
|
20
|
-
const requests = []
|
|
21
|
-
const request = {
|
|
22
|
-
async send(descriptor) {
|
|
23
|
-
requests.push(descriptor.url)
|
|
24
|
-
if (descriptor.url === 'self') {
|
|
25
|
-
selfReads++
|
|
26
|
-
return {
|
|
27
|
-
phone: selfReads === 1 ? null : '123456789',
|
|
28
|
-
phone_verification_status: selfReads > 1,
|
|
29
|
-
email: null,
|
|
30
|
-
email_verification_status: false,
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (descriptor.url === 'otp-verification-point/verify') return { needAcknowledge: false }
|
|
34
|
-
throw new Error(`Unexpected request: ${descriptor.url}`)
|
|
35
|
-
},
|
|
36
|
-
}
|
|
37
|
-
const service = interpret(authOtpV3(request)).start()
|
|
38
|
-
try {
|
|
39
|
-
service.send({ type: 'SET_STRATEGY', data: 'phone' })
|
|
40
|
-
await waitForState(service, 'notVerified.phone')
|
|
41
|
-
service.send({ type: 'SEND_PHONE', data: { countryCode: '886', phone: '123456789' } })
|
|
42
|
-
await waitForState(service, 'verified')
|
|
43
|
-
assert.equal(selfReads, 2)
|
|
44
|
-
assert.deepEqual(requests, ['self', 'otp-verification-point/verify', 'self'])
|
|
45
|
-
} finally {
|
|
46
|
-
service.stop()
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
test('email entry skips OTP only after /self confirms email verification', async () => {
|
|
51
|
-
let selfReads = 0
|
|
52
|
-
const request = {
|
|
53
|
-
async send(descriptor) {
|
|
54
|
-
if (descriptor.url === 'self') {
|
|
55
|
-
selfReads++
|
|
56
|
-
return {
|
|
57
|
-
phone: null,
|
|
58
|
-
phone_verification_status: false,
|
|
59
|
-
email: selfReads === 1 ? null : 'test@example.com',
|
|
60
|
-
email_verification_status: selfReads > 1,
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (descriptor.url === 'otp-verification-point/verify') return { needAcknowledge: false }
|
|
64
|
-
throw new Error(`Unexpected request: ${descriptor.url}`)
|
|
65
|
-
},
|
|
66
|
-
}
|
|
67
|
-
const service = interpret(authOtpV3(request)).start()
|
|
68
|
-
try {
|
|
69
|
-
service.send({ type: 'SET_STRATEGY', data: 'email' })
|
|
70
|
-
await waitForState(service, 'notVerified.email')
|
|
71
|
-
service.send({ type: 'SEND_EMAIL', data: { email: 'test@example.com' } })
|
|
72
|
-
await waitForState(service, 'verified')
|
|
73
|
-
assert.equal(selfReads, 2)
|
|
74
|
-
} finally {
|
|
75
|
-
service.stop()
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
test('existing phone auto verification checks /self before finishing', async () => {
|
|
80
|
-
let selfReads = 0
|
|
81
|
-
const request = {
|
|
82
|
-
async send(descriptor) {
|
|
83
|
-
if (descriptor.url === 'self') {
|
|
84
|
-
selfReads++
|
|
85
|
-
return {
|
|
86
|
-
phone: '123456789',
|
|
87
|
-
phone_verification_status: selfReads > 1,
|
|
88
|
-
email: null,
|
|
89
|
-
email_verification_status: false,
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
if (descriptor.url === 'otp-verification-point/verify') return { needAcknowledge: false }
|
|
93
|
-
throw new Error(`Unexpected request: ${descriptor.url}`)
|
|
94
|
-
},
|
|
95
|
-
}
|
|
96
|
-
const service = interpret(authOtpV3(request)).start()
|
|
97
|
-
try {
|
|
98
|
-
service.send({ type: 'SET_STRATEGY', data: 'phone' })
|
|
99
|
-
await waitForState(service, 'verified')
|
|
100
|
-
assert.equal(selfReads, 2)
|
|
101
|
-
} finally {
|
|
102
|
-
service.stop()
|
|
103
|
-
}
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
test('needAcknowledge false never grants verification when /self is still unverified', async () => {
|
|
107
|
-
let verifyCalls = 0
|
|
108
|
-
const request = {
|
|
109
|
-
async send(descriptor) {
|
|
110
|
-
if (descriptor.url === 'self') {
|
|
111
|
-
return { phone: null, phone_verification_status: false, email: null, email_verification_status: false }
|
|
112
|
-
}
|
|
113
|
-
if (descriptor.url === 'otp-verification-point/verify') {
|
|
114
|
-
verifyCalls++
|
|
115
|
-
return { needAcknowledge: false }
|
|
116
|
-
}
|
|
117
|
-
throw new Error(`Unexpected request: ${descriptor.url}`)
|
|
118
|
-
},
|
|
119
|
-
}
|
|
120
|
-
const service = interpret(authOtpV3(request)).start()
|
|
121
|
-
try {
|
|
122
|
-
service.send({ type: 'SET_STRATEGY', data: 'phone' })
|
|
123
|
-
await waitForState(service, 'notVerified.phone')
|
|
124
|
-
service.send({ type: 'SEND_PHONE', data: { countryCode: '886', phone: '123456789' } })
|
|
125
|
-
await waitForState(service, 'fail')
|
|
126
|
-
assert.equal(verifyCalls, 1)
|
|
127
|
-
} finally {
|
|
128
|
-
service.stop()
|
|
129
|
-
}
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
test('needAcknowledge true keeps the existing OTP input route', async () => {
|
|
133
|
-
const request = {
|
|
134
|
-
async send(descriptor) {
|
|
135
|
-
if (descriptor.url === 'self') {
|
|
136
|
-
return { phone: null, phone_verification_status: false, email: null, email_verification_status: false }
|
|
137
|
-
}
|
|
138
|
-
if (descriptor.url === 'otp-verification-point/verify') {
|
|
139
|
-
return { needAcknowledge: true, request_id: 'test-request', ttl: 60000, countryCode: '886', phone: '123456789' }
|
|
140
|
-
}
|
|
141
|
-
throw new Error(`Unexpected request: ${descriptor.url}`)
|
|
142
|
-
},
|
|
143
|
-
}
|
|
144
|
-
const service = interpret(authOtpV3(request)).start()
|
|
145
|
-
try {
|
|
146
|
-
service.send({ type: 'SET_STRATEGY', data: 'phone' })
|
|
147
|
-
await waitForState(service, 'notVerified.phone')
|
|
148
|
-
service.send({ type: 'SEND_PHONE', data: { countryCode: '886', phone: '123456789' } })
|
|
149
|
-
await waitForState(service, 'notVerified.otp')
|
|
150
|
-
assert.equal(service.state.context.requestId, 'test-request')
|
|
151
|
-
} finally {
|
|
152
|
-
service.stop()
|
|
153
|
-
}
|
|
154
|
-
})
|
|
155
|
-
|
|
156
|
-
test('email without an address still requires input even if its verification flag is true', async () => {
|
|
157
|
-
const request = {
|
|
158
|
-
async send(descriptor) {
|
|
159
|
-
if (descriptor.url === 'self') {
|
|
160
|
-
return { phone: '123456789', phone_verification_status: true, email: null, email_verification_status: true }
|
|
161
|
-
}
|
|
162
|
-
throw new Error(`Unexpected request: ${descriptor.url}`)
|
|
163
|
-
},
|
|
164
|
-
}
|
|
165
|
-
const service = interpret(authOtpV3(request)).start()
|
|
166
|
-
try {
|
|
167
|
-
service.send({ type: 'SET_STRATEGY', data: 'email' })
|
|
168
|
-
await waitForState(service, 'notVerified.email')
|
|
169
|
-
assert.equal(service.state.matches('verified'), false)
|
|
170
|
-
} finally {
|
|
171
|
-
service.stop()
|
|
172
|
-
}
|
|
173
|
-
})
|
|
174
|
-
|
|
175
|
-
test('phone without a number still requires input even if its verification flag is true', async () => {
|
|
176
|
-
const request = {
|
|
177
|
-
async send(descriptor) {
|
|
178
|
-
if (descriptor.url === 'self') {
|
|
179
|
-
return { phone: null, phone_verification_status: true, email: 'test@example.com', email_verification_status: true }
|
|
180
|
-
}
|
|
181
|
-
throw new Error(`Unexpected request: ${descriptor.url}`)
|
|
182
|
-
},
|
|
183
|
-
}
|
|
184
|
-
const service = interpret(authOtpV3(request)).start()
|
|
185
|
-
try {
|
|
186
|
-
service.send({ type: 'SET_STRATEGY', data: 'phone' })
|
|
187
|
-
await waitForState(service, 'notVerified.phone')
|
|
188
|
-
assert.equal(service.state.matches('verified'), false)
|
|
189
|
-
} finally {
|
|
190
|
-
service.stop()
|
|
191
|
-
}
|
|
192
|
-
})
|