@jetthai/cuora 1.1.464 → 1.1.465-dev.2

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.
@@ -13,25 +13,19 @@ git checkout master
13
13
  git fetch --prune
14
14
  ```
15
15
 
16
- 刪除已合併至 master 的 remote 分支(排除 master/qa/dev/HEAD):
16
+ 刪除已合併的 remote 分支(排除 master/dev/qa/HEAD):
17
17
 
18
18
  ```bash
19
- git branch -r --merged origin/master | grep -v -E "(master|qa|dev|HEAD)" | sed 's/origin\///' | xargs -r -I {} git push origin --delete {}
19
+ git branch -r --merged master | grep -v -E "(master|dev|qa|HEAD)" | sed 's/origin\///' | xargs -r -I {} git push origin --delete {}
20
20
  ```
21
21
 
22
- 刪除已合併至 master 的 local 分支(排除 master/qa/dev):
22
+ 刪除已合併的 local 分支(排除 master/dev/qa):
23
23
 
24
24
  ```bash
25
- git branch --merged master | grep -v -E "^\*?\s*(master|qa|dev)$" | xargs -r git branch -d
25
+ git branch --merged master | grep -v -E "^\*?\s*(master|dev|qa)$" | xargs -r git branch -d
26
26
  ```
27
27
 
28
- ### Step 5 — 刪除不合規 tags
29
-
30
- 執行 `scripts/clean-tags.sh` 清理不符合正式版號格式的本地及遠端 tags:
31
-
32
- ```bash
33
- sh scripts/clean-tags.sh
34
- ```
28
+ > ⚠️ 衝突處理:如果刪除分支時遇到任何錯誤,立即暫停所有動作,列出錯誤訊息,等待使用者確認後再繼續。
35
29
 
36
30
  ---
37
31
 
@@ -48,5 +42,4 @@ git checkout master
48
42
  回報以下資訊:
49
43
 
50
44
  - 刪除了多少已合併分支
51
- - 刪除了多少不合規 tags
52
45
  - 當前所在分支
@@ -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,13 +2,60 @@
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.465-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.465-dev.1...v1.1.465-dev.2) (2026-08-19)
6
+
7
+ ### [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)
8
+
9
+
10
+ ### Features
11
+
12
+ * **payment:** 新增 getPaymentPromotions API 描述符 ([0319692](https://github.com/jetthai/cuora-module/commit/03196925d989333e4bdb11cd933c18b6ace65d83))
13
+
14
+ ### [1.1.465](https://github.com/jetthai/cuora-module/compare/v1.1.464...v1.1.465) (2026-08-17)
15
+
5
16
  ### [1.1.464](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.464) (2026-08-16)
6
17
 
18
+ ### [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)
19
+
20
+ ### [1.1.465](https://github.com/jetthai/cuora-module/compare/v1.1.464...v1.1.465) (2026-08-17)
21
+
22
+ ### [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)
23
+
24
+ ### [1.1.464](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.464) (2026-08-16)
25
+
26
+
7
27
  ### Bug Fixes
8
28
 
9
29
  - **deposit:** 切換存款活動不再重設使用者已選的通道 ([b9c1de2](https://github.com/jetthai/cuora-module/commit/b9c1de2f3665c56f52d7b074e892837e836d02fa))
10
30
  - **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
11
31
 
32
+ ### [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)
33
+
34
+
35
+ ### Bug Fixes
36
+
37
+ * **deposit:** 切換存款活動不再重設使用者已選的通道 ([b9c1de2](https://github.com/jetthai/cuora-module/commit/b9c1de2f3665c56f52d7b074e892837e836d02fa))
38
+
39
+ ### [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)
40
+
41
+ ### [1.1.463-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.463-dev.0) (2026-08-13)
42
+
43
+ ### [1.1.455-dev.8](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.455-dev.8) (2026-08-09)
44
+
45
+
46
+ ### Features
47
+
48
+ * **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
49
+
50
+
51
+ ### Bug Fixes
52
+
53
+ * **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
54
+ * **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
55
+ * **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
56
+ * **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
57
+ * **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
58
+
12
59
  ### [1.1.463](https://github.com/jetthai/cuora-module/compare/v1.1.462...v1.1.463) (2026-08-12)
13
60
 
14
61
  ### [1.1.462](https://github.com/jetthai/cuora-module/compare/v1.1.461...v1.1.462) (2026-08-10)
@@ -25,6 +72,44 @@ All notable changes to this project will be documented in this file. See [standa
25
72
 
26
73
  ### [1.1.456](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.456) (2026-08-09)
27
74
 
75
+ ### [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)
76
+
77
+ ### [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)
78
+
79
+ ### [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)
80
+
81
+ ### [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)
82
+
83
+ ### [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)
84
+
85
+ ### [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)
86
+
87
+ ### [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)
88
+
89
+ ### [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)
90
+
91
+
92
+ ### Bug Fixes
93
+
94
+ - **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
95
+
96
+ ### [1.1.455-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.455-dev.0) (2026-08-04)
97
+
98
+ ### [1.1.454-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.453...v1.1.454-dev.0) (2026-07-29)
99
+
100
+
101
+ ### Features
102
+
103
+ - **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
104
+
105
+
106
+ ### Bug Fixes
107
+
108
+ - **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
109
+ - **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
110
+ - **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
111
+ - **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
112
+
28
113
  ### [1.1.455](https://github.com/jetthai/cuora-module/compare/v1.1.453...v1.1.455) (2026-08-03)
29
114
 
30
115
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.464",
3
+ "version": "1.1.465-dev.2",
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 版號}-{分支名}.{遞增編號}
@@ -130,9 +130,9 @@ export default {
130
130
  method: 'get',
131
131
  params: { appSecret },
132
132
  }),
133
- getProgressDetail: ({ appSecret }) => ({
133
+ getProgressDetail: ({ appSecret, locale }) => ({
134
134
  url: 'activities/progress-details',
135
135
  method: 'get',
136
- params: { appSecret },
136
+ params: { appSecret, locale },
137
137
  }),
138
138
  }
@@ -259,4 +259,5 @@ export default {
259
259
  params: { requestId },
260
260
  isPublic: true,
261
261
  }),
262
+ getPaymentPromotions: () => ({ url: 'payment/v2/promotions', method: 'get' }),
262
263
  }
@@ -106,6 +106,7 @@ export default function (request) {
106
106
  return {
107
107
  signUpData: {
108
108
  provider: 'local',
109
+ birthday,
109
110
  ...pickBindData(event.data),
110
111
  birthday,
111
112
  email,
@@ -129,6 +130,7 @@ export default function (request) {
129
130
  return {
130
131
  signUpData: {
131
132
  provider: 'phone',
133
+ birthday,
132
134
  ...pickBindData(event.data),
133
135
  birthday,
134
136
  email,
@@ -151,6 +153,7 @@ export default function (request) {
151
153
  return {
152
154
  signUpData: {
153
155
  provider: 'email',
156
+ birthday,
154
157
  ...pickBindData(event.data),
155
158
  birthday,
156
159
  email,