@jetthai/cuora 1.1.297-dev-5 → 1.1.297
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 +0 -10
- package/package.json +1 -1
- package/src/api/common.js +0 -1
- package/src/lib/fingerprint.js +1564 -1594
- package/src/machine/activity/instant_rebate_activity.js +1 -9
- package/src/machine/game_v2_1.js +2 -35
- package/src/machine/inbox.js +2 -2
- package/src/machine/index.js +0 -2
- package/src/machine/navbar.js +0 -57
|
@@ -17,7 +17,7 @@ export default function (request) {
|
|
|
17
17
|
singleMinimumAmountReceive: null,
|
|
18
18
|
remainingCount: 0,
|
|
19
19
|
dailyRedemptionLimit: 0,
|
|
20
|
-
|
|
20
|
+
collectAmount: 0,
|
|
21
21
|
activityNo: null,
|
|
22
22
|
},
|
|
23
23
|
initial: 'idle',
|
|
@@ -74,14 +74,12 @@ export default function (request) {
|
|
|
74
74
|
},
|
|
75
75
|
checking: {
|
|
76
76
|
always: [
|
|
77
|
-
{ target: 'claimAmountLimitReached', cond: 'isClaimAmountLimitReached' },
|
|
78
77
|
{ target: 'claimExhausted', cond: 'isClaimExhausted' },
|
|
79
78
|
{ target: 'insufficientAmount', cond: 'isInsufficientAmount' },
|
|
80
79
|
{ target: 'claimEnable', cond: 'isClaimEnable' },
|
|
81
80
|
{ target: 'cantEstimate' },
|
|
82
81
|
],
|
|
83
82
|
},
|
|
84
|
-
claimAmountLimitReached: {},
|
|
85
83
|
claimExhausted: {},
|
|
86
84
|
insufficientAmount: {},
|
|
87
85
|
claimEnable: {
|
|
@@ -136,7 +134,6 @@ export default function (request) {
|
|
|
136
134
|
singleMinimumAmountReceive = 0,
|
|
137
135
|
remainingCount = 0,
|
|
138
136
|
dailyRedemptionLimit = 0,
|
|
139
|
-
reachedAmountLimit = false,
|
|
140
137
|
} = event.data
|
|
141
138
|
|
|
142
139
|
return {
|
|
@@ -149,7 +146,6 @@ export default function (request) {
|
|
|
149
146
|
singleMinimumAmountReceive,
|
|
150
147
|
remainingCount,
|
|
151
148
|
dailyRedemptionLimit,
|
|
152
|
-
reachedAmountLimit,
|
|
153
149
|
}
|
|
154
150
|
}),
|
|
155
151
|
},
|
|
@@ -165,10 +161,6 @@ export default function (request) {
|
|
|
165
161
|
return parseInt(`${currentTime}`) - parseInt(`${lastEstimateTime}`) > fiveMinutes
|
|
166
162
|
}
|
|
167
163
|
},
|
|
168
|
-
isClaimAmountLimitReached: (context, event) => {
|
|
169
|
-
const { reachedAmountLimit } = context
|
|
170
|
-
return reachedAmountLimit
|
|
171
|
-
},
|
|
172
164
|
isClaimExhausted: (context, event) => {
|
|
173
165
|
const { collectAvailable, remainingCount, dailyRedemptionLimit } = context
|
|
174
166
|
return !collectAvailable && parseInt(`${remainingCount}`) === parseInt(`${dailyRedemptionLimit}`)
|
package/src/machine/game_v2_1.js
CHANGED
|
@@ -14,7 +14,6 @@ export default function (request) {
|
|
|
14
14
|
batch: null,
|
|
15
15
|
loadable: false,
|
|
16
16
|
isLastPage: false,
|
|
17
|
-
pageLoading: true,
|
|
18
17
|
room: null,
|
|
19
18
|
index: -1,
|
|
20
19
|
content: {
|
|
@@ -65,11 +64,6 @@ export default function (request) {
|
|
|
65
64
|
target: 'routing',
|
|
66
65
|
actions: 'setLoadable',
|
|
67
66
|
},
|
|
68
|
-
// 載入下一頁
|
|
69
|
-
NEXT_PAGE: {
|
|
70
|
-
target: 'routing',
|
|
71
|
-
actions: 'setLoadable',
|
|
72
|
-
},
|
|
73
67
|
SET_ROOM: {
|
|
74
68
|
cond: 'isDifferentRoom',
|
|
75
69
|
actions: ['setRoom', 'resetContent'],
|
|
@@ -107,10 +101,7 @@ export default function (request) {
|
|
|
107
101
|
invoke: {
|
|
108
102
|
src: 'getPageContent',
|
|
109
103
|
onDone: {
|
|
110
|
-
|
|
111
|
-
// target: 'routing',
|
|
112
|
-
// 現在: 載完一個頁面就切成loaded狀態
|
|
113
|
-
target: 'loaded',
|
|
104
|
+
target: 'routing',
|
|
114
105
|
actions: ['appendContent', 'setLastPage'],
|
|
115
106
|
},
|
|
116
107
|
onError: {
|
|
@@ -121,23 +112,13 @@ export default function (request) {
|
|
|
121
112
|
LOAD: { actions: 'setLoadable' },
|
|
122
113
|
},
|
|
123
114
|
},
|
|
124
|
-
// 已將當前頁載入完成
|
|
125
|
-
loaded: {
|
|
126
|
-
after: {
|
|
127
|
-
0: {
|
|
128
|
-
target: 'idle',
|
|
129
|
-
actions: 'setPageLoadingDone',
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
115
|
routing: {
|
|
134
116
|
always: [
|
|
135
117
|
{
|
|
136
118
|
target: 'loading',
|
|
137
119
|
cond: 'hasNext',
|
|
138
|
-
actions: 'setPageLoading',
|
|
139
120
|
},
|
|
140
|
-
{ target: 'idle'
|
|
121
|
+
{ target: 'idle' },
|
|
141
122
|
],
|
|
142
123
|
},
|
|
143
124
|
updating: {
|
|
@@ -339,7 +320,6 @@ export default function (request) {
|
|
|
339
320
|
}),
|
|
340
321
|
setLastPage: assign((context, event) => {
|
|
341
322
|
const { index, content } = context
|
|
342
|
-
// 最後一頁
|
|
343
323
|
return {
|
|
344
324
|
isLastPage: index >= content?.totalPage - 1,
|
|
345
325
|
}
|
|
@@ -449,25 +429,12 @@ export default function (request) {
|
|
|
449
429
|
const lang = event.data.locale.replace('-', '_')
|
|
450
430
|
return { lang }
|
|
451
431
|
}),
|
|
452
|
-
setPageLoadingDone: assign((context, event) => {
|
|
453
|
-
// const { index } = context
|
|
454
|
-
// console.log('*載入完成:當前頁碼', index)
|
|
455
|
-
return {
|
|
456
|
-
pageLoading: true,
|
|
457
|
-
}
|
|
458
|
-
}),
|
|
459
|
-
setPageLoading: assign((context, event) => {
|
|
460
|
-
return {
|
|
461
|
-
pageLoading: false,
|
|
462
|
-
}
|
|
463
|
-
}),
|
|
464
432
|
...oldActions,
|
|
465
433
|
},
|
|
466
434
|
guards: {
|
|
467
435
|
isDifferentRoom: (context, event) => context.room?.categoryId !== event.data?.categoryId,
|
|
468
436
|
hasNext: (context, event) => {
|
|
469
437
|
const { loadable, isLastPage } = context
|
|
470
|
-
// 是否有下一頁
|
|
471
438
|
return loadable && !isLastPage
|
|
472
439
|
},
|
|
473
440
|
hasRoom: (context, event) => context.room?.categoryId,
|
package/src/machine/inbox.js
CHANGED
|
@@ -344,9 +344,9 @@ export default function (request) {
|
|
|
344
344
|
const isCustomerReply = data[0]?.from === 'SYSTEM'
|
|
345
345
|
let combindedContent = ''
|
|
346
346
|
if (isCustomerReply) {
|
|
347
|
-
combindedContent = '-\n-------------------------\n' + data[0]
|
|
347
|
+
combindedContent = '-\n-------------------------\n' + data[0].content + '\n-------------------------\n' + data[1].content
|
|
348
348
|
} else {
|
|
349
|
-
combindedContent = `-\n-------------------------\n${data[0]
|
|
349
|
+
combindedContent = `-\n-------------------------\n${data[0].content}`
|
|
350
350
|
}
|
|
351
351
|
return {
|
|
352
352
|
messageDetail: data,
|
package/src/machine/index.js
CHANGED
|
@@ -35,7 +35,6 @@ 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
37
|
import user_photo from './user_photo.js'
|
|
38
|
-
import navbar from './navbar.js'
|
|
39
38
|
|
|
40
39
|
export default {
|
|
41
40
|
...activity,
|
|
@@ -74,6 +73,5 @@ export default {
|
|
|
74
73
|
roulette_v2,
|
|
75
74
|
honor_board_cash,
|
|
76
75
|
user_photo,
|
|
77
|
-
navbar,
|
|
78
76
|
...withdraw,
|
|
79
77
|
}
|
package/src/machine/navbar.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import common from '../api/common.js'
|
|
3
|
-
|
|
4
|
-
export default function (request) {
|
|
5
|
-
const { appSecret } = request.config
|
|
6
|
-
return createMachine(
|
|
7
|
-
{
|
|
8
|
-
id: 'navbar',
|
|
9
|
-
initial: 'fetching',
|
|
10
|
-
context: {
|
|
11
|
-
navbar: null,
|
|
12
|
-
},
|
|
13
|
-
states: {
|
|
14
|
-
fetching: {
|
|
15
|
-
invoke: {
|
|
16
|
-
src: 'fetchNavbar',
|
|
17
|
-
onDone: {
|
|
18
|
-
target: 'idle',
|
|
19
|
-
actions: 'setNavbar',
|
|
20
|
-
},
|
|
21
|
-
onError: {
|
|
22
|
-
target: 'idle',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
idle: {},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
actions: {
|
|
31
|
-
setNavbar: assign((context, event) => {
|
|
32
|
-
const { navbarConfig } = event.data
|
|
33
|
-
return {
|
|
34
|
-
navbar: navbarConfig.settings,
|
|
35
|
-
}
|
|
36
|
-
}),
|
|
37
|
-
},
|
|
38
|
-
services: {
|
|
39
|
-
fetchNavbar: async (context, event) => {
|
|
40
|
-
const navbar = await request.send(common.getNavbar({ appSecret }))
|
|
41
|
-
const base64Url = navbar.config.split('.')[0]
|
|
42
|
-
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/')
|
|
43
|
-
const decodeResult = decodeURIComponent(
|
|
44
|
-
window
|
|
45
|
-
.atob(base64)
|
|
46
|
-
.split('')
|
|
47
|
-
.map((c) => {
|
|
48
|
-
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)
|
|
49
|
-
})
|
|
50
|
-
.join('')
|
|
51
|
-
)
|
|
52
|
-
return { navbarConfig: JSON.parse(decodeResult) }
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
}
|
|
56
|
-
)
|
|
57
|
-
}
|