@jetthai/cuora 1.1.476 → 1.1.477-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.
- package/.claude/commands/sync-ai-prompts.md +88 -1
- package/.claude/settings.local.json +3 -1
- package/.github/copilot-instructions.md +68 -58
- package/.husky/post-checkout +3 -3
- package/.husky/pre-push +1 -1
- package/.prettierignore +2 -1
- package/AGENTS.md +69 -59
- package/AI_PROMPT_SOURCE.md +69 -59
- package/CHANGELOG.md +323 -5
- package/CLAUDE.md +69 -59
- package/GEMINI.md +69 -59
- package/README.md +11 -12
- package/package.json +1 -1
- package/scripts/auto-version.js +1 -0
- package/scripts/branch-auto-npm-publish.js +9 -2
- package/src/api/account.js +0 -1
- package/src/api/activity.js +0 -37
- package/src/api/auth.js +0 -31
- package/src/api/game.js +0 -10
- package/src/api/payment.js +1 -52
- package/src/api/user.js +0 -16
- package/src/index.js +2 -2
- package/src/machine/activity/activity_cash.js +1 -0
- package/src/machine/activity/diamond_shop_activity_cash.js +0 -1
- package/src/machine/activity/fafafa_activity.js +0 -10
- package/src/machine/activity/index.js +0 -12
- package/src/machine/auth.js +37 -59
- package/src/machine/auth_otp_v3.js +30 -19
- package/src/machine/common.js +0 -55
- package/src/machine/deposit/crypto_qrcode_cash.js +2 -2
- package/src/machine/deposit/index.js +0 -28
- package/src/machine/deposit/manual_cash.js +0 -8
- package/src/machine/game_info.js +1 -12
- package/src/machine/game_v2_1.js +1 -89
- package/src/machine/honor_board_cash.js +15 -18
- package/src/machine/inbox.js +0 -12
- package/src/machine/index.js +0 -32
- package/src/machine/reward_cash.js +0 -39
- package/src/machine/user_reset_password.js +0 -13
- package/src/machine/user_sign_up.js +3 -0
- package/src/machine/websocket.js +0 -4
- package/src/machine/withdraw/index.js +0 -6
- package/src/request/request.js +0 -28
- package/src/util/constant.js +0 -1
- package/src/util/index.js +1 -4
- package/test/auth_otp_v3.test.js +192 -0
- package/src/machine/activity/activity.js +0 -209
- package/src/machine/activity/diamond_shop_activity_fc.js +0 -196
- package/src/machine/activity/diamond_shop_activity_vn.js +0 -178
- package/src/machine/activity/invite_friends_activity.js +0 -114
- package/src/machine/activity/mini_game_activity.js +0 -68
- package/src/machine/activity/return_bonus_activity.js +0 -153
- package/src/machine/auth_otp_v2.js +0 -177
- package/src/machine/bank_binding_amb.js +0 -146
- package/src/machine/bonus.js +0 -76
- package/src/machine/deposit/amb.js +0 -93
- package/src/machine/deposit/crypto_bank.js +0 -330
- package/src/machine/deposit/crypto_qrcode.js +0 -148
- package/src/machine/deposit/crypto_way.js +0 -252
- package/src/machine/deposit/deposit_fc.js +0 -272
- package/src/machine/deposit/direct.js +0 -310
- package/src/machine/deposit/float.js +0 -375
- package/src/machine/deposit/krway.js +0 -151
- package/src/machine/deposit/loadcard_vn.js +0 -351
- package/src/machine/deposit/manual_vn.js +0 -458
- package/src/machine/deposit/qrcode_v2.js +0 -338
- package/src/machine/deposit/usdt.js +0 -144
- package/src/machine/deposit/virtual_bank_vn.js +0 -269
- package/src/machine/deposit/vpay.js +0 -368
- package/src/machine/game_hot_new.js +0 -79
- package/src/machine/game_replay.js +0 -46
- package/src/machine/game_search_v2.js +0 -401
- package/src/machine/honor_board.js +0 -132
- package/src/machine/merge.js +0 -57
- package/src/machine/payment_data.js +0 -86
- package/src/machine/promotions.js +0 -170
- package/src/machine/reward.js +0 -255
- package/src/machine/reward_fc.js +0 -98
- package/src/machine/side.js +0 -154
- package/src/machine/side_v2.js +0 -211
- package/src/machine/vip_table.js +0 -57
- package/src/machine/welcome.js +0 -110
- package/src/machine/withdraw/withdraw_crypto_cash.js +0 -327
- package/src/machine/withdraw/withdraw_krway.js +0 -223
- package/src/machine/withdraw/withdraw_manual.js +0 -536
- package/src/util/math.js +0 -4
package/scripts/auto-version.js
CHANGED
|
@@ -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
|
|
18
|
-
execSync(`git push --no-verify
|
|
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 {
|
package/src/api/account.js
CHANGED
|
@@ -2,7 +2,6 @@ export default {
|
|
|
2
2
|
bindingStatus: () => ({ url: 'account-binding/status', method: 'GET' }),
|
|
3
3
|
applyBinding: (data) => ({ url: 'account-binding/bind', method: 'POST', params: data }),
|
|
4
4
|
bindingVerification: (data) => ({ url: 'account-binding/acknowledge', method: 'POST', params: data }),
|
|
5
|
-
bindThirdParty: (data) => ({ url: 'account-binding/bind-third-party', method: 'GET', params: data }),
|
|
6
5
|
bindPassword: (data) => ({ url: 'account-binding/bind-password', method: 'POST', params: data }),
|
|
7
6
|
resetOtp: (data) => ({ url: 'account-binding/reset-otp', method: 'POST', params: data }),
|
|
8
7
|
}
|
package/src/api/activity.js
CHANGED
|
@@ -18,39 +18,12 @@ export default {
|
|
|
18
18
|
params: { appSecret },
|
|
19
19
|
isPublic: true,
|
|
20
20
|
}),
|
|
21
|
-
getTournamentDetail: ({ activityNo, appSecret }) => ({
|
|
22
|
-
url: 'tournament/detail',
|
|
23
|
-
method: 'get',
|
|
24
|
-
params: { activityNo, appSecret },
|
|
25
|
-
isPublic: true,
|
|
26
|
-
}),
|
|
27
21
|
getActivityDetail: ({ activityNo, appSecret, silent = false }) => ({
|
|
28
22
|
url: 'activities',
|
|
29
23
|
method: 'get',
|
|
30
24
|
params: { activityNo, appSecret },
|
|
31
25
|
silent,
|
|
32
26
|
}),
|
|
33
|
-
getActivityRanking: ({ appSecret }) => ({
|
|
34
|
-
url: 'activities/activity/ranking',
|
|
35
|
-
method: 'get',
|
|
36
|
-
params: { appSecret },
|
|
37
|
-
isPublic: true,
|
|
38
|
-
}),
|
|
39
|
-
getAchievements: ({ limit, page, appSecret }) => ({
|
|
40
|
-
url: 'activities/achievements',
|
|
41
|
-
method: 'get',
|
|
42
|
-
params: {
|
|
43
|
-
limit,
|
|
44
|
-
page,
|
|
45
|
-
appSecret,
|
|
46
|
-
},
|
|
47
|
-
}),
|
|
48
|
-
getAchievementsProgress: ({ achievementNo, appSecret }) => ({
|
|
49
|
-
url: 'activities/achievements/progress',
|
|
50
|
-
method: 'get',
|
|
51
|
-
params: { achievementNo, appSecret },
|
|
52
|
-
}),
|
|
53
|
-
getAchievementsIssued: () => ({ url: 'activities/achievements/issue', method: 'get' }),
|
|
54
27
|
postPromoCode: (promoCode) => ({
|
|
55
28
|
url: 'activities/promo',
|
|
56
29
|
method: 'post',
|
|
@@ -85,7 +58,6 @@ export default {
|
|
|
85
58
|
settleAmount: (data) => ({ url: 'activities/exchange/diamond/settle', method: 'post', params: data }),
|
|
86
59
|
exchange: (data) => ({ url: 'activities/exchange', method: 'post', params: data }),
|
|
87
60
|
collect: (data) => ({ url: 'activities/collect', method: 'post', params: data }),
|
|
88
|
-
getVipTable: ({ appSecret }) => ({ url: 'activities/viptable', method: 'get', params: { appSecret } }),
|
|
89
61
|
getLevelBonusInfo: () => ({ url: 'activities/level-bonus/info', method: 'get' }),
|
|
90
62
|
getRankingList: () => ({ url: 'activities/ranking', method: 'get' }),
|
|
91
63
|
getPublicRankingList: ({ appSecret }) => ({
|
|
@@ -94,21 +66,12 @@ export default {
|
|
|
94
66
|
isPublic: true,
|
|
95
67
|
params: { appSecret },
|
|
96
68
|
}),
|
|
97
|
-
exchangeDiamond: ({ activityNo, exchangeAward = [] }) => ({
|
|
98
|
-
url: 'activities/exchange/diamond',
|
|
99
|
-
method: 'post',
|
|
100
|
-
params: {
|
|
101
|
-
activityNo,
|
|
102
|
-
exchangeAward,
|
|
103
|
-
},
|
|
104
|
-
}),
|
|
105
69
|
getHonorBroadcast: ({ isPwa = false, appSecret }) => ({
|
|
106
70
|
url: 'activities/honorBroadcast',
|
|
107
71
|
method: 'get',
|
|
108
72
|
params: { isPwa, appSecret },
|
|
109
73
|
isPublic: true,
|
|
110
74
|
}),
|
|
111
|
-
getInstantRebateCollectTime: () => ({ url: 'activities/rebate/collectTime', method: 'get' }),
|
|
112
75
|
instantRebateEstimate: () => ({ url: 'activities/rebate/estimate', method: 'get' }),
|
|
113
76
|
instantRebateCollect: () => ({ url: 'activities/rebate/collect', method: 'get' }),
|
|
114
77
|
instantRebateHistory: ({ startDate, endDate, appSecret }) => ({
|
package/src/api/auth.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import pickBy from 'lodash/pickBy'
|
|
2
2
|
export default {
|
|
3
|
-
guestLogin: () => ({
|
|
4
|
-
url: 'guestLogin',
|
|
5
|
-
method: 'post',
|
|
6
|
-
isPublic: true,
|
|
7
|
-
}),
|
|
8
3
|
login: ({ username, password, provider, countryCode, phone, email, dt, reCaptchaToken, additionalUserInfo, loginType, isSignature, idToken }) => ({
|
|
9
4
|
url: 'login',
|
|
10
5
|
method: 'post',
|
|
@@ -12,25 +7,6 @@ export default {
|
|
|
12
7
|
isPublic: true,
|
|
13
8
|
headers: { 'x-access-captcha': reCaptchaToken },
|
|
14
9
|
}),
|
|
15
|
-
loginApp: ({ provider, accessToken, channel, subchannel, dt, from, id, name, picture }) => ({
|
|
16
|
-
url: 'appLogin',
|
|
17
|
-
method: 'post',
|
|
18
|
-
params: {
|
|
19
|
-
provider,
|
|
20
|
-
data: {
|
|
21
|
-
accessToken,
|
|
22
|
-
channel,
|
|
23
|
-
subchannel,
|
|
24
|
-
dt,
|
|
25
|
-
from,
|
|
26
|
-
id,
|
|
27
|
-
name,
|
|
28
|
-
picture,
|
|
29
|
-
provider,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
isPublic: true,
|
|
33
|
-
}),
|
|
34
10
|
register: ({ ac, fc = null, reCaptchaToken, dt, ...rest }) => {
|
|
35
11
|
const params = pickBy({ ac, fc }, (value) => {
|
|
36
12
|
return value !== undefined && value !== null
|
|
@@ -47,13 +23,6 @@ export default {
|
|
|
47
23
|
}
|
|
48
24
|
},
|
|
49
25
|
logout: () => ({ url: 'logout', method: 'post' }),
|
|
50
|
-
// bindGet for 'google' | 'zalo' | 'facebook'
|
|
51
|
-
bindGet: ({ x, provider, redirectURI }) => ({ url: 'bind', method: 'get', params: { x, provider, redirectURI } }),
|
|
52
|
-
bindPost: ({ provider, countryCode, phone, email }) => ({
|
|
53
|
-
url: 'bind',
|
|
54
|
-
method: 'post',
|
|
55
|
-
params: { provider, countryCode, phone, email },
|
|
56
|
-
}),
|
|
57
26
|
checkAccount: ({ account, nick_name, strategy, appSecret }) => ({
|
|
58
27
|
url: 'checkAccount',
|
|
59
28
|
method: 'post',
|
package/src/api/game.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
getGameCategory: ({ id, first } = {}) => ({ method: 'get', url: 'game/list/v2/category', params: { id, first } }),
|
|
3
|
-
addFavoriteGame: (code) => ({ method: 'post', url: 'game/myfavorite/add', params: { games: [code] } }),
|
|
4
|
-
removeFavoriteGame: (code) => ({ method: 'post', url: 'game/myfavorite/remove', params: { games: [code] } }),
|
|
5
|
-
getStatements: () => ({ url: 'game/statements', method: 'get' }),
|
|
6
2
|
playGame: (params) => ({ url: 'game/play', method: 'get', params }),
|
|
7
3
|
demoGame: (params) => ({ url: 'game/demo', method: 'get', params, isPublic: true }),
|
|
8
4
|
logoutGame: ({ uid_site, provider_id }) => ({ url: 'game/logout', method: 'get', params: { uid_site, provider_id } }),
|
|
@@ -90,12 +86,6 @@ export default {
|
|
|
90
86
|
addListFavorite: (code) => ({ method: 'post', url: 'game/list/v3/addMyFavorite', params: { games: [code] } }),
|
|
91
87
|
removeListFavorite: (code) => ({ method: 'post', url: 'game/list/v3/removeMyFavorite', params: { games: [code] } }),
|
|
92
88
|
getGameInfo: ({ appSecret, gameCode }) => ({ method: 'get', url: 'game/info', params: { appSecret, gameCode } }),
|
|
93
|
-
getGameReplayInfo: ({ providerId, seqNo, lang, appSecret }) => ({
|
|
94
|
-
method: 'get',
|
|
95
|
-
url: 'game/gameReplay',
|
|
96
|
-
params: { providerId, seqNo, lang, appSecret },
|
|
97
|
-
isPublic: true,
|
|
98
|
-
}),
|
|
99
89
|
getFreeGameList: () => ({ method: 'get', url: 'activities/getFreeGameRewardList' }),
|
|
100
90
|
getFreeGameReward: ({ activityNo, receiveNo }) => ({ method: 'post', url: 'activities/getFreeGameReward', params: { activityNo, receiveNo } }),
|
|
101
91
|
getV3GameInfo: ({ appSecret, gameCodes }) => ({ method: 'post', url: 'game/list/v3/gameInfo', params: { appSecret, gameCodes } }),
|
package/src/api/payment.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
getPaymentHistory: (returnDays) => ({ url: 'payment/v2/history', method: 'post', params: { returnDays } }),
|
|
3
|
-
getSpotMarket: () => ({ url: 'payment/v2/spotmarket', method: 'get' }),
|
|
4
2
|
getTransactionHistory: (payload) => ({
|
|
5
3
|
url: 'payment/v2/transactionHistory',
|
|
6
4
|
method: 'post',
|
|
@@ -59,18 +57,6 @@ export default {
|
|
|
59
57
|
getBankList: (paymentMethod) => ({ url: `payment/v2/${paymentMethod}/getBankList`, method: 'get' }),
|
|
60
58
|
getBindingBankList: ({ appSecret }) => ({ url: 'payment/v2/getBindingBankList', method: 'get', params: { appSecret }, isPublic: true }),
|
|
61
59
|
getBindingPaymentList: ({ appSecret }) => ({ url: 'payment/v2/getBindingPaymentList', method: 'get', params: { appSecret } }),
|
|
62
|
-
getWithdrawBankList: () => ({ url: 'payment/v2/getWithdrawBankList', method: 'get' }),
|
|
63
|
-
makeTransaction: ({ type, payload, paymentMethod }) => ({
|
|
64
|
-
url: `payment/v2/${paymentMethod}/transaction`,
|
|
65
|
-
method: 'post',
|
|
66
|
-
params: {
|
|
67
|
-
transferType: type,
|
|
68
|
-
...payload,
|
|
69
|
-
},
|
|
70
|
-
}),
|
|
71
|
-
checkTransaction: (paymentMethod) => ({ url: `payment/v2/${paymentMethod}/checkTransaction`, method: 'post' }),
|
|
72
|
-
setBonusSetting: ({ bonus }) => ({ url: 'payment/v2/setting', method: 'post', params: { bonus } }),
|
|
73
|
-
getCurrentWithdrawRule: () => ({ url: 'payment/v2/getCurrentWithdrawRule', method: 'get' }),
|
|
74
60
|
getDoubleWalletWithdrawRule: ({ walletType }) => ({
|
|
75
61
|
url: 'payment/v2/withdrawRule',
|
|
76
62
|
method: 'post',
|
|
@@ -81,7 +67,6 @@ export default {
|
|
|
81
67
|
method: 'post',
|
|
82
68
|
params: { exchangeType, cryptoNetwork, targetAddress },
|
|
83
69
|
}),
|
|
84
|
-
mergeWallet: () => ({ url: 'payment/v2/mergeWallet', method: 'post' }),
|
|
85
70
|
getPaymentDetail: ({ transferType } = {}) => ({
|
|
86
71
|
url: 'payment/v2/paymentDetail',
|
|
87
72
|
method: 'post',
|
|
@@ -102,11 +87,6 @@ export default {
|
|
|
102
87
|
method: 'post',
|
|
103
88
|
params: { transferType: 'WITHDRAW', amount, cryptoCurrency, promotionsNo },
|
|
104
89
|
}),
|
|
105
|
-
getWithdrawExpectedResult: ({ method, amount, cryptoNetwork }) => ({
|
|
106
|
-
url: `payment/v2/${method}/expected/result`,
|
|
107
|
-
method: 'post',
|
|
108
|
-
params: { transferType: 'WITHDRAW', amount, cryptoNetwork },
|
|
109
|
-
}),
|
|
110
90
|
submitDepositTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo, receipt }) => ({
|
|
111
91
|
url: `payment/v2/${method}/transaction`,
|
|
112
92
|
method: 'post',
|
|
@@ -193,38 +173,6 @@ export default {
|
|
|
193
173
|
applyerHolderName,
|
|
194
174
|
},
|
|
195
175
|
}),
|
|
196
|
-
submitWithdrawTransactionManual: ({
|
|
197
|
-
method,
|
|
198
|
-
amount,
|
|
199
|
-
applyerBankCode,
|
|
200
|
-
applyerAccountNumber,
|
|
201
|
-
applyerIfscCode,
|
|
202
|
-
branch,
|
|
203
|
-
holderName,
|
|
204
|
-
cryptoCurrency,
|
|
205
|
-
cryptoNetwork,
|
|
206
|
-
targetAddress,
|
|
207
|
-
}) => ({
|
|
208
|
-
url: `payment/v2/${method}/withdraw-otp/verify`,
|
|
209
|
-
method: 'post',
|
|
210
|
-
params: {
|
|
211
|
-
transferType: 'WITHDRAW',
|
|
212
|
-
amount,
|
|
213
|
-
applyerBankCode,
|
|
214
|
-
applyerAccountNumber,
|
|
215
|
-
applyerIfscCode,
|
|
216
|
-
branch,
|
|
217
|
-
holderName,
|
|
218
|
-
cryptoCurrency,
|
|
219
|
-
cryptoNetwork,
|
|
220
|
-
targetAddress,
|
|
221
|
-
},
|
|
222
|
-
}),
|
|
223
|
-
submitWithdrawTransactionAmb: ({ method, amount }) => ({
|
|
224
|
-
url: `payment/v2/${method}/transaction`,
|
|
225
|
-
method: 'post',
|
|
226
|
-
params: { transferType: 'WITHDRAW', amount },
|
|
227
|
-
}),
|
|
228
176
|
getPromotionsList: () => ({ url: `payment/v2/bankWallet/promotions`, method: 'get' }),
|
|
229
177
|
getWithdrawRulePreview: ({ applyType, applyNo, amount, isFreeGame }) => ({
|
|
230
178
|
url: `payment/v2/bankWallet/promotion/preview`,
|
|
@@ -260,4 +208,5 @@ export default {
|
|
|
260
208
|
isPublic: true,
|
|
261
209
|
}),
|
|
262
210
|
getPaymentPromotions: () => ({ url: 'payment/v2/promotions', method: 'get' }),
|
|
211
|
+
setBonusSetting: ({ bonus }) => ({ url: 'payment/v2/setting', method: 'post', params: { bonus } }),
|
|
263
212
|
}
|
package/src/api/user.js
CHANGED
|
@@ -1,26 +1,16 @@
|
|
|
1
|
-
export const PASSWORD_RESET_INIT = 'otp-verifying'
|
|
2
|
-
export const PASSWORD_RESET_ALLOW = 'allow-change-password'
|
|
3
|
-
|
|
4
1
|
export default {
|
|
5
2
|
checkDt: () => ({ url: 'checkDt', method: 'get' }),
|
|
6
3
|
updateDt: (data) => ({ url: 'updateDt', method: 'post', params: data }),
|
|
7
4
|
getUserInfo: () => ({ url: 'self', method: 'get' }),
|
|
8
5
|
updateUserInfo: (data) => ({ url: 'self', method: 'post', params: data }),
|
|
9
6
|
changePassword: (data) => ({ url: 'settings/password', method: 'post', params: data }),
|
|
10
|
-
setPreference: ({ defaultCategory }) => ({ url: 'settings/preference', method: 'post', params: { defaultCategory } }),
|
|
11
7
|
resetOtp: ({ requestId, number }) => ({ url: 'reset', method: 'post', params: { requestId, number } }),
|
|
12
|
-
getAffiliate: () => ({ url: 'affiliate', method: 'get' }),
|
|
13
|
-
getAffiliateHome: () => ({ url: 'affiliate/home', method: 'get' }),
|
|
14
|
-
getAffiliateDashboard: () => ({ url: 'affiliate/dashboard', method: 'get' }),
|
|
15
|
-
getAffiliateDashboardList: ({ level, page, row }) => ({ url: 'affiliate/dashboard/list', method: 'post', params: { level, page, row } }),
|
|
16
|
-
postAffiliate: ({ affiliateCode }) => ({ url: 'affiliate', method: 'post', params: { affiliateCode } }),
|
|
17
8
|
getFriends: () => ({ url: 'friends', method: 'get' }),
|
|
18
9
|
getFriendsHome: () => ({ url: 'friends/home', method: 'get' }),
|
|
19
10
|
getFriendsDashboard: () => ({ url: 'friends/dashboard', method: 'get' }),
|
|
20
11
|
getFriendsDashboardList: ({ level, page, row }) => ({ url: 'friends/dashboard/list', method: 'post', params: { level, page, row } }),
|
|
21
12
|
getFriendsList: ({ type, page, row }) => ({ url: 'friends/reward-list', method: 'post', params: { type, page, row } }),
|
|
22
13
|
postFriends: ({ friendCode }) => ({ url: 'friends', method: 'post', params: { friendCode } }),
|
|
23
|
-
passwordRecovery: (recoveryData) => ({ url: 'recovery', method: 'post', params: recoveryData, isPublic: true }),
|
|
24
14
|
// passwordAbandon: ({ number }) => ({ url: 'recovery/abandon', method: 'post', params: { number }, isPublic: true }), 平台版和現金網未使用
|
|
25
15
|
// passwordAcknowledge: (acknowledgeData) => ({ url: 'recovery/acknowledge', method: 'post', params: acknowledgeData, isPublic: true }), 平台版和現金網未使用
|
|
26
16
|
verify: () => ({ url: 'verify', method: 'post' }),
|
|
@@ -50,12 +40,6 @@ export default {
|
|
|
50
40
|
params: { requestId, target, newPassword, appSecret },
|
|
51
41
|
isPublic: true,
|
|
52
42
|
}),
|
|
53
|
-
verifyV2Initiate: ({ strategy }) => ({
|
|
54
|
-
// strategy: 'phone' | 'email'
|
|
55
|
-
url: '/verify/v2/initiate',
|
|
56
|
-
method: 'post',
|
|
57
|
-
params: { strategy },
|
|
58
|
-
}),
|
|
59
43
|
otpAcknowledge: ({ requestId, target, code }) => ({
|
|
60
44
|
url: '/otpsso/acknowledge',
|
|
61
45
|
method: 'post',
|
package/src/index.js
CHANGED
|
@@ -2,6 +2,6 @@ import api from './api/index.js'
|
|
|
2
2
|
import machine from './machine/index.js'
|
|
3
3
|
import Request from './request/request.js'
|
|
4
4
|
import Config from './request/config.js'
|
|
5
|
-
import
|
|
5
|
+
import { constant, storage, paramStore } from './util/index.js'
|
|
6
6
|
|
|
7
|
-
export { api, machine, Request, Config,
|
|
7
|
+
export { api, machine, Request, Config, constant, storage, paramStore }
|
|
@@ -60,11 +60,6 @@ export default function (request, context) {
|
|
|
60
60
|
},
|
|
61
61
|
awarded: {
|
|
62
62
|
entry: 'setDuration',
|
|
63
|
-
on: {
|
|
64
|
-
REFRESH_ACTIVITY: {
|
|
65
|
-
target: 'loading',
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
63
|
after: {
|
|
69
64
|
1000: [{ target: 'loading', cond: 'shouldCheckNewPeriod' }, { target: 'awarded' }],
|
|
70
65
|
},
|
|
@@ -102,11 +97,6 @@ export default function (request, context) {
|
|
|
102
97
|
},
|
|
103
98
|
result: {
|
|
104
99
|
entry: 'setDuration',
|
|
105
|
-
on: {
|
|
106
|
-
REFRESH_ACTIVITY: {
|
|
107
|
-
target: 'loading',
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
100
|
after: {
|
|
111
101
|
1000: [{ target: 'loading', cond: 'shouldCheckNewPeriod' }, { target: 'result' }],
|
|
112
102
|
},
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
import activity from './activity.js'
|
|
2
1
|
import activity_cash from './activity_cash.js'
|
|
3
2
|
import continue_deposit_activity from './continue_deposit_activity.js'
|
|
4
3
|
import deposit_activity from './deposit_activity.js'
|
|
5
|
-
import diamond_shop_activity_fc from './diamond_shop_activity_fc.js'
|
|
6
|
-
import diamond_shop_activity_vn from './diamond_shop_activity_vn.js'
|
|
7
4
|
import diamond_shop_activity_cash from './diamond_shop_activity_cash.js'
|
|
8
5
|
import fafafa_activity from './fafafa_activity.js'
|
|
9
|
-
import invite_friends_activity from './invite_friends_activity.js'
|
|
10
6
|
import jackpot from './jackpot.js'
|
|
11
7
|
import friend_invite_friends_activity from './friend_invite_friends_activity.js'
|
|
12
8
|
import ranking_activity from './ranking_activity.js'
|
|
13
|
-
import return_bonus_activity from './return_bonus_activity.js'
|
|
14
9
|
import specify_bets_activity from './specify_bets_activity.js'
|
|
15
10
|
import specify_turnover_activity from './specify_turnover_activity.js'
|
|
16
11
|
import sign_in_activity from './sign_in_activity.js'
|
|
17
12
|
import time_bomb_activity from './time_bomb_activity.js'
|
|
18
|
-
import mini_game_activity from './mini_game_activity.js'
|
|
19
13
|
import roulette_activity_v2 from './roulette_activity_v2.js'
|
|
20
14
|
import sign_in_monthly_activity from './sign_in_monthly_activity.js'
|
|
21
15
|
import otp_verified_activity from './otp_verified_activity.js'
|
|
@@ -24,24 +18,18 @@ import instant_rebate_activity from './instant_rebate_activity.js'
|
|
|
24
18
|
import cash_rain_activity from './cash_rain_activity.js'
|
|
25
19
|
|
|
26
20
|
export default {
|
|
27
|
-
activity,
|
|
28
21
|
activity_cash,
|
|
29
22
|
continue_deposit_activity,
|
|
30
23
|
deposit_activity,
|
|
31
|
-
diamond_shop_activity_fc,
|
|
32
|
-
diamond_shop_activity_vn,
|
|
33
24
|
diamond_shop_activity_cash,
|
|
34
25
|
fafafa_activity,
|
|
35
|
-
invite_friends_activity,
|
|
36
26
|
jackpot,
|
|
37
27
|
friend_invite_friends_activity,
|
|
38
28
|
ranking_activity,
|
|
39
|
-
return_bonus_activity,
|
|
40
29
|
specify_bets_activity,
|
|
41
30
|
specify_turnover_activity,
|
|
42
31
|
sign_in_activity,
|
|
43
32
|
time_bomb_activity,
|
|
44
|
-
mini_game_activity,
|
|
45
33
|
roulette_activity_v2,
|
|
46
34
|
sign_in_monthly_activity,
|
|
47
35
|
otp_verified_activity,
|
package/src/machine/auth.js
CHANGED
|
@@ -10,7 +10,6 @@ import { readParamFromLocation, writeParam, normalize, AC_KEYS, FC_KEYS } from '
|
|
|
10
10
|
export default function (request) {
|
|
11
11
|
const { appSecret, clientId, sentry } = request.config
|
|
12
12
|
const tokenKey = `cuora_${clientId}`
|
|
13
|
-
const userKey = `cuora_tempuser`
|
|
14
13
|
const phoneCountryCode = 'phone_countrycode'
|
|
15
14
|
const accountPhoneKey = 'account_phone'
|
|
16
15
|
const accountEmailKey = 'account_email'
|
|
@@ -79,45 +78,56 @@ export default function (request) {
|
|
|
79
78
|
},
|
|
80
79
|
},
|
|
81
80
|
},
|
|
82
|
-
|
|
81
|
+
authenticated: {
|
|
83
82
|
invoke: {
|
|
84
|
-
src: '
|
|
83
|
+
src: 'fetchUserInfo',
|
|
85
84
|
onDone: {
|
|
86
|
-
target: '
|
|
87
|
-
actions: '
|
|
85
|
+
target: 'otpChecking',
|
|
86
|
+
actions: ['setUserInfo', 'extendToken'],
|
|
88
87
|
},
|
|
89
88
|
onError: {
|
|
90
|
-
target: '
|
|
91
|
-
actions: 'removeToken',
|
|
89
|
+
target: 'leaving',
|
|
92
90
|
},
|
|
93
91
|
},
|
|
94
92
|
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
otpChecking: {
|
|
94
|
+
initial: 'pending',
|
|
95
|
+
states: {
|
|
96
|
+
pending: {
|
|
97
|
+
after: {
|
|
98
|
+
TIMEOUT: {
|
|
99
|
+
target: 'fetching',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
101
102
|
},
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
fetching: {
|
|
104
|
+
invoke: {
|
|
105
|
+
src: 'fetchUserInfo',
|
|
106
|
+
onDone: {
|
|
107
|
+
target: 'pending',
|
|
108
|
+
actions: ['setUserInfo', 'extendToken'],
|
|
109
|
+
},
|
|
110
|
+
onError: {
|
|
111
|
+
target: 'pending',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
105
114
|
},
|
|
106
115
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
src: 'fetchUserInfo',
|
|
111
|
-
onDone: {
|
|
112
|
-
target: 'otpChecking',
|
|
113
|
-
actions: ['setUserInfo', 'extendToken'],
|
|
116
|
+
on: {
|
|
117
|
+
OTP_VERIFIED: {
|
|
118
|
+
target: 'bindBankChecking',
|
|
114
119
|
},
|
|
115
|
-
|
|
120
|
+
OTP_SKIP: {
|
|
121
|
+
target: 'bindBankChecking',
|
|
122
|
+
},
|
|
123
|
+
LOGOUT: {
|
|
116
124
|
target: 'leaving',
|
|
117
125
|
},
|
|
118
126
|
},
|
|
119
127
|
},
|
|
120
|
-
|
|
128
|
+
// 綁銀行與 OTP 同為登入完成前的關卡:放在 loginSuccess 之前,登入後的副作用(公告、活動彈窗等)
|
|
129
|
+
// 才不會在綁定窗開著時觸發。是否需要綁定由前端依 siteConfig 判斷,machine 只負責等待結果。
|
|
130
|
+
bindBankChecking: {
|
|
121
131
|
initial: 'pending',
|
|
122
132
|
states: {
|
|
123
133
|
pending: {
|
|
@@ -141,10 +151,10 @@ export default function (request) {
|
|
|
141
151
|
},
|
|
142
152
|
},
|
|
143
153
|
on: {
|
|
144
|
-
|
|
154
|
+
BIND_BANK_DONE: {
|
|
145
155
|
target: 'loginSuccess',
|
|
146
156
|
},
|
|
147
|
-
|
|
157
|
+
BIND_BANK_SKIP: {
|
|
148
158
|
target: 'loginSuccess',
|
|
149
159
|
},
|
|
150
160
|
LOGOUT: {
|
|
@@ -292,9 +302,6 @@ export default function (request) {
|
|
|
292
302
|
CLEAR: {
|
|
293
303
|
target: '.logout',
|
|
294
304
|
},
|
|
295
|
-
LOGIN_GUEST: {
|
|
296
|
-
target: '.authenticationGuest',
|
|
297
|
-
},
|
|
298
305
|
LOGIN_ID: {
|
|
299
306
|
target: '.authentication',
|
|
300
307
|
actions: ['setReCaptchaToken', 'setLoginId'],
|
|
@@ -307,16 +314,9 @@ export default function (request) {
|
|
|
307
314
|
target: '.authentication',
|
|
308
315
|
actions: ['setReCaptchaToken', 'setLoginEmail'],
|
|
309
316
|
},
|
|
310
|
-
LOGIN_LOCAL: {
|
|
311
|
-
target: '.authentication',
|
|
312
|
-
actions: 'setLoginLocal',
|
|
313
|
-
},
|
|
314
317
|
LOGIN_3PARTY: {
|
|
315
318
|
actions: 'redirectTo3Party',
|
|
316
319
|
},
|
|
317
|
-
LOGIN_APP: {
|
|
318
|
-
target: '.authenticationApp',
|
|
319
|
-
},
|
|
320
320
|
LOGIN_TELEGRAM: {
|
|
321
321
|
target: '.authentication',
|
|
322
322
|
actions: 'setLoginTelegram',
|
|
@@ -402,20 +402,6 @@ export default function (request) {
|
|
|
402
402
|
},
|
|
403
403
|
}
|
|
404
404
|
}),
|
|
405
|
-
setLoginLocal: assign((context, event) => {
|
|
406
|
-
const { username, password } = event.data
|
|
407
|
-
storage.set(userKey, username, {
|
|
408
|
-
path: '/',
|
|
409
|
-
maxAge: 60 * 60 * 24,
|
|
410
|
-
})
|
|
411
|
-
return {
|
|
412
|
-
loginData: {
|
|
413
|
-
provider: 'local',
|
|
414
|
-
username,
|
|
415
|
-
password,
|
|
416
|
-
},
|
|
417
|
-
}
|
|
418
|
-
}),
|
|
419
405
|
setLoginTelegram: assign((context, event) => {
|
|
420
406
|
const { loginType, additionalUserInfo, isSignature, idToken } = event.data
|
|
421
407
|
return {
|
|
@@ -569,19 +555,11 @@ export default function (request) {
|
|
|
569
555
|
}),
|
|
570
556
|
},
|
|
571
557
|
services: {
|
|
572
|
-
authenticateApp: async (context, event) => {
|
|
573
|
-
const { token } = await request.send(auth.loginApp(event.data))
|
|
574
|
-
return token
|
|
575
|
-
},
|
|
576
558
|
authenticate: async (context, event) => {
|
|
577
559
|
const data = { ...context.loginData, reCaptchaToken: context.reCaptchaToken }
|
|
578
560
|
const { token } = await request.send(auth.login(data))
|
|
579
561
|
return token
|
|
580
562
|
},
|
|
581
|
-
authenticateGuest: async (context, event) => {
|
|
582
|
-
const { token } = await request.send(auth.guestLogin())
|
|
583
|
-
return token
|
|
584
|
-
},
|
|
585
563
|
logout: async (context, event) => {
|
|
586
564
|
return await request.send(auth.logout())
|
|
587
565
|
},
|