@jetthai/cuora 1.1.312 → 1.1.314-tg
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/api/activity.js +6 -1
- package/src/api/auth.js +2 -2
- package/src/lib/fingerprint.js +2405 -2464
- package/src/machine/auth.js +14 -0
- package/src/machine/honor_board.js +118 -0
- package/src/machine/honor_board_cash.js +34 -8
- package/src/machine/index.js +2 -0
package/src/machine/auth.js
CHANGED
|
@@ -33,6 +33,7 @@ export default function (request) {
|
|
|
33
33
|
email: null,
|
|
34
34
|
username: null,
|
|
35
35
|
password: null,
|
|
36
|
+
additionalUserInfo: null,
|
|
36
37
|
},
|
|
37
38
|
countryAbbr: null,
|
|
38
39
|
userInfo: {},
|
|
@@ -271,6 +272,10 @@ export default function (request) {
|
|
|
271
272
|
LOGIN_APP: {
|
|
272
273
|
target: '.authenticationApp',
|
|
273
274
|
},
|
|
275
|
+
LOGIN_TELEGRAM: {
|
|
276
|
+
target: '.authentication',
|
|
277
|
+
actions: ['setReCaptchaToken', 'setLoginTelegram'],
|
|
278
|
+
},
|
|
274
279
|
SET_PLAY: {
|
|
275
280
|
actions: 'setPlay',
|
|
276
281
|
},
|
|
@@ -353,6 +358,15 @@ export default function (request) {
|
|
|
353
358
|
},
|
|
354
359
|
}
|
|
355
360
|
}),
|
|
361
|
+
setLoginTelegram: assign((context, event) => {
|
|
362
|
+
const { additionalUserInfo } = event.data
|
|
363
|
+
return {
|
|
364
|
+
loginData: {
|
|
365
|
+
provider: 'telegram',
|
|
366
|
+
additionalUserInfo,
|
|
367
|
+
},
|
|
368
|
+
}
|
|
369
|
+
}),
|
|
356
370
|
fetchToken: assign((context, event) => {
|
|
357
371
|
const token = storage.get(tokenKey)
|
|
358
372
|
return {
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { assign, createMachine } from 'xstate'
|
|
2
|
+
import activity from '../api/activity.js'
|
|
3
|
+
|
|
4
|
+
export default function (request) {
|
|
5
|
+
const { appSecret } = request.config
|
|
6
|
+
return createMachine(
|
|
7
|
+
{
|
|
8
|
+
id: 'honor_board',
|
|
9
|
+
type: 'parallel',
|
|
10
|
+
context: {
|
|
11
|
+
tick: 6000,
|
|
12
|
+
},
|
|
13
|
+
states: {
|
|
14
|
+
feed: {
|
|
15
|
+
initial: 'updating',
|
|
16
|
+
states: {
|
|
17
|
+
updating: {
|
|
18
|
+
invoke: {
|
|
19
|
+
src: 'fetchHonorBoardList',
|
|
20
|
+
onDone: {
|
|
21
|
+
target: 'waiting',
|
|
22
|
+
actions: 'setBroadcastList',
|
|
23
|
+
},
|
|
24
|
+
onError: {
|
|
25
|
+
target: 'waiting',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
waiting: {
|
|
30
|
+
after: {
|
|
31
|
+
TIMEOUT: {
|
|
32
|
+
target: 'updating',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
broadcast: {
|
|
39
|
+
initial: 'idle',
|
|
40
|
+
states: {
|
|
41
|
+
idle: {
|
|
42
|
+
on: {
|
|
43
|
+
START_BROADCAST: {
|
|
44
|
+
target: 'picking',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
picking: {
|
|
49
|
+
after: {
|
|
50
|
+
5000: {
|
|
51
|
+
target: 'display',
|
|
52
|
+
actions: 'setBroadcast',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
display: {
|
|
57
|
+
after: {
|
|
58
|
+
5000: {
|
|
59
|
+
target: 'picking',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
on: {
|
|
65
|
+
RESET_BROADCAST: {
|
|
66
|
+
target: '.idle',
|
|
67
|
+
actions: 'resetBroadcast',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
delays: {
|
|
75
|
+
TIMEOUT: (context, event) => {
|
|
76
|
+
return context.tick * 10
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
actions: {
|
|
80
|
+
setBroadcastList: assign((context, event) => {
|
|
81
|
+
const broadcastList = (event.data || []).map((item) => item.data).flat()
|
|
82
|
+
const sortBroadcastList = broadcastList.sort((a, b) => {
|
|
83
|
+
if (!a.time) return -1
|
|
84
|
+
if (!b.time) return 1
|
|
85
|
+
return a.time - b.time
|
|
86
|
+
})
|
|
87
|
+
return { broadcastList: sortBroadcastList }
|
|
88
|
+
}),
|
|
89
|
+
setBroadcast: assign((context, event) => {
|
|
90
|
+
const { broadcastList = [], sentNormalBroadcastList = [], normalBroadcast = [] } = context
|
|
91
|
+
let sentNormalList = sentNormalBroadcastList
|
|
92
|
+
if (normalBroadcast) {
|
|
93
|
+
sentNormalList = [...sentNormalBroadcastList, normalBroadcast]
|
|
94
|
+
}
|
|
95
|
+
const nextNormalBroadcast = broadcastList?.find((broadcast) => {
|
|
96
|
+
return !sentNormalList.some((item) => item.broadcastId === broadcast.broadcastId)
|
|
97
|
+
})
|
|
98
|
+
return {
|
|
99
|
+
normalBroadcast: nextNormalBroadcast,
|
|
100
|
+
sentNormalBroadcastList: sentNormalList,
|
|
101
|
+
}
|
|
102
|
+
}),
|
|
103
|
+
resetBroadcast: assign((context, event) => {
|
|
104
|
+
return {
|
|
105
|
+
normalBroadcast: null,
|
|
106
|
+
sentNormalBroadcastList: [],
|
|
107
|
+
}
|
|
108
|
+
}),
|
|
109
|
+
},
|
|
110
|
+
services: {
|
|
111
|
+
fetchHonorBoardList: async (context, event) => {
|
|
112
|
+
const { data } = await request.send(activity.getHonorBroadcast({ isPwa: true, appSecret }))
|
|
113
|
+
return data
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
}
|
|
@@ -9,9 +9,14 @@ export default function (request) {
|
|
|
9
9
|
initial: 'fetching',
|
|
10
10
|
context: {
|
|
11
11
|
tick: 6000,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
tabs: [],
|
|
13
|
+
cashRain: {},
|
|
14
|
+
deposit: {},
|
|
15
|
+
roulette: {},
|
|
16
|
+
jackpot: {},
|
|
17
|
+
bigWin: {},
|
|
18
|
+
maxBet: {},
|
|
19
|
+
withdraw: {},
|
|
15
20
|
},
|
|
16
21
|
states: {
|
|
17
22
|
fetching: {
|
|
@@ -38,11 +43,32 @@ export default function (request) {
|
|
|
38
43
|
{
|
|
39
44
|
actions: {
|
|
40
45
|
setHonorBoardList: assign((context, event) => {
|
|
41
|
-
const { bigWinList = [], maxBetList = [], withdrawList = [] } = event.data
|
|
42
46
|
return {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
tabs: (event.data || []).map((list) => {
|
|
48
|
+
switch (list.type) {
|
|
49
|
+
case 'CASH_RAIN':
|
|
50
|
+
return 'cashRain'
|
|
51
|
+
case 'DEPOSIT':
|
|
52
|
+
return 'deposit'
|
|
53
|
+
case 'FREE_ROULETTE_SPIN':
|
|
54
|
+
return 'roulette'
|
|
55
|
+
case 'JACKPOT':
|
|
56
|
+
return 'jackpot'
|
|
57
|
+
case 'WIN_SCORE':
|
|
58
|
+
return 'bigWin'
|
|
59
|
+
case 'WIN_MULTIPLIER':
|
|
60
|
+
return 'maxBet'
|
|
61
|
+
case 'WITHDRAW':
|
|
62
|
+
return 'withdraw'
|
|
63
|
+
}
|
|
64
|
+
}),
|
|
65
|
+
cashRain: (event.data || []).find((item) => item.type === 'CASH_RAIN') || {},
|
|
66
|
+
deposit: (event.data || []).find((item) => item.type === 'DEPOSIT') || {},
|
|
67
|
+
roulette: (event.data || []).find((item) => item.type === 'FREE_ROULETTE_SPIN') || {},
|
|
68
|
+
jackpot: (event.data || []).find((item) => item.type === 'JACKPOT') || {},
|
|
69
|
+
bigWin: (event.data || []).find((item) => item.type === 'WIN_SCORE') || {},
|
|
70
|
+
maxBet: (event.data || []).find((item) => item.type === 'WIN_MULTIPLIER') || {},
|
|
71
|
+
withdraw: (event.data || []).find((item) => item.type === 'WITHDRAW') || {},
|
|
46
72
|
}
|
|
47
73
|
}),
|
|
48
74
|
},
|
|
@@ -54,7 +80,7 @@ export default function (request) {
|
|
|
54
80
|
},
|
|
55
81
|
services: {
|
|
56
82
|
fetchHonorBoardList: async (context, event) => {
|
|
57
|
-
const { data } = await request.send(activity.
|
|
83
|
+
const { data } = await request.send(activity.getHonorBroadcast(appSecret))
|
|
58
84
|
return data
|
|
59
85
|
},
|
|
60
86
|
},
|
package/src/machine/index.js
CHANGED
|
@@ -34,6 +34,7 @@ import vip_table from './vip_table.js'
|
|
|
34
34
|
import promotions from './promotions.js'
|
|
35
35
|
import roulette_v2 from './roulette_v2.js'
|
|
36
36
|
import honor_board_cash from './honor_board_cash.js'
|
|
37
|
+
import honor_board from './honor_board.js'
|
|
37
38
|
import user_photo from './user_photo.js'
|
|
38
39
|
import navbar from './navbar.js'
|
|
39
40
|
|
|
@@ -73,6 +74,7 @@ export default {
|
|
|
73
74
|
promotions,
|
|
74
75
|
roulette_v2,
|
|
75
76
|
honor_board_cash,
|
|
77
|
+
honor_board,
|
|
76
78
|
user_photo,
|
|
77
79
|
navbar,
|
|
78
80
|
...withdraw,
|