@jetthai/cuora 1.1.481-api.1 → 1.1.481-dev.1

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.
@@ -6,9 +6,96 @@
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
+
9
96
  ## Step 1 — 讀取來源檔
10
97
 
11
- 讀取 `AI_PROMPT_SOURCE.md` 完整內容。
98
+ 讀取 `AI_PROMPT_SOURCE.md` 完整內容(此時已是 Step 0 更新後的最新版本)。
12
99
 
13
100
  ---
14
101
 
@@ -17,7 +17,9 @@
17
17
  "mcp__sentry__get_issue_details",
18
18
  "mcp__sentry__search_issues",
19
19
  "Bash(git add:*)",
20
- "Bash(git commit:*)"
20
+ "Bash(git commit:*)",
21
+ "Bash(git branch:*)",
22
+ "Bash(git merge:*)"
21
23
  ]
22
24
  }
23
25
  }
@@ -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 "分支 '$CURRENT_BRANCH' 有 $LOCAL_AHEAD 個尚未推送的 commit,略過自動拉取。"
22
+ echo "You have $LOCAL_AHEAD unpushed commit(s) on '$CURRENT_BRANCH'. Skipping auto-pull."
23
23
  exit 0
24
24
  fi
25
25
 
26
26
  # 自動從遠端拉取最新程式碼(使用 rebase 保持線性歷史)
27
- echo "正在從遠端自動拉取 '$CURRENT_BRANCH'..."
27
+ echo "Auto pulling '$CURRENT_BRANCH' from remote..."
28
28
  git pull --rebase origin "$CURRENT_BRANCH" || {
29
- echo "拉取 '$CURRENT_BRANCH' 失敗,請手動處理。"
29
+ echo "Failed to pull '$CURRENT_BRANCH'. Please resolve manually."
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 "偵測到在 $BRANCH 分支上強制推送,略過 pre-push hooks。"
24
+ echo "Force push detected on $BRANCH, skipping pre-push hooks."
25
25
  exit 0
26
26
  fi
27
27
 
package/.prettierignore CHANGED
@@ -1 +1,2 @@
1
- dist/
1
+ dist/
2
+ CHANGELOG.md
package/CHANGELOG.md CHANGED
@@ -2,44 +2,84 @@
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.481](https://github.com/jetthai/cuora-module/compare/v1.1.480...v1.1.481) (2026-10-20)
5
+ ### [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)
6
+
7
+ ### [1.1.481-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.481...v1.1.481-dev.0) (2026-10-28)
8
+
9
+ ### [1.1.477-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.477...v1.1.477-dev.1) (2026-10-16)
10
+
6
11
 
7
12
  ### ⚠ BREAKING CHANGES
8
13
 
9
- - 下游在 OTP 關卡送出 OTP_VERIFIED / OTP_SKIP 後,必須在 bindBankChecking 送出
10
- BIND_BANK_DONE 或 BIND_BANK_SKIP,否則會停在此關卡。目前僅 client-pwa-cash 使用本套件。
14
+ * 下游在 OTP 關卡送出 OTP_VERIFIED / OTP_SKIP 後,必須在 bindBankChecking 送出
15
+ BIND_BANK_DONE 或 BIND_BANK_SKIP,否則會停在此關卡。目前僅 client-pwa-cash 使用本套件。
11
16
 
12
17
  Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13
18
 
14
- - [JT-1784011020] feat(auth): 新增 bindBankChecking 關卡,綁銀行完成前不進入 loginSuccess ([c9b5210](https://github.com/jetthai/cuora-module/commit/c9b5210b8f1abb9adca7c79207e89d66191daf8f))
19
+ ### Features
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)
15
43
 
16
- ### [1.1.480](https://github.com/jetthai/cuora-module/compare/v1.1.479...v1.1.480) (2026-10-19)
17
44
 
18
45
  ### ⚠ BREAKING CHANGES
19
46
 
20
- - **export:** 移除頂層 export util 與 Request.sourceUpdate/sourceGenerate
47
+ * 下游在 OTP 關卡送出 OTP_VERIFIED / OTP_SKIP 後,必須在 bindBankChecking 送出
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
21
52
 
22
53
  Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
54
+ * **api,machine:** 移除 39 個 api 方法、2 個常數與 14 個 machine 事件
23
55
 
24
- - **api,machine:** 移除 39 個 api 方法、2 個常數與 14 個 machine 事件
56
+ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
57
+ * **machine:** 移除公開 export machine.bonus、machine.vip_table 與 util 的 max
25
58
 
26
59
  Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
27
60
 
28
- - **machine:** 移除公開 export machine.bonus、machine.vip_table 與 util 的 max
61
+ ### Features
29
62
 
30
- Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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))
31
65
 
32
- ### Bug Fixes
33
66
 
