@jetthai/cuora 2.0.0-beta.1 → 2.0.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 +93 -0
- package/.claude/settings.local.json +23 -0
- package/.github/copilot-instructions.md +405 -0
- package/.husky/post-checkout +32 -0
- package/.husky/pre-commit +1 -3
- package/.husky/pre-push +36 -0
- package/AGENTS.md +405 -0
- package/AI_PROMPT_SOURCE.md +403 -0
- package/CHANGELOG.md +274 -3
- package/CLAUDE.md +405 -0
- package/GEMINI.md +405 -0
- package/README.md +299 -15
- package/docs/kibana/crypto-way-deposit-amount-bug-analysis.md +1003 -0
- package/docs/kibana/play-providerId-error.md +202 -0
- package/docs/kibana/play-selectedWalletType.md +1 -0
- package/docs/kibana/play-selectedWalletType_2.md +1 -0
- package/docs/kibana/play-selectedWalletType_analysis.md +565 -0
- package/package.json +3 -3
- package/scripts/auto-version.js +68 -0
- package/scripts/auto-version.sh +33 -0
- package/scripts/branch-auto-npm-publish.js +29 -0
- package/scripts/check-version.sh +36 -0
- package/scripts/clean-tags.sh +84 -0
- package/src/api/account.js +0 -1
- package/src/api/activity.js +22 -37
- package/src/api/auth.js +5 -36
- package/src/api/common.js +5 -3
- package/src/api/game.js +0 -10
- package/src/api/payment.js +17 -55
- package/src/api/user.js +10 -16
- package/src/index.js +2 -2
- package/src/machine/activity/activity_cash.js +84 -36
- package/src/machine/activity/cash_rain_activity.js +0 -1
- package/src/machine/activity/continue_deposit_activity.js +0 -1
- package/src/machine/activity/deposit_activity.js +0 -1
- package/src/machine/activity/diamond_shop_activity_cash.js +0 -8
- package/src/machine/activity/fafafa_activity.js +0 -11
- package/src/machine/activity/friend_invite_friends_activity.js +8 -7
- package/src/machine/activity/index.js +0 -12
- package/src/machine/activity/instant_rebate_activity.js +0 -1
- package/src/machine/activity/jackpot.js +0 -1
- package/src/machine/activity/otp_verified_activity.js +0 -1
- package/src/machine/activity/ranking_activity.js +0 -1
- package/src/machine/activity/roulette_activity_v2.js +0 -1
- package/src/machine/activity/sign_in_activity.js +0 -1
- package/src/machine/activity/sign_in_monthly_activity.js +1 -2
- package/src/machine/activity/specify_bets_activity.js +0 -1
- package/src/machine/activity/specify_turnover_activity.js +0 -1
- package/src/machine/activity/time_bomb_activity.js +0 -1
- package/src/machine/activity/vip_card_activity.js +0 -1
- package/src/machine/auth.js +112 -113
- package/src/machine/auth_otp_v3.js +11 -8
- package/src/machine/bank_binding.js +2 -3
- package/src/machine/common.js +14 -112
- package/src/machine/deposit/crypto_bank_cash.js +20 -35
- package/src/machine/deposit/crypto_qrcode_cash.js +26 -64
- package/src/machine/deposit/crypto_way_cash.js +48 -37
- package/src/machine/deposit/direct_cash.js +8 -10
- package/src/machine/deposit/index.js +0 -28
- package/src/machine/deposit/loadcard_cash.js +14 -32
- package/src/machine/deposit/manual_cash.js +18 -28
- package/src/machine/deposit/qrcode_cash.js +15 -32
- package/src/machine/deposit/usdt_cash.js +1 -15
- package/src/machine/deposit/virtual_bank_cash.js +13 -12
- package/src/machine/error.js +7 -1
- package/src/machine/game_betslip.js +0 -1
- package/src/machine/game_favorite_v2.js +0 -1
- package/src/machine/game_info.js +1 -13
- package/src/machine/game_search_cash.js +2 -13
- package/src/machine/game_v2_1.js +42 -166
- package/src/machine/honor_board_cash.js +8 -11
- package/src/machine/inbox.js +43 -105
- package/src/machine/index.js +0 -32
- package/src/machine/leaderboard.js +8 -12
- package/src/machine/navbar.js +1 -3
- package/src/machine/ranking.js +45 -30
- package/src/machine/reward_cash.js +0 -40
- package/src/machine/roulette_v2.js +14 -11
- package/src/machine/setting.js +0 -1
- package/src/machine/side_cash.js +3 -3
- package/src/machine/user_info.js +0 -1
- package/src/machine/user_photo.js +0 -1
- package/src/machine/user_reset_password.js +0 -14
- package/src/machine/user_sign_up.js +46 -61
- package/src/machine/websocket.js +18 -62
- package/src/machine/withdraw/index.js +0 -6
- package/src/machine/withdraw/withdraw_manual_cash.js +59 -39
- package/src/request/config.js +2 -0
- package/src/request/request.js +49 -60
- package/src/util/amount.js +8 -0
- package/src/util/constant.js +0 -1
- package/src/util/err998SentryExtra.js +26 -0
- package/src/util/index.js +2 -4
- package/src/util/paramStore.js +139 -0
- package/src/util/storage.js +3 -4
- package/BREAKING_CHANGES.md +0 -9
- package/resetGitBranch.sh +0 -101
- package/src/lib/fingerprint_v3_11_12.js +0 -11433
- package/src/machine/activity/activity.js +0 -213
- package/src/machine/activity/diamond_shop_activity_fc.js +0 -197
- package/src/machine/activity/diamond_shop_activity_vn.js +0 -179
- package/src/machine/activity/invite_friends_activity.js +0 -115
- package/src/machine/activity/mini_game_activity.js +0 -69
- package/src/machine/activity/return_bonus_activity.js +0 -155
- package/src/machine/auth_otp_v2.js +0 -178
- 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 -340
- package/src/machine/deposit/crypto_qrcode.js +0 -158
- package/src/machine/deposit/crypto_way.js +0 -253
- package/src/machine/deposit/deposit_fc.js +0 -272
- package/src/machine/deposit/direct.js +0 -311
- package/src/machine/deposit/float.js +0 -375
- package/src/machine/deposit/krway.js +0 -152
- package/src/machine/deposit/loadcard_vn.js +0 -352
- package/src/machine/deposit/manual_vn.js +0 -463
- package/src/machine/deposit/qrcode_v2.js +0 -339
- package/src/machine/deposit/usdt.js +0 -163
- package/src/machine/deposit/virtual_bank_vn.js +0 -270
- package/src/machine/deposit/vpay.js +0 -374
- package/src/machine/game_hot_new.js +0 -91
- package/src/machine/game_replay.js +0 -47
- package/src/machine/game_search_v2.js +0 -402
- package/src/machine/honor_board.js +0 -144
- package/src/machine/merge.js +0 -58
- package/src/machine/payment_data.js +0 -87
- package/src/machine/promotions.js +0 -163
- package/src/machine/reward.js +0 -256
- package/src/machine/reward_fc.js +0 -99
- package/src/machine/side.js +0 -160
- package/src/machine/side_v2.js +0 -223
- package/src/machine/vip_table.js +0 -58
- package/src/machine/welcome.js +0 -111
- package/src/machine/withdraw/withdraw_crypto_cash.js +0 -328
- package/src/machine/withdraw/withdraw_krway.js +0 -223
- package/src/machine/withdraw/withdraw_manual.js +0 -541
- package/src/util/deviceToken.js +0 -60
- package/src/util/math.js +0 -4
- package/test/api.behavior.test.js +0 -69
- package/test/api.contract.test.js +0 -18
- package/test/config.test.js +0 -27
- package/test/deviceToken.test.js +0 -139
- package/test/helpers.coverage.test.js +0 -11
- package/test/helpers.js +0 -91
- package/test/index.exports.test.js +0 -14
- package/test/machine.activity.core.coverage.test.js +0 -337
- package/test/machine.activity.gap.coverage.test.js +0 -252
- package/test/machine.activity.more.coverage.test.js +0 -180
- package/test/machine.activity_plus_and_binding_amb.coverage.test.js +0 -201
- package/test/machine.activity_timer_bonus.coverage.test.js +0 -136
- package/test/machine.activity_welcome.low.coverage.test.js +0 -211
- package/test/machine.amb_rewardfc_websocket.more.coverage.test.js +0 -201
- package/test/machine.auth.coverage.test.js +0 -215
- package/test/machine.bank_binding.test.js +0 -143
- package/test/machine.binding_otp_krway.coverage.test.js +0 -223
- package/test/machine.contract.test.js +0 -50
- package/test/machine.crypto_bank.coverage.test.js +0 -270
- package/test/machine.crypto_way.coverage.test.js +0 -108
- package/test/machine.crypto_way_cash.coverage.test.js +0 -114
- package/test/machine.definition.test.js +0 -137
- package/test/machine.deposit.manual.coverage.test.js +0 -365
- package/test/machine.deposit_fc.coverage.test.js +0 -126
- package/test/machine.direct.coverage.test.js +0 -96
- package/test/machine.direct_cash.coverage.test.js +0 -108
- package/test/machine.error.coverage.test.js +0 -37
- package/test/machine.events.test.js +0 -126
- package/test/machine.favorite_jackpot.coverage.test.js +0 -82
- package/test/machine.float.coverage.test.js +0 -136
- package/test/machine.flow.test.js +0 -226
- package/test/machine.game_hot_new_vip_table.coverage.test.js +0 -105
- package/test/machine.game_search_cash.coverage.test.js +0 -195
- package/test/machine.game_search_v2.test.js +0 -199
- package/test/machine.game_user_profile.coverage.test.js +0 -100
- package/test/machine.honor_board.test.js +0 -148
- package/test/machine.inbox.common.coverage.test.js +0 -304
- package/test/machine.loadcard_cash.coverage.test.js +0 -101
- package/test/machine.loadcard_vn.coverage.test.js +0 -122
- package/test/machine.misc.coverage.test.js +0 -361
- package/test/machine.more2.coverage.test.js +0 -261
- package/test/machine.options.execution.test.js +0 -272
- package/test/machine.priority.coverage.test.js +0 -629
- package/test/machine.qrcode_cash.coverage.test.js +0 -107
- package/test/machine.qrcode_v2.coverage.test.js +0 -121
- package/test/machine.regression.test.js +0 -82
- package/test/machine.roulette_v2.test.js +0 -142
- package/test/machine.side_reward_reset.coverage.test.js +0 -220
- package/test/machine.targeted.coverage.test.js +0 -313
- package/test/machine.usdt.coverage.test.js +0 -95
- package/test/machine.usdt_cash.coverage.test.js +0 -73
- package/test/machine.vip_card_activity.test.js +0 -114
- package/test/machine.virtual_bank_cash.coverage.test.js +0 -105
- package/test/machine.virtual_bank_vn.coverage.test.js +0 -105
- package/test/machine.vpay.coverage.test.js +0 -142
- package/test/machine.withdraw_crypto_cash.coverage.test.js +0 -166
- package/test/machine.withdraw_krway.coverage.test.js +0 -123
- package/test/machine.withdraw_manual.coverage.test.js +0 -185
- package/test/machine.withdraw_manual_cash.coverage.test.js +0 -123
- package/test/request.test.js +0 -325
- package/test/util.storage.errors.test.js +0 -47
- package/test/util.test.js +0 -41
|
@@ -7,17 +7,18 @@ export default function (request) {
|
|
|
7
7
|
return createMachine(
|
|
8
8
|
{
|
|
9
9
|
id: 'activity',
|
|
10
|
-
predictableActionArguments: true,
|
|
11
10
|
initial: 'fetchingList',
|
|
12
11
|
context: {
|
|
13
12
|
tick: 2000,
|
|
14
13
|
activityList: [],
|
|
14
|
+
progressSummary: {},
|
|
15
15
|
tournamentList: [],
|
|
16
16
|
promotionList: [],
|
|
17
17
|
uidSite: '',
|
|
18
18
|
detailNeededActivityTypes: [4, 29, 34],
|
|
19
19
|
activityDetailList: [],
|
|
20
20
|
isPlaying: false,
|
|
21
|
+
listAuthKey: null,
|
|
21
22
|
},
|
|
22
23
|
states: {
|
|
23
24
|
fetchingList: {
|
|
@@ -25,7 +26,7 @@ export default function (request) {
|
|
|
25
26
|
src: 'fetchList',
|
|
26
27
|
onDone: {
|
|
27
28
|
target: 'checking',
|
|
28
|
-
actions: ['setActivityList', 'setTournamentList', 'setPromotionList'],
|
|
29
|
+
actions: ['setActivityList', 'setTournamentList', 'setPromotionList', 'setListAuthKey'],
|
|
29
30
|
},
|
|
30
31
|
onError: {
|
|
31
32
|
target: 'pending',
|
|
@@ -40,7 +41,7 @@ export default function (request) {
|
|
|
40
41
|
src: 'fetchActivityDetailList',
|
|
41
42
|
onDone: {
|
|
42
43
|
target: 'pending',
|
|
43
|
-
actions: 'setActivityDetailList',
|
|
44
|
+
actions: ['setActivityDetailList', 'setProgressSummary'],
|
|
44
45
|
},
|
|
45
46
|
onError: {
|
|
46
47
|
target: 'pending',
|
|
@@ -58,16 +59,18 @@ export default function (request) {
|
|
|
58
59
|
SET_UNREAD: {
|
|
59
60
|
actions: 'setUnread',
|
|
60
61
|
},
|
|
61
|
-
REFRESH: {
|
|
62
|
-
target: '#activity.fetchingList',
|
|
63
|
-
actions: 'leaveGame',
|
|
64
|
-
},
|
|
65
62
|
RESET_ACTIVITIES: {
|
|
66
63
|
actions: 'resetActivities',
|
|
67
64
|
},
|
|
68
65
|
},
|
|
69
66
|
},
|
|
70
67
|
},
|
|
68
|
+
on: {
|
|
69
|
+
REFRESH: {
|
|
70
|
+
target: '#activity.fetchingList',
|
|
71
|
+
actions: 'leaveGame',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
71
74
|
},
|
|
72
75
|
{
|
|
73
76
|
actions: {
|
|
@@ -80,23 +83,30 @@ export default function (request) {
|
|
|
80
83
|
}),
|
|
81
84
|
setActivityList: assign((context, event) => {
|
|
82
85
|
const noReadActivity = [2, 4, 13, 20, 90, 91, 92]
|
|
83
|
-
const noReadSet = new Set(noReadActivity)
|
|
84
86
|
const { uidSite } = context
|
|
85
87
|
const { activityList } = event.data
|
|
86
|
-
|
|
88
|
+
let list = JSON.parse(JSON.stringify(activityList))
|
|
89
|
+
list.forEach((activity) => {
|
|
87
90
|
const storageUnread = localStorage.getItem(`unread_${activity.activityNo}_${uidSite}`)
|
|
88
|
-
if (
|
|
89
|
-
|
|
91
|
+
if (noReadActivity.includes(activity.activityType)) {
|
|
92
|
+
activity.unread = false
|
|
90
93
|
} else if (storageUnread) {
|
|
91
|
-
|
|
94
|
+
activity.unread = JSON.parse(storageUnread)
|
|
92
95
|
} else {
|
|
93
|
-
|
|
96
|
+
activity.unread = true
|
|
94
97
|
}
|
|
95
98
|
})
|
|
96
99
|
return {
|
|
97
100
|
activityList: list,
|
|
98
101
|
}
|
|
99
102
|
}),
|
|
103
|
+
setProgressSummary: assign((context, event) => {
|
|
104
|
+
if (!event.data) return {}
|
|
105
|
+
const { progressSummary } = event.data
|
|
106
|
+
return {
|
|
107
|
+
progressSummary: progressSummary || null,
|
|
108
|
+
}
|
|
109
|
+
}),
|
|
100
110
|
setPromotionList: assign((context, event) => {
|
|
101
111
|
const { promotionList } = event.data
|
|
102
112
|
return {
|
|
@@ -105,23 +115,34 @@ export default function (request) {
|
|
|
105
115
|
}),
|
|
106
116
|
setUnread: assign((context, event) => {
|
|
107
117
|
const { uidSite, activityNo, unread } = event.data
|
|
118
|
+
const list = JSON.parse(JSON.stringify(context.activityList))
|
|
108
119
|
localStorage.setItem(`unread_${activityNo}_${uidSite}`, `${unread}`)
|
|
109
|
-
|
|
110
|
-
item.activityNo === activityNo
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
: item
|
|
116
|
-
)
|
|
120
|
+
list.map((item) => {
|
|
121
|
+
if (item.activityNo === activityNo) {
|
|
122
|
+
item.unread = JSON.parse(`${unread}`)
|
|
123
|
+
}
|
|
124
|
+
return item
|
|
125
|
+
})
|
|
117
126
|
return {
|
|
118
127
|
activityList: list,
|
|
119
128
|
uidSite,
|
|
120
129
|
}
|
|
121
130
|
}),
|
|
122
131
|
setActivityDetailList: assign((context, event) => {
|
|
132
|
+
if (!event.data) return {}
|
|
133
|
+
const { activityDetailList } = event.data
|
|
134
|
+
return {
|
|
135
|
+
activityDetailList: activityDetailList.map((item) => item.data),
|
|
136
|
+
}
|
|
137
|
+
}),
|
|
138
|
+
setListAuthKey: assign((context, event) => {
|
|
139
|
+
const listAuthKey = event.data.authKey || null
|
|
140
|
+
// 身分變回訪客時一併清空明細(例如登出後的 REFRESH):
|
|
141
|
+
// guard 會讓訪客身分直接跳過 fetchingDetailList,若不在這裡清空,
|
|
142
|
+
// activityDetailList 會殘留登出前的會員資料,導致輪盤/紅包雨顯示錯誤身分的結果。
|
|
123
143
|
return {
|
|
124
|
-
|
|
144
|
+
listAuthKey,
|
|
145
|
+
...(listAuthKey ? {} : { activityDetailList: [], progressSummary: {} }),
|
|
125
146
|
}
|
|
126
147
|
}),
|
|
127
148
|
resetActivities: assign((context, event) => {
|
|
@@ -137,8 +158,9 @@ export default function (request) {
|
|
|
137
158
|
},
|
|
138
159
|
guards: {
|
|
139
160
|
needFetchingDetail: (context, event) => {
|
|
140
|
-
const { activityList = [], detailNeededActivityTypes } = context
|
|
141
|
-
|
|
161
|
+
const { activityList = [], detailNeededActivityTypes, listAuthKey } = context
|
|
162
|
+
if (!listAuthKey) return false
|
|
163
|
+
return activityList.filter((activity) => detailNeededActivityTypes.includes(activity.activityType)).length > 0
|
|
142
164
|
},
|
|
143
165
|
isInGame: (context, event) => {
|
|
144
166
|
return context.isPlaying
|
|
@@ -155,30 +177,56 @@ export default function (request) {
|
|
|
155
177
|
},
|
|
156
178
|
services: {
|
|
157
179
|
fetchList: async (context, event) => {
|
|
158
|
-
const
|
|
180
|
+
const authKey = request.getToken() || null
|
|
181
|
+
const hasToken = !!authKey
|
|
182
|
+
|
|
159
183
|
const [{ data }, promotionList] = await Promise.all([
|
|
160
184
|
hasToken ? request.send(activity.getActivityList({ appSecret })) : request.send(activity.getAllActivityList({ appSecret })),
|
|
161
185
|
hasToken ? request.send(payment.getPromotionsList()) : [],
|
|
162
186
|
])
|
|
163
187
|
|
|
164
|
-
|
|
188
|
+
// send() 不保證回傳 { data } 信封(200 但 body 非 JSON 時回字串,data 即為 undefined)。非陣列必須在 service 內 reject 走 onError,
|
|
189
|
+
// 不可進入 setActivityList:assign 內拋錯會讓 interpreter 清空事件佇列,machine 永久停在 fetchingList、輪詢中止
|
|
190
|
+
if (!Array.isArray(data)) {
|
|
191
|
+
throw new Error('[activity_cash] fetchList: activityList is not an array')
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return {
|
|
195
|
+
activityList: data,
|
|
196
|
+
promotionList,
|
|
197
|
+
authKey,
|
|
198
|
+
}
|
|
165
199
|
},
|
|
166
200
|
fetchActivityDetailList: async (context, event) => {
|
|
201
|
+
const { listAuthKey } = context
|
|
167
202
|
await new Promise((resolve) => setTimeout(resolve, 1000)) // delay 1 second
|
|
168
|
-
|
|
203
|
+
|
|
204
|
+
// 抓清單時是訪客,或這 1 秒內身分換過(?x= 登入落地)→ 不發,等 REFRESH 用正確身分重抓
|
|
205
|
+
if (!listAuthKey || request.getToken() !== listAuthKey) return null
|
|
206
|
+
|
|
207
|
+
const siteConfig = window?.$nuxt?.$store?.state?.siteConfig
|
|
208
|
+
const isProgressEnable = siteConfig?.frontendActivityProgressEnable
|
|
169
209
|
|
|
170
210
|
const { activityList = [], detailNeededActivityTypes } = context
|
|
171
|
-
|
|
172
|
-
|
|
211
|
+
const filteredActivityList = activityList.filter((activity) => detailNeededActivityTypes.includes(activity.activityType))
|
|
212
|
+
const [activityDetailList, progressSummaryRes] = await Promise.all([
|
|
213
|
+
Promise.all(
|
|
214
|
+
filteredActivityList.map((item) => {
|
|
215
|
+
return request.send(activity.getActivityDetail({ activityNo: item.activityNo, appSecret, silent: true }))
|
|
216
|
+
})
|
|
217
|
+
),
|
|
218
|
+
isProgressEnable ? request.send(activity.getProgressSummary({ appSecret })).catch(() => null) : Promise.resolve(null),
|
|
219
|
+
])
|
|
220
|
+
// ERR_800/維護中時 send() 回 undefined,進到 setActivityDetailList 讀 item.data 會在 assign 內拋錯而卡死 machine;
|
|
221
|
+
// 整輪 reject 走 onError,保留上一輪明細並於下個 TIMEOUT 重試
|
|
222
|
+
if (!activityDetailList.every((res) => res !== null && typeof res === 'object')) {
|
|
223
|
+
throw new Error('[activity_cash] fetchActivityDetailList: invalid detail response')
|
|
173
224
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
promiseArray.push(request.send(activity.getActivityDetail({ activityNo: item.activityNo, appSecret })))
|
|
179
|
-
}
|
|
225
|
+
|
|
226
|
+
return {
|
|
227
|
+
activityDetailList,
|
|
228
|
+
progressSummary: progressSummaryRes?.data || null,
|
|
180
229
|
}
|
|
181
|
-
return await Promise.all(promiseArray)
|
|
182
230
|
},
|
|
183
231
|
},
|
|
184
232
|
}
|
|
@@ -6,7 +6,6 @@ export default function (request) {
|
|
|
6
6
|
return createMachine(
|
|
7
7
|
{
|
|
8
8
|
id: 'diamond_shop_activity',
|
|
9
|
-
predictableActionArguments: true,
|
|
10
9
|
context: {
|
|
11
10
|
activityNo: null,
|
|
12
11
|
activityDetail: null,
|
|
@@ -14,7 +13,6 @@ export default function (request) {
|
|
|
14
13
|
awardList: [],
|
|
15
14
|
totalAmount: 0,
|
|
16
15
|
subtractPoints: 0,
|
|
17
|
-
callback: () => {},
|
|
18
16
|
},
|
|
19
17
|
initial: 'fetching',
|
|
20
18
|
states: {
|
|
@@ -59,7 +57,6 @@ export default function (request) {
|
|
|
59
57
|
},
|
|
60
58
|
SETTLE_AMOUNT: {
|
|
61
59
|
target: 'settling',
|
|
62
|
-
actions: 'setCallback',
|
|
63
60
|
cond: 'settlable',
|
|
64
61
|
},
|
|
65
62
|
},
|
|
@@ -146,11 +143,6 @@ export default function (request) {
|
|
|
146
143
|
totalPoints: event.data,
|
|
147
144
|
}
|
|
148
145
|
}),
|
|
149
|
-
setCallback: assign((context, event) => {
|
|
150
|
-
return {
|
|
151
|
-
callback: event.data?.callback || (() => {}),
|
|
152
|
-
}
|
|
153
|
-
}),
|
|
154
146
|
},
|
|
155
147
|
guards: {
|
|
156
148
|
settlable: (context, event) => {
|
|
@@ -8,7 +8,6 @@ export default function (request, context) {
|
|
|
8
8
|
return createMachine(
|
|
9
9
|
{
|
|
10
10
|
id: 'fafafa_activity',
|
|
11
|
-
predictableActionArguments: true,
|
|
12
11
|
context: {
|
|
13
12
|
isAutoReceiving,
|
|
14
13
|
activityNo,
|
|
@@ -61,11 +60,6 @@ export default function (request, context) {
|
|
|
61
60
|
},
|
|
62
61
|
awarded: {
|
|
63
62
|
entry: 'setDuration',
|
|
64
|
-
on: {
|
|
65
|
-
REFRESH_ACTIVITY: {
|
|
66
|
-
target: 'loading',
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
63
|
after: {
|
|
70
64
|
1000: [{ target: 'loading', cond: 'shouldCheckNewPeriod' }, { target: 'awarded' }],
|
|
71
65
|
},
|
|
@@ -103,11 +97,6 @@ export default function (request, context) {
|
|
|
103
97
|
},
|
|
104
98
|
result: {
|
|
105
99
|
entry: 'setDuration',
|
|
106
|
-
on: {
|
|
107
|
-
REFRESH_ACTIVITY: {
|
|
108
|
-
target: 'loading',
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
100
|
after: {
|
|
112
101
|
1000: [{ target: 'loading', cond: 'shouldCheckNewPeriod' }, { target: 'result' }],
|
|
113
102
|
},
|
|
@@ -7,7 +7,6 @@ export default function (request) {
|
|
|
7
7
|
return createMachine(
|
|
8
8
|
{
|
|
9
9
|
id: 'friend_invite_friends_activity',
|
|
10
|
-
predictableActionArguments: true,
|
|
11
10
|
context: {
|
|
12
11
|
friendsEnable: false,
|
|
13
12
|
activityNo: null,
|
|
@@ -254,12 +253,13 @@ export default function (request) {
|
|
|
254
253
|
},
|
|
255
254
|
fetchLevelDownLineList: async (context, event) => {
|
|
256
255
|
const { currentLevel, page, levelDownLine } = context
|
|
257
|
-
const
|
|
256
|
+
const copiedObj = JSON.parse(JSON.stringify(levelDownLine))
|
|
257
|
+
const copiedList = copiedObj.data
|
|
258
258
|
const resopnseData = await request.send(user.getFriendsDashboardList({ level: currentLevel, page, row: 10 }))
|
|
259
|
-
if (
|
|
259
|
+
if (!!copiedList && !!resopnseData?.data) {
|
|
260
260
|
const combindData = {
|
|
261
261
|
...resopnseData,
|
|
262
|
-
data: [...
|
|
262
|
+
data: [...copiedList, ...resopnseData?.data],
|
|
263
263
|
}
|
|
264
264
|
return combindData
|
|
265
265
|
} else {
|
|
@@ -268,12 +268,13 @@ export default function (request) {
|
|
|
268
268
|
},
|
|
269
269
|
fetchFriendsList: async (context, event) => {
|
|
270
270
|
const { currentType, listPage, friendsList } = context
|
|
271
|
-
const
|
|
271
|
+
const copiedObj = JSON.parse(JSON.stringify(friendsList))
|
|
272
|
+
const copiedList = copiedObj.list
|
|
272
273
|
const resopnseData = await request.send(user.getFriendsList({ type: currentType, page: listPage, row: 15 }))
|
|
273
|
-
if (
|
|
274
|
+
if (!!copiedList && !!resopnseData?.data?.list) {
|
|
274
275
|
const combindData = {
|
|
275
276
|
...resopnseData.data,
|
|
276
|
-
list: [...
|
|
277
|
+
list: [...copiedList, ...resopnseData?.data?.list],
|
|
277
278
|
}
|
|
278
279
|
return combindData
|
|
279
280
|
} else {
|
|
@@ -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,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import api from '
|
|
2
|
+
import api from '@jetthai/cuora/src/api/activity'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
|
6
6
|
return createMachine(
|
|
7
7
|
{
|
|
8
8
|
id: 'sign_in_monthly',
|
|
9
|
-
predictableActionArguments: true,
|
|
10
9
|
context: {
|
|
11
10
|
activityNo: null,
|
|
12
11
|
activityDetail: null,
|