@jetthai/cuora 1.1.441 → 1.1.443-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.
- package/.claude/commands/auto-git-flow.md +5 -12
- package/.claude/commands/commit-push.md +15 -4
- package/.claude/commands/sync-ai-prompts.md +88 -1
- package/.claude/settings.local.json +3 -1
- package/.github/copilot-instructions.md +551 -399
- package/.husky/post-checkout +3 -3
- package/.husky/pre-push +1 -1
- package/.prettierignore +2 -1
- package/AGENTS.md +551 -399
- package/AI_PROMPT_SOURCE.md +662 -130
- package/CHANGELOG.md +306 -22
- package/CLAUDE.md +551 -399
- package/GEMINI.md +551 -399
- package/README.md +40 -137
- package/package.json +1 -1
- package/scripts/auto-version.js +1 -0
- package/src/api/activity.js +10 -0
- package/src/api/auth.js +2 -2
- package/src/machine/activity/activity_cash.js +18 -3
- package/src/machine/auth.js +2 -10
- package/src/machine/auth_otp_v3.js +11 -4
- package/src/machine/common.js +1 -15
- package/src/machine/ranking.js +43 -25
- package/src/machine/user_sign_up.js +7 -67
- package/src/request/request.js +21 -9
- package/src/util/err998SentryExtra.js +52 -0
- package/.claude/worktrees/geemee-sendpixel/.claude/commands/auto-git-flow.md +0 -52
- package/.claude/worktrees/geemee-sendpixel/.claude/commands/commit-push.md +0 -174
- package/.claude/worktrees/geemee-sendpixel/.claude/commands/create-branch.md +0 -142
- package/.claude/worktrees/geemee-sendpixel/.claude/commands/sync-ai-prompts.md +0 -93
- package/.claude/worktrees/geemee-sendpixel/.claude/settings.local.json +0 -23
- package/.claude/worktrees/geemee-sendpixel/.github/copilot-instructions.md +0 -696
- package/.claude/worktrees/geemee-sendpixel/.husky/post-checkout +0 -32
- package/.claude/worktrees/geemee-sendpixel/.husky/pre-commit +0 -2
- package/.claude/worktrees/geemee-sendpixel/.husky/pre-push +0 -36
- package/.claude/worktrees/geemee-sendpixel/.prettierignore +0 -1
- package/.claude/worktrees/geemee-sendpixel/.prettierrc +0 -7
- package/.claude/worktrees/geemee-sendpixel/AGENTS.md +0 -696
- package/.claude/worktrees/geemee-sendpixel/AI_PROMPT_SOURCE.md +0 -758
- package/.claude/worktrees/geemee-sendpixel/CHANGELOG.md +0 -1779
- package/.claude/worktrees/geemee-sendpixel/CLAUDE.md +0 -696
- package/.claude/worktrees/geemee-sendpixel/GEMINI.md +0 -696
- package/.claude/worktrees/geemee-sendpixel/README.md +0 -308
- package/.claude/worktrees/geemee-sendpixel/docs/kibana/crypto-way-deposit-amount-bug-analysis.md +0 -1003
- package/.claude/worktrees/geemee-sendpixel/docs/kibana/play-providerId-error.md +0 -202
- package/.claude/worktrees/geemee-sendpixel/docs/kibana/play-selectedWalletType.md +0 -1
- package/.claude/worktrees/geemee-sendpixel/docs/kibana/play-selectedWalletType_2.md +0 -1
- package/.claude/worktrees/geemee-sendpixel/docs/kibana/play-selectedWalletType_analysis.md +0 -565
- package/.claude/worktrees/geemee-sendpixel/package-lock.json +0 -2455
- package/.claude/worktrees/geemee-sendpixel/package.json +0 -34
- package/.claude/worktrees/geemee-sendpixel/scripts/auto-version.js +0 -68
- package/.claude/worktrees/geemee-sendpixel/scripts/auto-version.sh +0 -33
- package/.claude/worktrees/geemee-sendpixel/scripts/branch-auto-npm-publish.js +0 -29
- package/.claude/worktrees/geemee-sendpixel/scripts/check-version.sh +0 -36
- package/.claude/worktrees/geemee-sendpixel/scripts/clean-tags.sh +0 -59
- package/.claude/worktrees/geemee-sendpixel/src/api/account.js +0 -8
- package/.claude/worktrees/geemee-sendpixel/src/api/activity.js +0 -128
- package/.claude/worktrees/geemee-sendpixel/src/api/auth.js +0 -63
- package/.claude/worktrees/geemee-sendpixel/src/api/common.js +0 -17
- package/.claude/worktrees/geemee-sendpixel/src/api/form.js +0 -3
- package/.claude/worktrees/geemee-sendpixel/src/api/game.js +0 -114
- package/.claude/worktrees/geemee-sendpixel/src/api/index.js +0 -13
- package/.claude/worktrees/geemee-sendpixel/src/api/mailbox.js +0 -24
- package/.claude/worktrees/geemee-sendpixel/src/api/otp.js +0 -5
- package/.claude/worktrees/geemee-sendpixel/src/api/payment.js +0 -262
- package/.claude/worktrees/geemee-sendpixel/src/api/ranking.js +0 -27
- package/.claude/worktrees/geemee-sendpixel/src/api/user.js +0 -69
- package/.claude/worktrees/geemee-sendpixel/src/index.js +0 -7
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/activity.js +0 -209
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/activity_cash.js +0 -181
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/cash_rain_activity.js +0 -153
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/continue_deposit_activity.js +0 -146
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/deposit_activity.js +0 -95
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/diamond_shop_activity_cash.js +0 -179
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/diamond_shop_activity_fc.js +0 -196
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/diamond_shop_activity_vn.js +0 -178
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/fafafa_activity.js +0 -208
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/friend_invite_friends_activity.js +0 -287
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/index.js +0 -51
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/instant_rebate_activity.js +0 -209
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/invite_friends_activity.js +0 -114
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/jackpot.js +0 -74
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/mini_game_activity.js +0 -68
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/otp_verified_activity.js +0 -74
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/ranking_activity.js +0 -105
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/return_bonus_activity.js +0 -153
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/roulette_activity_v2.js +0 -95
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/sign_in_activity.js +0 -157
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/sign_in_monthly_activity.js +0 -65
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/specify_bets_activity.js +0 -157
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/specify_turnover_activity.js +0 -136
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/time_bomb_activity.js +0 -89
- package/.claude/worktrees/geemee-sendpixel/src/machine/activity/vip_card_activity.js +0 -187
- package/.claude/worktrees/geemee-sendpixel/src/machine/auth.js +0 -592
- package/.claude/worktrees/geemee-sendpixel/src/machine/auth_otp_v2.js +0 -177
- package/.claude/worktrees/geemee-sendpixel/src/machine/auth_otp_v3.js +0 -300
- package/.claude/worktrees/geemee-sendpixel/src/machine/bank_binding.js +0 -277
- package/.claude/worktrees/geemee-sendpixel/src/machine/bank_binding_amb.js +0 -146
- package/.claude/worktrees/geemee-sendpixel/src/machine/bonus.js +0 -76
- package/.claude/worktrees/geemee-sendpixel/src/machine/common.js +0 -418
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/amb.js +0 -93
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/crypto_bank.js +0 -330
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/crypto_bank_cash.js +0 -307
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/crypto_qrcode.js +0 -148
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/crypto_qrcode_cash.js +0 -131
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/crypto_way.js +0 -252
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/crypto_way_cash.js +0 -296
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/deposit_fc.js +0 -272
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/direct.js +0 -310
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/direct_cash.js +0 -225
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/float.js +0 -375
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/index.js +0 -49
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/krway.js +0 -151
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/loadcard_cash.js +0 -215
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/loadcard_vn.js +0 -351
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/manual_cash.js +0 -364
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/manual_vn.js +0 -458
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/qrcode_cash.js +0 -225
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/qrcode_v2.js +0 -338
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/usdt.js +0 -144
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/usdt_cash.js +0 -138
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/virtual_bank_cash.js +0 -209
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/virtual_bank_vn.js +0 -269
- package/.claude/worktrees/geemee-sendpixel/src/machine/deposit/vpay.js +0 -368
- package/.claude/worktrees/geemee-sendpixel/src/machine/error.js +0 -112
- package/.claude/worktrees/geemee-sendpixel/src/machine/game_betslip.js +0 -46
- package/.claude/worktrees/geemee-sendpixel/src/machine/game_favorite_v2.js +0 -160
- package/.claude/worktrees/geemee-sendpixel/src/machine/game_hot_new.js +0 -79
- package/.claude/worktrees/geemee-sendpixel/src/machine/game_info.js +0 -61
- package/.claude/worktrees/geemee-sendpixel/src/machine/game_replay.js +0 -46
- package/.claude/worktrees/geemee-sendpixel/src/machine/game_search_cash.js +0 -401
- package/.claude/worktrees/geemee-sendpixel/src/machine/game_search_v2.js +0 -401
- package/.claude/worktrees/geemee-sendpixel/src/machine/game_v2_1.js +0 -699
- package/.claude/worktrees/geemee-sendpixel/src/machine/honor_board.js +0 -132
- package/.claude/worktrees/geemee-sendpixel/src/machine/honor_board_cash.js +0 -89
- package/.claude/worktrees/geemee-sendpixel/src/machine/inbox.js +0 -489
- package/.claude/worktrees/geemee-sendpixel/src/machine/index.js +0 -89
- package/.claude/worktrees/geemee-sendpixel/src/machine/leaderboard.js +0 -130
- package/.claude/worktrees/geemee-sendpixel/src/machine/merge.js +0 -57
- package/.claude/worktrees/geemee-sendpixel/src/machine/navbar.js +0 -126
- package/.claude/worktrees/geemee-sendpixel/src/machine/payment_data.js +0 -86
- package/.claude/worktrees/geemee-sendpixel/src/machine/promotions.js +0 -170
- package/.claude/worktrees/geemee-sendpixel/src/machine/ranking.js +0 -219
- package/.claude/worktrees/geemee-sendpixel/src/machine/reward.js +0 -255
- package/.claude/worktrees/geemee-sendpixel/src/machine/reward_cash.js +0 -276
- package/.claude/worktrees/geemee-sendpixel/src/machine/reward_fc.js +0 -98
- package/.claude/worktrees/geemee-sendpixel/src/machine/roulette_v2.js +0 -280
- package/.claude/worktrees/geemee-sendpixel/src/machine/setting.js +0 -47
- package/.claude/worktrees/geemee-sendpixel/src/machine/side.js +0 -154
- package/.claude/worktrees/geemee-sendpixel/src/machine/side_cash.js +0 -111
- package/.claude/worktrees/geemee-sendpixel/src/machine/side_v2.js +0 -209
- package/.claude/worktrees/geemee-sendpixel/src/machine/user_info.js +0 -64
- package/.claude/worktrees/geemee-sendpixel/src/machine/user_photo.js +0 -65
- package/.claude/worktrees/geemee-sendpixel/src/machine/user_reset_password.js +0 -231
- package/.claude/worktrees/geemee-sendpixel/src/machine/user_sign_up.js +0 -244
- package/.claude/worktrees/geemee-sendpixel/src/machine/vip_table.js +0 -57
- package/.claude/worktrees/geemee-sendpixel/src/machine/websocket.js +0 -361
- package/.claude/worktrees/geemee-sendpixel/src/machine/welcome.js +0 -110
- package/.claude/worktrees/geemee-sendpixel/src/machine/withdraw/index.js +0 -11
- package/.claude/worktrees/geemee-sendpixel/src/machine/withdraw/withdraw_crypto_cash.js +0 -327
- package/.claude/worktrees/geemee-sendpixel/src/machine/withdraw/withdraw_krway.js +0 -223
- package/.claude/worktrees/geemee-sendpixel/src/machine/withdraw/withdraw_manual.js +0 -536
- package/.claude/worktrees/geemee-sendpixel/src/machine/withdraw/withdraw_manual_cash.js +0 -324
- package/.claude/worktrees/geemee-sendpixel/src/request/config.js +0 -41
- package/.claude/worktrees/geemee-sendpixel/src/request/request.js +0 -365
- package/.claude/worktrees/geemee-sendpixel/src/util/constant.js +0 -20
- package/.claude/worktrees/geemee-sendpixel/src/util/index.js +0 -6
- package/.claude/worktrees/geemee-sendpixel/src/util/math.js +0 -4
- package/.claude/worktrees/geemee-sendpixel/src/util/storage.js +0 -42
|
@@ -3,15 +3,13 @@ import auth from '../api/auth.js'
|
|
|
3
3
|
import storage from '../util/storage.js'
|
|
4
4
|
|
|
5
5
|
export default function (request) {
|
|
6
|
-
const { sentry
|
|
6
|
+
const { sentry } = request.config
|
|
7
7
|
return createMachine(
|
|
8
8
|
{
|
|
9
9
|
id: 'user_sign_up',
|
|
10
10
|
initial: 'idle',
|
|
11
11
|
context: {
|
|
12
12
|
provider: null,
|
|
13
|
-
channel: null,
|
|
14
|
-
subchannel: null,
|
|
15
13
|
signUpData: {},
|
|
16
14
|
fc: null,
|
|
17
15
|
reCaptchaToken: null,
|
|
@@ -74,22 +72,8 @@ export default function (request) {
|
|
|
74
72
|
return { fc }
|
|
75
73
|
}),
|
|
76
74
|
setSignUpId: assign((context, event) => {
|
|
77
|
-
const {
|
|
78
|
-
|
|
79
|
-
username,
|
|
80
|
-
nick_name,
|
|
81
|
-
password,
|
|
82
|
-
countryCode,
|
|
83
|
-
phone,
|
|
84
|
-
channel,
|
|
85
|
-
subchannel,
|
|
86
|
-
bankCode,
|
|
87
|
-
bankAccount,
|
|
88
|
-
holderName,
|
|
89
|
-
branch,
|
|
90
|
-
branchCode,
|
|
91
|
-
affiliateCode,
|
|
92
|
-
} = event.data
|
|
75
|
+
const { email, username, nick_name, password, countryCode, phone, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } =
|
|
76
|
+
event.data
|
|
93
77
|
return {
|
|
94
78
|
signUpData: {
|
|
95
79
|
provider: 'local',
|
|
@@ -106,26 +90,10 @@ export default function (request) {
|
|
|
106
90
|
branchCode,
|
|
107
91
|
affiliateCode,
|
|
108
92
|
},
|
|
109
|
-
channel,
|
|
110
|
-
subchannel,
|
|
111
93
|
}
|
|
112
94
|
}),
|
|
113
95
|
setSignUpPhone: assign((context, event) => {
|
|
114
|
-
const {
|
|
115
|
-
email,
|
|
116
|
-
countryCode,
|
|
117
|
-
phone,
|
|
118
|
-
nick_name,
|
|
119
|
-
password,
|
|
120
|
-
channel,
|
|
121
|
-
subchannel,
|
|
122
|
-
bankCode,
|
|
123
|
-
bankAccount,
|
|
124
|
-
holderName,
|
|
125
|
-
branch,
|
|
126
|
-
branchCode,
|
|
127
|
-
affiliateCode,
|
|
128
|
-
} = event.data
|
|
96
|
+
const { email, countryCode, phone, nick_name, password, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } = event.data
|
|
129
97
|
return {
|
|
130
98
|
signUpData: {
|
|
131
99
|
provider: 'phone',
|
|
@@ -141,26 +109,10 @@ export default function (request) {
|
|
|
141
109
|
branchCode,
|
|
142
110
|
affiliateCode,
|
|
143
111
|
},
|
|
144
|
-
channel,
|
|
145
|
-
subchannel,
|
|
146
112
|
}
|
|
147
113
|
}),
|
|
148
114
|
setSignUpEmail: assign((context, event) => {
|
|
149
|
-
const {
|
|
150
|
-
email,
|
|
151
|
-
nick_name,
|
|
152
|
-
password,
|
|
153
|
-
channel,
|
|
154
|
-
subchannel,
|
|
155
|
-
bankCode,
|
|
156
|
-
bankAccount,
|
|
157
|
-
holderName,
|
|
158
|
-
branch,
|
|
159
|
-
branchCode,
|
|
160
|
-
affiliateCode,
|
|
161
|
-
countryCode,
|
|
162
|
-
phone,
|
|
163
|
-
} = event.data
|
|
115
|
+
const { email, nick_name, password, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode, countryCode, phone } = event.data
|
|
164
116
|
return {
|
|
165
117
|
signUpData: {
|
|
166
118
|
provider: 'email',
|
|
@@ -176,12 +128,10 @@ export default function (request) {
|
|
|
176
128
|
countryCode,
|
|
177
129
|
phone,
|
|
178
130
|
},
|
|
179
|
-
channel,
|
|
180
|
-
subchannel,
|
|
181
131
|
}
|
|
182
132
|
}),
|
|
183
133
|
setRegistrationData: assign((context, event) => {
|
|
184
|
-
const { account, currency, site, strategy, uid
|
|
134
|
+
const { account, currency, site, strategy, uid } = event.data
|
|
185
135
|
return {
|
|
186
136
|
registrationData: {
|
|
187
137
|
account,
|
|
@@ -189,8 +139,6 @@ export default function (request) {
|
|
|
189
139
|
site,
|
|
190
140
|
strategy,
|
|
191
141
|
uid,
|
|
192
|
-
channel,
|
|
193
|
-
sub_channel,
|
|
194
142
|
},
|
|
195
143
|
}
|
|
196
144
|
}),
|
|
@@ -202,17 +150,12 @@ export default function (request) {
|
|
|
202
150
|
},
|
|
203
151
|
services: {
|
|
204
152
|
authenticate: async (context, event) => {
|
|
205
|
-
const {
|
|
153
|
+
const { signUpData, deviceTokenEnable } = context
|
|
206
154
|
const dt = deviceTokenEnable ? await request.config.getDt?.() : undefined
|
|
207
155
|
|
|
208
156
|
const affiliateCode = storage.get('ac') || signUpData?.affiliateCode
|
|
209
157
|
const messages = {
|
|
210
158
|
url: window.location.href,
|
|
211
|
-
channelOrders: [
|
|
212
|
-
{ channel: storage.get('channel'), subchannel: storage.get('subchannel') },
|
|
213
|
-
{ channel: defaultChannel, subchannel: defaultSubchannel },
|
|
214
|
-
{ channel: channel, subchannel: subchannel },
|
|
215
|
-
],
|
|
216
159
|
affiliateCode,
|
|
217
160
|
}
|
|
218
161
|
|
|
@@ -225,9 +168,6 @@ export default function (request) {
|
|
|
225
168
|
referralObj.ac = affiliateCode
|
|
226
169
|
}
|
|
227
170
|
|
|
228
|
-
referralObj.channel = storage.get('channel') || defaultChannel || channel
|
|
229
|
-
referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel
|
|
230
|
-
|
|
231
171
|
return await request.send(
|
|
232
172
|
auth.register({
|
|
233
173
|
...signUpData,
|
package/src/request/request.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import pickBy from 'lodash/pickBy.js'
|
|
2
2
|
import storage from '../util/storage.js'
|
|
3
|
+
import { getErr998SentryExtra } from '../util/err998SentryExtra.js'
|
|
3
4
|
|
|
4
5
|
// const pickBy = require('lodash/pickBy')
|
|
5
6
|
const supportVersion2List = [
|
|
@@ -171,6 +172,8 @@ export default class Request {
|
|
|
171
172
|
this.errorHandler = null
|
|
172
173
|
this.hosts = []
|
|
173
174
|
this.isBlocked = false
|
|
175
|
+
this.clientIp = '' // 由外部 plugin(如 clientIp.client.js)非同步寫入,用於 ERR_998 Sentry 回報
|
|
176
|
+
this.hostTester = null // 由外部 plugin(如 host.client.js)寫入,需提供 lastResults 陣列供 ERR_998 Sentry 回報使用
|
|
174
177
|
this.initialize()
|
|
175
178
|
}
|
|
176
179
|
|
|
@@ -219,15 +222,24 @@ export default class Request {
|
|
|
219
222
|
(error) => {
|
|
220
223
|
if (error.message === 'Network Error' || error.message === 'Request failed with status code 404') {
|
|
221
224
|
const endpoint = error.config?.url || ''
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
225
|
+
const method = error.config?.method || ''
|
|
226
|
+
const baseURL = error.config?.baseURL || ''
|
|
227
|
+
// 確實在線才以 warning 等級回報(連線不穩定多為使用者端網路問題,非應用程式錯誤)
|
|
228
|
+
const isOnline = typeof navigator !== 'undefined' ? navigator.onLine : true
|
|
229
|
+
if (isOnline) {
|
|
230
|
+
const errData998 = getErr998SentryExtra(this, { endpoint, method, baseURL })
|
|
231
|
+
const sentryError = new Error(`ERR_998:${error.message}`)
|
|
232
|
+
sentryError.name = 'ERR_998'
|
|
233
|
+
this.sentry?.captureException(sentryError, {
|
|
234
|
+
level: 'warning',
|
|
235
|
+
tags: errData998,
|
|
236
|
+
extra: {
|
|
237
|
+
...errData998,
|
|
238
|
+
version: this.config.version,
|
|
239
|
+
hostTestResults: this.hostTester?.lastResults || [],
|
|
240
|
+
},
|
|
241
|
+
})
|
|
242
|
+
}
|
|
231
243
|
return Promise.reject({ code: 'ERR_998', endpoint })
|
|
232
244
|
}
|
|
233
245
|
return Promise.reject(error.response?.data?.error || error)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// ERR_998(Network Error / 404)Sentry 回報資料組裝工具
|
|
2
|
+
// 集中組裝 tags/extra,避免在 request.js 內重複拼裝邏輯
|
|
3
|
+
export function getErr998SentryExtra(request, requestInfo) {
|
|
4
|
+
const relativePath = requestInfo?.endpoint || ''
|
|
5
|
+
const method = requestInfo?.method || ''
|
|
6
|
+
const baseURL = requestInfo?.baseURL || ''
|
|
7
|
+
const endpoint = buildFullUrl(baseURL, relativePath)
|
|
8
|
+
const apiHost = getUrlOrigin(baseURL) || getUrlOrigin(relativePath) || request?.config?.apiURL || ''
|
|
9
|
+
const uidSite = getUidSite()
|
|
10
|
+
|
|
11
|
+
return {
|
|
12
|
+
code: 'ERR_998',
|
|
13
|
+
endpoint: normalizeSentryTagValue(endpoint),
|
|
14
|
+
method,
|
|
15
|
+
site: request?.config?.clientId || '',
|
|
16
|
+
ip: request?.clientIp || '',
|
|
17
|
+
apiHost,
|
|
18
|
+
uidSite,
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function buildFullUrl(baseURL, path) {
|
|
23
|
+
if (!path) return baseURL || ''
|
|
24
|
+
if (!baseURL) return path
|
|
25
|
+
try {
|
|
26
|
+
const base = baseURL.endsWith('/') ? baseURL : baseURL + '/'
|
|
27
|
+
return new URL(path, base).href
|
|
28
|
+
} catch {
|
|
29
|
+
return path
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function getUrlOrigin(url) {
|
|
34
|
+
try {
|
|
35
|
+
return new URL(url).origin
|
|
36
|
+
} catch (error) {
|
|
37
|
+
return ''
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getUidSite() {
|
|
42
|
+
try {
|
|
43
|
+
return (typeof window !== 'undefined' && window.$nuxt?.$store?.state?.userInfo?.uid_site) || ''
|
|
44
|
+
} catch (error) {
|
|
45
|
+
return ''
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function normalizeSentryTagValue(value) {
|
|
50
|
+
if (value === undefined || value === null) return ''
|
|
51
|
+
return String(value).slice(0, 200)
|
|
52
|
+
}
|
|
@@ -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
|
-
- 當前所在分支
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
# Commit & Push
|
|
2
|
-
|
|
3
|
-
執行 git commit 和 push 流程,支援多種 commit message 生成方式。
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Step 1 — 同步遠端分支
|
|
8
|
-
|
|
9
|
-
檢查當前分支的遠端是否有更新:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
git fetch origin
|
|
13
|
-
git status
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
如果本地已經是最新(沒有 behind commits),直接進入 Step 2。
|
|
17
|
-
|
|
18
|
-
如果遠端有更新(本地 behind),執行 pull:
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
git pull
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
如果 pull 發生衝突:
|
|
25
|
-
|
|
26
|
-
1. 取消 merge:
|
|
27
|
-
```bash
|
|
28
|
-
git merge --abort
|
|
29
|
-
```
|
|
30
|
-
2. 告知使用者:「遠端有更新且與本地變更衝突,請先還原當前所有檔案的異動,還原完成後請回覆。」
|
|
31
|
-
3. 等待使用者回覆。
|
|
32
|
-
4. 使用者回覆後,重新執行 pull:
|
|
33
|
-
```bash
|
|
34
|
-
git pull
|
|
35
|
-
```
|
|
36
|
-
5. Pull 成功後,告知使用者:「遠端同步完成,請將剛才還原的異動重新加回,完成後請回覆。」
|
|
37
|
-
6. 等待使用者回覆確認已全部加回,再繼續後續流程。
|
|
38
|
-
|
|
39
|
-
出現錯誤則停止,詢問使用者要怎麼做。
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Step 2 — 檢查工作區狀態
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
git status
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
如果沒有任何變更(工作區乾淨),告知使用者「沒有需要提交的變更」並停止。
|
|
50
|
-
|
|
51
|
-
如果有變更,顯示變更檔案清單給使用者確認。
|
|
52
|
-
|
|
53
|
-
出現錯誤則停止,詢問使用者要怎麼做。
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## Step 3 — Stage 變更
|
|
58
|
-
|
|
59
|
-
將所有變更加入 staging area:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
git add -A
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
出現錯誤則停止,詢問使用者要怎麼做。
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
## Step 4 — 選擇 Commit Message 方式
|
|
70
|
-
|
|
71
|
-
使用 `AskUserQuestion` 工具顯示選單,讓使用者從以下選項中選擇:
|
|
72
|
-
|
|
73
|
-
- **自動生成** — AI 根據異動自動生成,直接使用
|
|
74
|
-
- **自動生成 + 修改** — AI 自動生成後,顯示給使用者確認或修改
|
|
75
|
-
- **手動輸入** — 完全由使用者手動輸入 commit message
|
|
76
|
-
|
|
77
|
-
使用者也可以選擇「Other」輸入自訂指示,AI 會根據指示和異動內容生成 commit message 並顯示給使用者確認。
|
|
78
|
-
|
|
79
|
-
等待使用者選擇。
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## Step 5 — 生成 Commit Message
|
|
84
|
-
|
|
85
|
-
根據使用者在 Step 3 的選擇執行:
|
|
86
|
-
|
|
87
|
-
### 選項 1 或 2:自動生成
|
|
88
|
-
|
|
89
|
-
分析 `git diff --cached` 的內容,生成符合 Conventional Commits 格式的 commit message:
|
|
90
|
-
|
|
91
|
-
- 格式:`type(scope): description`
|
|
92
|
-
- type:feat / fix / refactor / style / docs / chore / perf / test
|
|
93
|
-
- scope:根據變更的主要目錄或功能模組決定(可省略)
|
|
94
|
-
- description:簡潔描述變更內容(中文)
|
|
95
|
-
|
|
96
|
-
當變更涉及多個不同類型或模組時,自行分類並以條列式呈現:
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
type(scope): 主要描述
|
|
100
|
-
|
|
101
|
-
- type(scope): 細項描述 1
|
|
102
|
-
- type(scope): 細項描述 2
|
|
103
|
-
- type(scope): 細項描述 3
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
例如:
|
|
107
|
-
|
|
108
|
-
```
|
|
109
|
-
feat(payment): 新增加密貨幣存款功能
|
|
110
|
-
|
|
111
|
-
- feat(deposit): 新增 USDT 存款方式
|
|
112
|
-
- fix(withdraw): 修正提款金額驗證邏輯
|
|
113
|
-
- style(modal): 調整存款彈窗樣式
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
如果是選項 2,將生成的 message 顯示給使用者,等待使用者確認或提供修改後的版本。
|
|
117
|
-
|
|
118
|
-
### 選項 3:手動輸入
|
|
119
|
-
|
|
120
|
-
等待使用者輸入完整的 commit message。
|
|
121
|
-
|
|
122
|
-
### 選項 4:其他
|
|
123
|
-
|
|
124
|
-
等待使用者輸入自訂指示,然後結合 `git diff --cached` 的異動內容,根據使用者的指示生成 commit message,顯示給使用者確認或修改。
|
|
125
|
-
|
|
126
|
-
出現錯誤則停止,詢問使用者要怎麼做。
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## Step 6 — 執行 Commit
|
|
131
|
-
|
|
132
|
-
使用確定的 commit message 執行 commit:
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
git commit -m "<commit_message>"
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
如果 commit message 包含多行,使用:
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
git commit -m "<title>" -m "<body>"
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
出現錯誤則停止,詢問使用者要怎麼做。
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## Step 7 — 執行 Push
|
|
149
|
-
|
|
150
|
-
Commit 完成後直接執行 push,不需詢問使用者。
|
|
151
|
-
|
|
152
|
-
將 commit push 到遠端:
|
|
153
|
-
|
|
154
|
-
```bash
|
|
155
|
-
git push
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
如果當前分支沒有設定 upstream,使用:
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
git push --set-upstream origin <current_branch>
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
出現錯誤則停止,詢問使用者要怎麼做。
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
## Step 8 — 完成回報
|
|
169
|
-
|
|
170
|
-
顯示以下資訊:
|
|
171
|
-
|
|
172
|
-
- 分支名稱
|
|
173
|
-
- Commit message 內容
|
|
174
|
-
- Push 結果(成功/失敗)
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
# Create Branch
|
|
2
|
-
|
|
3
|
-
從目前 HEAD 建立新分支(feat / fix / hotfix),**建立後切換到該分支**。
|
|
4
|
-
|
|
5
|
-
- 分支命名:
|
|
6
|
-
- `feat` → `feat/well/{子名稱}`
|
|
7
|
-
- `fix` → `fix/well/{子名稱}`
|
|
8
|
-
- `hotfix` → `hotfix/{版號}`(例如 `hotfix/1.1.562`)
|
|
9
|
-
|
|
10
|
-
請依序執行每個步驟,每步執行前先告知使用者當前進度。
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Step 1 — 檢查工作區是否乾淨(忽略 submodule)
|
|
15
|
-
|
|
16
|
-
若有未提交的變更(staged、unstaged、untracked),立即終止並提醒使用者先處理(commit 或 stash)。**忽略 submodule 變更。**
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
git status --porcelain --ignore-submodules=all
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
若輸出非空,停止後續步驟並回報:
|
|
23
|
-
|
|
24
|
-
- 工作區目前有未提交的變更,為避免遺失,已中止操作
|
|
25
|
-
- 列出 `git status --short --ignore-submodules=all` 的結果
|
|
26
|
-
- 建議使用者先 `git commit` 或 `git stash` 後再重新執行
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Step 2 — 詢問 branch 類型
|
|
31
|
-
|
|
32
|
-
使用 `AskUserQuestion` 工具,讓使用者選擇 branch 類型:
|
|
33
|
-
|
|
34
|
-
- 問題:`請選擇要建立的 branch 類型?`
|
|
35
|
-
- header:`Branch 類型`
|
|
36
|
-
- 選項:
|
|
37
|
-
- `feat` — 新功能開發
|
|
38
|
-
- `fix` — Bug 修正
|
|
39
|
-
- `hotfix` — 緊急修復
|
|
40
|
-
|
|
41
|
-
將使用者選擇的答案儲存為 `<BRANCH_TYPE>`。
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Step 3 — 決定最終 branch 名稱
|
|
46
|
-
|
|
47
|
-
依 `<BRANCH_TYPE>` 分支處理:
|
|
48
|
-
|
|
49
|
-
### 若 `<BRANCH_TYPE>` 為 `hotfix`
|
|
50
|
-
|
|
51
|
-
使用 `AskUserQuestion` 工具,請使用者透過「Other」選項輸入版號:
|
|
52
|
-
|
|
53
|
-
- 問題:`請輸入 hotfix 版號(例如:1.1.562)?`
|
|
54
|
-
- header:`Hotfix 版號`
|
|
55
|
-
- 選項:
|
|
56
|
-
- 提供 1~2 個範例選項讓使用者參考(例如 `1.0.0`、`1.1.562`)
|
|
57
|
-
- 明確提示使用者應該選「Other」自行輸入
|
|
58
|
-
|
|
59
|
-
將使用者輸入的值儲存為 `<HOTFIX_VERSION>`。
|
|
60
|
-
|
|
61
|
-
**驗證規則**:
|
|
62
|
-
|
|
63
|
-
- 不可為空
|
|
64
|
-
- 必須符合 `^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$` 格式(不含 `v` 前綴)
|
|
65
|
-
- 若不符合規則,請使用者重新輸入
|
|
66
|
-
|
|
67
|
-
組合:
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
<FINAL_BRANCH_NAME> = hotfix/<HOTFIX_VERSION>
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
例如 `hotfix/1.1.562`。跳到 Step 4。
|
|
74
|
-
|
|
75
|
-
### 若 `<BRANCH_TYPE>` 為 `feat` 或 `fix`
|
|
76
|
-
|
|
77
|
-
使用 `AskUserQuestion` 工具,請使用者透過「Other」選項自行輸入 branch 子名稱:
|
|
78
|
-
|
|
79
|
-
- 問題:`請輸入 branch 子名稱(例如:login-fix、header-refactor)?`
|
|
80
|
-
- header:`子名稱`
|
|
81
|
-
- 選項:
|
|
82
|
-
- 提供 2 個範例選項讓使用者參考(例如 `example-feature`、`example-bug`)
|
|
83
|
-
- 明確提示使用者應該選「Other」自行輸入
|
|
84
|
-
|
|
85
|
-
將使用者輸入的值儲存為 `<BRANCH_SUBNAME>`。
|
|
86
|
-
|
|
87
|
-
**驗證規則**:
|
|
88
|
-
|
|
89
|
-
- 不可為空
|
|
90
|
-
- 只允許英文字母、數字、連字號(`-`)、底線(`_`)、斜線(`/`)
|
|
91
|
-
- 若不符合規則,請使用者重新輸入
|
|
92
|
-
|
|
93
|
-
組合:
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
<FINAL_BRANCH_NAME> = <BRANCH_TYPE>/well/<BRANCH_SUBNAME>
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
範例:
|
|
100
|
-
|
|
101
|
-
- `feat/well/login-page`
|
|
102
|
-
- `fix/well/header-layout`
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
## Step 4 — 檢查 branch 是否已存在
|
|
107
|
-
|
|
108
|
-
檢查 `<FINAL_BRANCH_NAME>` 是否已存在(本地或遠端):
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
git rev-parse --verify <FINAL_BRANCH_NAME> 2>/dev/null
|
|
112
|
-
git ls-remote --exit-code --heads origin <FINAL_BRANCH_NAME> 2>/dev/null
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
若已存在,停止並告知使用者:
|
|
116
|
-
|
|
117
|
-
- hotfix 場景:該版號的 hotfix 分支已存在,建議改用其他版號或先處理舊分支再重試
|
|
118
|
-
- feat / fix 場景:建議改用其他子名稱
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
## Step 5 — 建立新 branch 並切換
|
|
123
|
-
|
|
124
|
-
從目前 HEAD 建立新分支,**並切換到該分支**:
|
|
125
|
-
|
|
126
|
-
```bash
|
|
127
|
-
git checkout -b <FINAL_BRANCH_NAME>
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
若失敗則停止並回報原因。
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
## Step 6 — 回報結果
|
|
135
|
-
|
|
136
|
-
顯示完成摘要:
|
|
137
|
-
|
|
138
|
-
- 新 branch 名稱:`<FINAL_BRANCH_NAME>`
|
|
139
|
-
- 基於的 commit SHA(短版,`git log -1 --pretty=format:'%h'`)與訊息首行(`git log -1 --pretty=format:'%s'`)
|
|
140
|
-
- 已切換到新分支
|
|
141
|
-
- 提示使用者:
|
|
142
|
-
- 若要推送到遠端,可執行 `git push -u origin <FINAL_BRANCH_NAME>`
|