34
- - **machine:** 移除三處幽靈 action 引用 ([49009da](https://github.com/jetthai/cuora-module/commit/49009dae604088b819134e0d40f7719fb8e8874d))
67
+ ### Bug Fixes
35
68
 
36
- - **api,machine:** 移除 39 個零呼叫端 API 與 14 個無觸發來源的 machine 事件 ([14fa754](https://github.com/jetthai/cuora-module/commit/14fa75459aba9558cde1a3485d64cbdf2f8294b2))
37
- - **export:** 移除四個無消費者的對外符號 ([55afe6f](https://github.com/jetthai/cuora-module/commit/55afe6fbfadca8944dd9820d6333ee5b93e0ed25))
38
- - **machine:** 移除 client-pwa-cash 未使用的 bonus、vip_table 與 util/max ([f49977b](https://github.com/jetthai/cuora-module/commit/f49977bfd480d961f5dc37435b3c60447eb198c0))
69
+ * **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
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))
39
77
 
40
- ### [1.1.479](https://github.com/jetthai/cuora-module/compare/v1.1.478...v1.1.479) (2026-10-19)
41
78
 
42
- ### [1.1.478](https://github.com/jetthai/cuora-module/compare/v1.1.477...v1.1.478) (2026-10-16)
79
+ * [JT-1784011020] feat(auth): 新增 bindBankChecking 關卡,綁銀行完成前不進入 loginSuccess ([2b26e99](https://github.com/jetthai/cuora-module/commit/2b26e99eba3d37e8f954724b53da8ee3f75bec18))
80
+ * **api,machine:** 移除 39 個零呼叫端 API 與 14 個無觸發來源的 machine 事件 ([14fa754](https://github.com/jetthai/cuora-module/commit/14fa75459aba9558cde1a3485d64cbdf2f8294b2))
81
+ * **export:** 移除四個無消費者的對外符號 ([55afe6f](https://github.com/jetthai/cuora-module/commit/55afe6fbfadca8944dd9820d6333ee5b93e0ed25))
82
+ * **machine:** 移除 client-pwa-cash 未使用的 bonus、vip_table 與 util/max ([f49977b](https://github.com/jetthai/cuora-module/commit/f49977bfd480d961f5dc37435b3c60447eb198c0))
43
83
 
44
84
  ### [1.1.477](https://github.com/jetthai/cuora-module/compare/v1.1.476...v1.1.477) (2026-10-16)
45
85
 
@@ -47,6 +87,69 @@ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
47
87
 
48
88
  - **activity:** activity_cash 明細略過(resolve null)時 setProgressSummary 不再拋錯卡死 machine ([67cd813](https://github.com/jetthai/cuora-module/commit/67cd8137f1cbb310d43d02c068ed0a896e2c6623))
49
89
 
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
+
50
153
  ### [1.1.476](https://github.com/jetthai/cuora-module/compare/v1.1.475...v1.1.476) (2026-10-13)
51
154
 
52
155
  ### Bug Fixes
@@ -59,27 +162,135 @@ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
59
162
 
60
163
  ### [1.1.473](https://github.com/jetthai/cuora-module/compare/v1.1.472...v1.1.473) (2026-10-05)
61
164
 
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
+
62
180
  ### [1.1.472](https://github.com/jetthai/cuora-module/compare/v1.1.471...v1.1.472) (2026-09-24)
63
181
 
64
182
  ### [1.1.471](https://github.com/jetthai/cuora-module/compare/v1.1.470...v1.1.471) (2026-09-23)
65
183
 
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
+
66
190
  ### [1.1.470](https://github.com/jetthai/cuora-module/compare/v1.1.469...v1.1.470) (2026-09-14)
67
191
 
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
+
68
228
  ### Bug Fixes
69
229
 
70
- - **machine:** user_sign_up 的 registrationData 補上 agentId ([833e8c9](https://github.com/jetthai/cuora-module/commit/833e8c90c0ff554cff651bdb7045ed514d42035e))
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)
71
245
 
72
- ### [1.1.469](https://github.com/jetthai/cuora-module/compare/v1.1.468...v1.1.469) (2026-09-13)
73
246
 
74
247
  ### Bug Fixes
75
248
 
76
- - **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
249
+ * **machine:** user_sign_up 的 registrationData 補上 agentId ([833e8c9](https://github.com/jetthai/cuora-module/commit/833e8c90c0ff554cff651bdb7045ed514d42035e))
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
+
253
+
254
+ ### ⚠ BREAKING CHANGES
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>
265
+
266
+ ### Bug Fixes
267
+
268
+ * **machine:** 移除三處幽靈 action 引用 ([49009da](https://github.com/jetthai/cuora-module/commit/49009dae604088b819134e0d40f7719fb8e8874d))
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)
77
278
 
78
- ### [1.1.468](https://github.com/jetthai/cuora-module/compare/v1.1.467...v1.1.468) (2026-09-11)
79
279
 
80
280
  ### Features
81
281
 
82
- - **payment:** 新增 getPaymentPromotions API 描述符 ([0319692](https://github.com/jetthai/cuora-module/commit/03196925d989333e4bdb11cd933c18b6ace65d83))
282
+ * **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
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))
83
294
 
84
295
  ### [1.1.467](https://github.com/jetthai/cuora-module/compare/v1.1.466...v1.1.467) (2026-09-06)
85
296
 
@@ -89,15 +300,74 @@ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
89
300
 
90
301
  ### [1.1.466](https://github.com/jetthai/cuora-module/compare/v1.1.465...v1.1.466) (2026-08-31)
91
302
 
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
+
92
326
  ### [1.1.465](https://github.com/jetthai/cuora-module/compare/v1.1.464...v1.1.465) (2026-08-17)
93
327
 
94
328
  ### [1.1.464](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.464) (2026-08-16)
95
329
 
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
+
96
339
  ### Bug Fixes
97
340
 
98
341
  - **deposit:** 切換存款活動不再重設使用者已選的通道 ([b9c1de2](https://github.com/jetthai/cuora-module/commit/b9c1de2f3665c56f52d7b074e892837e836d02fa))
99
342
  - **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
100
343
 
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
+
101
371
  ### [1.1.463](https://github.com/jetthai/cuora-module/compare/v1.1.462...v1.1.463) (2026-08-12)
102
372
 
103
373
  ### [1.1.462](https://github.com/jetthai/cuora-module/compare/v1.1.461...v1.1.462) (2026-08-10)
@@ -114,6 +384,44 @@ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
114
384
 
115
385
  ### [1.1.456](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.456) (2026-08-09)
116
386
 
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
+
117
425
  ### [1.1.455](https://github.com/jetthai/cuora-module/compare/v1.1.453...v1.1.455) (2026-08-03)
118
426
 
119
427
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.481-api.1",
3
+ "version": "1.1.481-dev.1",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ // Copyright 2024 The Terasology Foundation
2
3
 
3
4
  // dev/qa 分支自動計算下一個 prerelease 版號
4
5
  // 版號格式:{master 版號}-{分支名}.{遞增編號}
@@ -14,8 +14,15 @@ const { version } = JSON.parse(readFileSync('package.json', 'utf8'))
14
14
  console.log(`Branch: ${branch}`)
15
15
  console.log(`Version: ${version}`)
16
16
 
17
- // 推送 commit 與 tag 到遠端(--no-verify 避免觸發 pre-push hook 造成無限迴圈)
18
- execSync(`git push --no-verify --follow-tags ${remote} ${branch}`, { stdio: 'inherit' })
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
+ }
19
26
 
20
27
  // 發布到 npm,使用分支名稱作為 dist-tag(例如 npm install @jetthai/cuora@dev)
21
28
  try {
@@ -209,4 +209,5 @@ export default {
209
209
  isPublic: true,
210
210
  }),
211
211
  getPaymentPromotions: () => ({ url: 'payment/v2/promotions', method: 'get' }),
212
+ setBonusSetting: ({ bonus }) => ({ url: 'payment/v2/setting', method: 'post', params: { bonus } }),
212
213
  }
@@ -48,16 +48,29 @@ 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
+ },
51
64
  notVerified: {
52
65
  initial: 'checkingStatus',
53
66
  states: {
54
67
  checkingStatus: {
55
68
  invoke: {
56
69
  src: 'verify',
57
- onDone: {
58
- target: 'otp',
59
- actions: 'setVerificationData',
60
- },
70
+ onDone: [
71
+ { target: '#auth_otp.autoVerifying', cond: 'doesNotNeedAcknowledge' },
72
+ { target: 'otp', actions: 'setVerificationData' },
73
+ ],
61
74
  onError: {
62
75
  target: 'errorChecking',
63
76
  actions: 'setError',
@@ -86,20 +99,20 @@ export default function (request) {
86
99
  sendingPhone: {
87
100
  invoke: {
88
101
  src: 'sendPhone',
89
- onDone: {
90
- target: 'otp',
91
- actions: 'setVerificationData',
92
- },
102
+ onDone: [
103
+ { target: '#auth_otp.autoVerifying', cond: 'doesNotNeedAcknowledge' },
104
+ { target: 'otp', actions: 'setVerificationData' },
105
+ ],
93
106
  onError: { target: 'phone' },
94
107
  },
95
108
  },
96
109
  sendingEmail: {
97
110
  invoke: {
98
111
  src: 'sendEmail',
99
- onDone: {
100
- target: 'otp',
101
- actions: 'setVerificationData',
102
- },
112
+ onDone: [
113
+ { target: '#auth_otp.autoVerifying', cond: 'doesNotNeedAcknowledge' },
114
+ { target: 'otp', actions: 'setVerificationData' },
115
+ ],
103
116
  onError: { target: 'email' },
104
117
  },
105
118
  },
@@ -213,10 +226,11 @@ export default function (request) {
213
226
  }),
214
227
  },
215
228
  guards: {
229
+ doesNotNeedAcknowledge: (context, event) => event.data?.needAcknowledge === false,
216
230
  isVerified: (context, event) => {
217
231
  const { strategy, userInfo } = context
218
- if (strategy === 'phone') return !!userInfo?.phone_verification_status
219
- if (strategy === 'email') return !!userInfo?.email_verification_status
232
+ if (strategy === 'phone') return !!(userInfo?.phone || userInfo?.tel) && !!userInfo?.phone_verification_status
233
+ if (strategy === 'email') return !!userInfo?.email && !!userInfo?.email_verification_status
220
234
  return false
221
235
  },
222
236
  isNotVerified: (context, event) => {
@@ -228,11 +242,11 @@ export default function (request) {
228
242
  },
229
243
  isPhoneNotVerified: (context, event) => {
230
244
  const { strategy, userInfo } = context
231
- return strategy === 'phone' && !!userInfo && !userInfo.phone_verification_status && !userInfo.phone
245
+ return strategy === 'phone' && !!userInfo && !(userInfo.phone || userInfo.tel)
232
246
  },
233
247
  isEmailNotVerified: (context, event) => {
234
248
  const { strategy, userInfo } = context
235
- return strategy === 'email' && !!userInfo && !userInfo.email_verification_status && !userInfo.email
249
+ return strategy === 'email' && !!userInfo && !userInfo.email
236
250
  },
237
251
  hasNoPhone: (context, event) => {
238
252
  const { error } = context
@@ -1,6 +1,17 @@
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
+
4
15
  export default function (request) {
5
16
  const { appSecret } = request.config
6
17
  return createMachine(
@@ -17,6 +28,7 @@ export default function (request) {
17
28
  bigWin: {},
18
29
  maxBet: {},
19
30
  withdraw: {},
31
+ latestBet: {},
20
32
  },
21
33
  states: {
22
34
  fetching: {
@@ -44,24 +56,8 @@ export default function (request) {
44
56
  actions: {
45
57
  setHonorBoardList: assign((context, event) => {
46
58
  return {
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
- }),
59
+ // 後端新增的類型若尚未對應 tab key,略過以免產生 undefined tab
60
+ tabs: (event.data || []).map((list) => TAB_KEY_BY_TYPE[list.type]).filter(Boolean),
65
61
  cashRain: (event.data || []).find((item) => item.type === 'CASH_RAIN') || {},
66
62
  deposit: (event.data || []).find((item) => item.type === 'DEPOSIT') || {},
67
63
  roulette: (event.data || []).find((item) => item.type === 'FREE_ROULETTE_SPIN') || {},
@@ -69,6 +65,7 @@ export default function (request) {
69
65
  bigWin: (event.data || []).find((item) => item.type === 'WIN_SCORE') || {},
70
66
  maxBet: (event.data || []).find((item) => item.type === 'WIN_MULTIPLIER') || {},
71
67
  withdraw: (event.data || []).find((item) => item.type === 'WITHDRAW') || {},
68
+ latestBet: (event.data || []).find((item) => item.type === 'LATEST_BET') || {},
72
69
  }
73
70
  }),
74
71
  },
@@ -107,6 +107,7 @@ export default function (request) {
107
107
  return {
108
108
  signUpData: {
109
109
  provider: 'local',
110
+ birthday,
110
111
  ...pickBindData(event.data),
111
112
  birthday,
112
113
  email,
@@ -130,6 +131,7 @@ export default function (request) {
130
131
  return {
131
132
  signUpData: {
132
133
  provider: 'phone',
134
+ birthday,
133
135
  ...pickBindData(event.data),
134
136
  birthday,
135
137
  email,
@@ -152,6 +154,7 @@ export default function (request) {
152
154
  return {
153
155
  signUpData: {
154
156
  provider: 'email',
157
+ birthday,
155
158
  ...pickBindData(event.data),
156
159
  birthday,
157
160
  email,
@@ -322,8 +322,9 @@ export default class Request {
322
322
  }
323
323
  } catch (error) {
324
324
  if (this._isCancelled(error)) throw this._cancelledError()
325
- if (requestToken && error && typeof error === 'object') {
326
- error.requestToken = requestToken
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 })
327
328
  }
328
329
  if (error.code === 'ERR_F108') {
329
330
  this.isBlocked = true
@@ -0,0 +1,192 @@
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
+ })