@jetthai/cuora 1.1.465 → 1.1.466-dev.0

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
 
@@ -18,8 +18,8 @@
18
18
  "mcp__sentry__search_issues",
19
19
  "Bash(git add:*)",
20
20
  "Bash(git commit:*)",
21
- "Bash(sed -E 's/\\(_auth[A-Za-z]*=\\).*/\\\\1<redacted>/' ~/.npmrc)",
22
- "Bash(npm config *)"
21
+ "Bash(git branch:*)",
22
+ "Bash(git merge:*)"
23
23
  ]
24
24
  }
25
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,15 +2,101 @@
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.466-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.466...v1.1.466-dev.0) (2026-09-06)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **deposit:** 移除 crypto_way_cash 未使用的 sourceAddress 欄位 ([18a0247](https://github.com/jetthai/cuora-module/commit/18a024776ae315c7a2b2ba9018e8fdce1b660f1a))
11
+
12
+ ### [1.1.465-dev.4](https://github.com/jetthai/cuora-module/compare/v1.1.465...v1.1.465-dev.4) (2026-08-24)
13
+
14
+
15
+ ### Features
16
+
17
+ * **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
18
+ * **payment:** 新增 getPaymentPromotions API 描述符 ([0319692](https://github.com/jetthai/cuora-module/commit/03196925d989333e4bdb11cd933c18b6ace65d83))
19
+
20
+
21
+ ### Bug Fixes
22
+
23
+ * **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
24
+ * **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
25
+ * **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
26
+ * **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
27
+ * **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
28
+ * **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
29
+
30
+ ### [1.1.466](https://github.com/jetthai/cuora-module/compare/v1.1.465...v1.1.466) (2026-08-31)
31
+
32
+ ### [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)
33
+
34
+
35
+ ### Bug Fixes
36
+
37
+ * **auth:** 清除站台已停用登入方式殘留的記住帳號 ([2c6b965](https://github.com/jetthai/cuora-module/commit/2c6b96572108cfc977d7dc99635adebbee01db46))
38
+
39
+ ### [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)
40
+
41
+
42
+ ### Bug Fixes
43
+
44
+ * **release:** 拆分 branch/tag push 避免 tag 衝突導致 npm publish 被跳過 ([f2c4baa](https://github.com/jetthai/cuora-module/commit/f2c4baa7de0bfe50b6b0c70c5a2ed8749116d72a))
45
+
46
+ ### [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)
47
+
48
+ ### [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)
49
+
50
+
51
+ ### Features
52
+
53
+ * **payment:** 新增 getPaymentPromotions API 描述符 ([0319692](https://github.com/jetthai/cuora-module/commit/03196925d989333e4bdb11cd933c18b6ace65d83))
54
+
5
55
  ### [1.1.465](https://github.com/jetthai/cuora-module/compare/v1.1.464...v1.1.465) (2026-08-17)
6
56
 
7
57
  ### [1.1.464](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.464) (2026-08-16)
8
58
 
59
+ ### [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)
60
+
61
+ ### [1.1.465](https://github.com/jetthai/cuora-module/compare/v1.1.464...v1.1.465) (2026-08-17)
62
+
63
+ ### [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)
64
+
65
+ ### [1.1.464](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.464) (2026-08-16)
66
+
67
+
9
68
  ### Bug Fixes
10
69
 
11
70
  - **deposit:** 切換存款活動不再重設使用者已選的通道 ([b9c1de2](https://github.com/jetthai/cuora-module/commit/b9c1de2f3665c56f52d7b074e892837e836d02fa))
12
71
  - **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
13
72
 
73
+ ### [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)
74
+
75
+
76
+ ### Bug Fixes
77
+
78
+ * **deposit:** 切換存款活動不再重設使用者已選的通道 ([b9c1de2](https://github.com/jetthai/cuora-module/commit/b9c1de2f3665c56f52d7b074e892837e836d02fa))
79
+
80
+ ### [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)
81
+
82
+ ### [1.1.463-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.463...v1.1.463-dev.0) (2026-08-13)
83
+
84
+ ### [1.1.455-dev.8](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.455-dev.8) (2026-08-09)
85
+
86
+
87
+ ### Features
88
+
89
+ * **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
90
+
91
+
92
+ ### Bug Fixes
93
+
94
+ * **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
95
+ * **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
96
+ * **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
97
+ * **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
98
+ * **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
99
+
14
100
  ### [1.1.463](https://github.com/jetthai/cuora-module/compare/v1.1.462...v1.1.463) (2026-08-12)
15
101
 
16
102
  ### [1.1.462](https://github.com/jetthai/cuora-module/compare/v1.1.461...v1.1.462) (2026-08-10)
@@ -27,6 +113,44 @@ All notable changes to this project will be documented in this file. See [standa
27
113
 
28
114
  ### [1.1.456](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.456) (2026-08-09)
29
115
 
116
+ ### [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)
117
+
118
+ ### [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)
119
+
120
+ ### [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)
121
+
122
+ ### [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)
123
+
124
+ ### [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)
125
+
126
+ ### [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)
127
+
128
+ ### [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)
129
+
130
+ ### [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)
131
+
132
+
133
+ ### Bug Fixes
134
+
135
+ - **user_sign_up:** 明確輸入判定改用 !== undefined,修復三層解析成為死碼 ([770450e](https://github.com/jetthai/cuora-module/commit/770450e6065d42d497504d2f8630c6740ec1e7c4))
136
+
137
+ ### [1.1.455-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.455...v1.1.455-dev.0) (2026-08-04)
138
+
139
+ ### [1.1.454-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.453...v1.1.454-dev.0) (2026-07-29)
140
+
141
+
142
+ ### Features
143
+
144
+ - **api:** add GeeMee click-id & front-event fields to sendPixel builder ([d33e488](https://github.com/jetthai/cuora-module/commit/d33e488062f81976cff35ea43ea0f2c366a2a615))
145
+
146
+
147
+ ### Bug Fixes
148
+
149
+ - **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
150
+ - **request:** 非 public 請求缺少 token 時提前返回,不再送出後端 ([065095e](https://github.com/jetthai/cuora-module/commit/065095e31ffe1cb640f9aaf6c76bbd5c6892355c))
151
+ - **request:** 非 public 請求缺少 token 時改為 reject ERR_A103,觸發登出流程 ([e46281f](https://github.com/jetthai/cuora-module/commit/e46281f3ea16679404160366e4532969c3bf02ff))
152
+ - **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
153
+
30
154
  ### [1.1.455](https://github.com/jetthai/cuora-module/compare/v1.1.453...v1.1.455) (2026-08-03)
31
155
 
32
156
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.465",
3
+ "version": "1.1.466-dev.0",
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 {
@@ -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
  }
@@ -15,6 +15,13 @@ export default function (request) {
15
15
  const accountPhoneKey = 'account_phone'
16
16
  const accountEmailKey = 'account_email'
17
17
  const accountUsernameKey = 'account_username'
18
+ // loginMethods 的鍵 → setAccount 寫入的 storage key。
19
+ // LOGIN_ID 與 LOGIN_LOCAL 都寫 accountUsernameKey,兩者在 loginMethods 都算 'local',此對照無法由 key 名反推。
20
+ const rememberedAccountKeys = [
21
+ ['local', accountUsernameKey],
22
+ ['phone', accountPhoneKey],
23
+ ['email', accountEmailKey],
24
+ ]
18
25
 
19
26
  return createMachine(
20
27
  {
@@ -47,7 +54,7 @@ export default function (request) {
47
54
  src: 'fetchSiteConfig',
48
55
  onDone: {
49
56
  target: 'idle',
50
- actions: 'setSiteConfig',
57
+ actions: ['setSiteConfig', 'pruneRememberedAccounts'],
51
58
  },
52
59
  onError: {
53
60
  target: 'idle',
@@ -341,6 +348,19 @@ export default function (request) {
341
348
  siteConfig: { ...event.data, loginMethods: pickBy(loginMethods), registerMethods: pickBy(registerMethods) },
342
349
  }
343
350
  }),
351
+ // setAccount 寫入的帳號 TTL 是 31 天,且只互斥清除另外兩支 key,
352
+ // 後台關掉某種登入方式後殘值仍在,下游會把它回填進已改型別的輸入框(例如把 email 填進 phone-only 站台)。
353
+ // 非 assign action,故取得的是 setSiteConfig 套用後的 context。
354
+ pruneRememberedAccounts: (context) => {
355
+ // fetchSiteConfig 失敗會走 onError 不進到這裡;此處防的是回傳成功但 loginMethods 整包缺失,避免誤清全部記住的帳號。
356
+ const enabledMethods = context.siteConfig?.loginMethods
357
+ if (!enabledMethods || !Object.keys(enabledMethods).length) return
358
+ rememberedAccountKeys.forEach(([method, key]) => {
359
+ if (enabledMethods[method]) return
360
+ storage.remove(key)
361
+ if (method === 'phone') storage.remove(phoneCountryCode)
362
+ })
363
+ },
344
364
  setReCaptchaToken: assign((context, event) => {
345
365
  const { reCaptchaToken } = event.data
346
366
  return {
@@ -494,8 +514,6 @@ export default function (request) {
494
514
  nickname,
495
515
  }
496
516
 
497
- sentry?.captureMessage(`[Auth] RedirectTo3Party Data: ${JSON.stringify(messages)}`, { level: 'info' })
498
-
499
517
  // 空值一律不進 query。dt 與 fc 原本裸展開進 URLSearchParams,兩者為 undefined 時會被
500
518
  // 序列化成字面字串 dt=undefined / fc=undefined,後端收到的是 "undefined" 而非缺省
501
519
  const query = pickBy(
@@ -13,7 +13,6 @@ export default function (request, context) {
13
13
  selectedAmount,
14
14
 
15
15
  cryptos: [],
16
- sourceAddress: '',
17
16
  options: [],
18
17
 
19
18
  selectedCrypto: null,
@@ -110,10 +109,6 @@ export default function (request, context) {
110
109
  actions: 'setCrypto',
111
110
  internal: false,
112
111
  },
113
- SET_ADDRESS: {
114
- actions: 'setAddress',
115
- internal: false,
116
- },
117
112
  SET_AMOUNT: {
118
113
  target: '.debouncing',
119
114
  actions: 'setAmount',
@@ -179,11 +174,6 @@ export default function (request, context) {
179
174
  inputAmount: assign((context, event) => {
180
175
  return { selectedAmount: event.data }
181
176
  }),
182
- setAddress: assign((context, event) => {
183
- return {
184
- sourceAddress: event.data,
185
- }
186
- }),
187
177
  setCalculation: assign((context, event) => {
188
178
  // V2接口轉換中回傳的資料結構不同
189
179
  const { data } = event.data
@@ -260,7 +250,7 @@ export default function (request, context) {
260
250
  )
261
251
  },
262
252
  submitDeposit: async (context, event) => {
263
- const { selectedCrypto, selectedAmount, sourceAddress, promotion } = context
253
+ const { selectedCrypto, selectedAmount, promotion } = context
264
254
  // 防禦性檢查:將 amount 轉為數字型別,並驗證範圍合法性,避免非法金額送出 API
265
255
  const amount = +selectedAmount
266
256
  if (!amount || amount <= 0 || amount < selectedCrypto.minimum || amount > selectedCrypto.maximum) {
@@ -272,7 +262,6 @@ export default function (request, context) {
272
262
  amount: amount,
273
263
  cryptoCurrency: selectedCrypto.channel,
274
264
  cryptoNetwork: selectedCrypto.networkCode,
275
- sourceAddress: sourceAddress,
276
265
  promotionsNo: promotion?.promotionsNo,
277
266
  })
278
267
  )
@@ -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,
@@ -205,10 +208,6 @@ export default function (request) {
205
208
  acSource: hasExplicitAc ? 'signUpData' : acRead.from,
206
209
  }
207
210
 
208
- // 因 client-pwa-cash PR #805 的問題,暫時註解此 Sentry 上報
209
- // https://github.com/jetthai/client-pwa-cash/pull/805
210
- // sentry?.captureMessage(`[SignUp] Authenticate Data: ${JSON.stringify(messages)}`, { level: 'info' })
211
-
212
211
  const referralObj = {}
213
212
  if (![undefined, 'undefined', null, 'null'].includes(affiliateCode)) {
214
213
  referralObj.ac = affiliateCode
@@ -1,52 +0,0 @@
1
- # Auto Git Flow
2
-
3
- 請依序執行每個步驟進行完整的清理流程,每步執行前先告知使用者當前進度。
4
-
5
- ---
6
-
7
- ## Phase 1: 清理
8
-
9
- ### Step 1 — 刪除已合併到 master 的分支
10
-
11
- ```bash
12
- git checkout master
13
- git fetch --prune
14
- ```
15
-
16
- 刪除已合併至 master 的 remote 分支(排除 master/qa/dev/HEAD):
17
-
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 {}
20
- ```
21
-
22
- 刪除已合併至 master 的 local 分支(排除 master/qa/dev):
23
-
24
- ```bash
25
- git branch --merged master | grep -v -E "^\*?\s*(master|qa|dev)$" | xargs -r git branch -d
26
- ```
27
-
28
- ### Step 5 — 刪除不合規 tags
29
-
30
- 執行 `scripts/clean-tags.sh` 清理不符合正式版號格式的本地及遠端 tags:
31
-
32
- ```bash
33
- sh scripts/clean-tags.sh
34
- ```
35
-
36
- ---
37
-
38
- ## Phase 2: 完成
39
-
40
- ### Step 2 — 回報結果
41
-
42
- 切回 master 分支,顯示完成摘要:
43
-
44
- ```bash
45
- git checkout master
46
- ```
47
-
48
- 回報以下資訊:
49
-
50
- - 刪除了多少已合併分支
51
- - 刪除了多少不合規 tags
52
- - 當前所在分支