@jetthai/cuora 1.1.358-dev-7 → 1.1.359-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/CHANGELOG.md +2 -12
- package/package.json +1 -1
- package/src/api/activity.js +2 -2
- package/src/api/game.js +1 -1
- package/src/machine/game_v2_1.js +0 -4
- package/src/machine/ranking.js +3 -1
- package/src/machine/reward.js +1 -43
- package/src/machine/reward_cash.js +0 -43
package/CHANGELOG.md
CHANGED
|
@@ -2,19 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
### [1.1.
|
|
5
|
+
### [1.1.359-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.359...v1.1.359-dev-1) (2025-05-24)
|
|
6
6
|
|
|
7
|
-
### [1.1.
|
|
8
|
-
|
|
9
|
-
### [1.1.358-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.358-dev-4...v1.1.358-dev-5) (2025-05-16)
|
|
10
|
-
|
|
11
|
-
### [1.1.358-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.358-dev-3...v1.1.358-dev-4) (2025-05-16)
|
|
12
|
-
|
|
13
|
-
### [1.1.358-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.358-dev-2...v1.1.358-dev-3) (2025-05-15)
|
|
14
|
-
|
|
15
|
-
### [1.1.358-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.358-dev-1...v1.1.358-dev-2) (2025-05-12)
|
|
16
|
-
|
|
17
|
-
### [1.1.358-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.358...v1.1.358-dev-1) (2025-05-09)
|
|
7
|
+
### [1.1.359](https://github.com/jetthai/cuora-module/compare/v1.1.358...v1.1.359) (2025-05-23)
|
|
18
8
|
|
|
19
9
|
### [1.1.358](https://github.com/jetthai/cuora-module/compare/v1.1.357...v1.1.358) (2025-05-09)
|
|
20
10
|
|
package/package.json
CHANGED
package/src/api/activity.js
CHANGED
|
@@ -69,10 +69,10 @@ export default {
|
|
|
69
69
|
method: 'get',
|
|
70
70
|
params: { rewardType },
|
|
71
71
|
}),
|
|
72
|
-
getRewardList: ({ rewardType, count, appSecret
|
|
72
|
+
getRewardList: ({ rewardType, count, appSecret }) => ({
|
|
73
73
|
url: 'activities/rewards',
|
|
74
74
|
method: 'get',
|
|
75
|
-
params: { rewardType, count, appSecret
|
|
75
|
+
params: { rewardType, count, appSecret },
|
|
76
76
|
}),
|
|
77
77
|
getCashRainReward: ({ activityNo, appSecret }) => ({
|
|
78
78
|
url: `activities/cashRain`,
|
package/src/api/game.js
CHANGED
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
demoGame: (params) => ({ url: 'game/demo', method: 'get', params, isPublic: true }),
|
|
8
8
|
logoutGame: ({ uid_site, provider_id }) => ({ url: 'game/logout', method: 'get', params: { uid_site, provider_id } }),
|
|
9
9
|
|
|
10
|
-
getGameTags: ({ q, lang
|
|
10
|
+
getGameTags: ({ q, lang }) => ({ url: 'game/search', method: 'get', params: { q, lang } }),
|
|
11
11
|
getGameSearchHome: () => ({ url: 'game/search/home', method: 'get' }),
|
|
12
12
|
getGameSearchList: ({ id, index, q, click, clickDefault, providerName }) => ({
|
|
13
13
|
url: 'game/search/list',
|
package/src/machine/game_v2_1.js
CHANGED
|
@@ -229,10 +229,6 @@ export default function (request) {
|
|
|
229
229
|
ENTER_GAME_PAUSE: {
|
|
230
230
|
actions: ['setIsPlaying', 'resetContent', 'resetSHA'],
|
|
231
231
|
},
|
|
232
|
-
ENTER_GAME: {
|
|
233
|
-
target: 'connecting',
|
|
234
|
-
actions: ['setGameInfo', 'setLang', 'setwalletType'],
|
|
235
|
-
},
|
|
236
232
|
},
|
|
237
233
|
},
|
|
238
234
|
playingDemo: {
|
package/src/machine/ranking.js
CHANGED
|
@@ -3,11 +3,13 @@ import ranking from '../api/ranking.js'
|
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const cycleMapping = ['DAILY', 'WEEKLY', 'MONTHLY']
|
|
6
|
+
const limit = { DAILY: 56, WEEKLY: 8, MONTHLY: 2, ALL: 2 }
|
|
6
7
|
|
|
7
8
|
function roundProcess(rounds, cycles) {
|
|
8
9
|
const roundArrays = rounds.map((round) => Array.from({ length: round }, (_, i) => i + 1))
|
|
9
10
|
return roundArrays.reduce((acc, roundArray, index) => {
|
|
10
|
-
|
|
11
|
+
const max = limit[cycles[index]] || rounds[index] // 若沒限制則取全部
|
|
12
|
+
acc[cycles[index]] = roundArray.reverse().slice(0, max)
|
|
11
13
|
return acc
|
|
12
14
|
}, {})
|
|
13
15
|
}
|
package/src/machine/reward.js
CHANGED
|
@@ -18,7 +18,6 @@ export default function (request) {
|
|
|
18
18
|
rewardType: null,
|
|
19
19
|
isPlaying: false,
|
|
20
20
|
callback: () => {},
|
|
21
|
-
orderColumn: 'createTime',
|
|
22
21
|
},
|
|
23
22
|
states: {
|
|
24
23
|
timer: {
|
|
@@ -57,10 +56,6 @@ export default function (request) {
|
|
|
57
56
|
target: 'fetching',
|
|
58
57
|
actions: 'setRewardData',
|
|
59
58
|
},
|
|
60
|
-
FETCH_OTHER_REWARD: {
|
|
61
|
-
target: 'fetchingOtherReward',
|
|
62
|
-
actions: 'setOrderColumn',
|
|
63
|
-
},
|
|
64
59
|
RECEIVE_REWARD: {
|
|
65
60
|
target: 'receiving',
|
|
66
61
|
actions: ['setCallback', 'setRewardType'],
|
|
@@ -86,18 +81,6 @@ export default function (request) {
|
|
|
86
81
|
},
|
|
87
82
|
},
|
|
88
83
|
},
|
|
89
|
-
fetchingOtherReward: {
|
|
90
|
-
invoke: {
|
|
91
|
-
src: 'fetchOtherRewardList',
|
|
92
|
-
onDone: {
|
|
93
|
-
target: 'idle',
|
|
94
|
-
actions: 'setOtherRewardList',
|
|
95
|
-
},
|
|
96
|
-
onError: {
|
|
97
|
-
target: 'idle',
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
84
|
pending: {
|
|
102
85
|
on: {
|
|
103
86
|
RECEIVE_REWARD: {
|
|
@@ -153,11 +136,6 @@ export default function (request) {
|
|
|
153
136
|
rewardList: event.data[2]?.data || [],
|
|
154
137
|
}
|
|
155
138
|
}),
|
|
156
|
-
setOtherRewardList: assign((context, event) => {
|
|
157
|
-
return {
|
|
158
|
-
otherRewardList: event.data[0]?.data,
|
|
159
|
-
}
|
|
160
|
-
}),
|
|
161
139
|
setRewardData: assign((context, event) => {
|
|
162
140
|
const { activityNo, receiveNo } = event.data
|
|
163
141
|
return {
|
|
@@ -170,11 +148,6 @@ export default function (request) {
|
|
|
170
148
|
callback: event.data?.callback || (() => {}),
|
|
171
149
|
}
|
|
172
150
|
}),
|
|
173
|
-
setOrderColumn: assign((context, event) => {
|
|
174
|
-
return {
|
|
175
|
-
orderColumn: event.data?.orderColumn || 'createTime',
|
|
176
|
-
}
|
|
177
|
-
}),
|
|
178
151
|
setRewardType: assign((context, event) => {
|
|
179
152
|
return {
|
|
180
153
|
rewardType: event.data?.rewardType,
|
|
@@ -205,27 +178,12 @@ export default function (request) {
|
|
|
205
178
|
},
|
|
206
179
|
services: {
|
|
207
180
|
fetchRewardList: async (context, event) => {
|
|
208
|
-
const orderColumn = context.orderColumn
|
|
209
181
|
const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret }))
|
|
210
182
|
const getPointsRewardAPI = request.send(activity.getRewardList({ rewardType: 'POINTS', count: 30, appSecret }))
|
|
211
|
-
const getOtherRewardAPI = request.send(activity.getRewardList({ rewardType: 'CASH,FREE,PRIZE', count: 30, appSecret
|
|
183
|
+
const getOtherRewardAPI = request.send(activity.getRewardList({ rewardType: 'CASH,FREE,PRIZE', count: 30, appSecret }))
|
|
212
184
|
const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI])
|
|
213
185
|
return [otherRewardList, pointsRewardList, rewardList]
|
|
214
186
|
},
|
|
215
|
-
fetchOtherRewardList: async (context, event) => {
|
|
216
|
-
const orderColumn = context.orderColumn
|
|
217
|
-
|
|
218
|
-
const getOtherRewardAPI = request.send(
|
|
219
|
-
activity.getRewardList({
|
|
220
|
-
rewardType: 'CASH,FREE,PRIZE',
|
|
221
|
-
count: 30,
|
|
222
|
-
appSecret,
|
|
223
|
-
orderColumn,
|
|
224
|
-
})
|
|
225
|
-
)
|
|
226
|
-
const [otherRewardList] = await Promise.all([getOtherRewardAPI])
|
|
227
|
-
return [otherRewardList]
|
|
228
|
-
},
|
|
229
187
|
fetchWithdrawRulePreview: async (context, event) => {
|
|
230
188
|
const { receiveNo } = context
|
|
231
189
|
const data = await request.send(payment.getWithdrawRulePreview({ applyType: 'activity', applyNo: receiveNo, amount: null }))
|
|
@@ -17,7 +17,6 @@ export default function (request) {
|
|
|
17
17
|
receiveNo: null,
|
|
18
18
|
withdrawRule: {},
|
|
19
19
|
callback: () => {},
|
|
20
|
-
orderColumn: 'createTime',
|
|
21
20
|
},
|
|
22
21
|
states: {
|
|
23
22
|
timer: {
|
|
@@ -66,10 +65,6 @@ export default function (request) {
|
|
|
66
65
|
target: 'fetching',
|
|
67
66
|
actions: 'setRewardData',
|
|
68
67
|
},
|
|
69
|
-
FETCH_OTHER_REWARD: {
|
|
70
|
-
target: 'fetchingOtherReward',
|
|
71
|
-
actions: 'setOrderColumn',
|
|
72
|
-
},
|
|
73
68
|
RECEIVE_REWARD: {
|
|
74
69
|
target: 'receiving',
|
|
75
70
|
actions: 'setCallback',
|
|
@@ -92,18 +87,6 @@ export default function (request) {
|
|
|
92
87
|
},
|
|
93
88
|
},
|
|
94
89
|
},
|
|
95
|
-
fetchingOtherReward: {
|
|
96
|
-
invoke: {
|
|
97
|
-
src: 'fetchOtherRewardList',
|
|
98
|
-
onDone: {
|
|
99
|
-
target: 'idle',
|
|
100
|
-
actions: 'setOtherRewardList',
|
|
101
|
-
},
|
|
102
|
-
onError: {
|
|
103
|
-
target: 'idle',
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
90
|
pending: {
|
|
108
91
|
on: {
|
|
109
92
|
RECEIVE_REWARD: {
|
|
@@ -171,11 +154,6 @@ export default function (request) {
|
|
|
171
154
|
rewardList: event.data[2]?.data || [],
|
|
172
155
|
}
|
|
173
156
|
}),
|
|
174
|
-
setOtherRewardList: assign((context, event) => {
|
|
175
|
-
return {
|
|
176
|
-
otherRewardList: event.data[0]?.data,
|
|
177
|
-
}
|
|
178
|
-
}),
|
|
179
157
|
setRewardData: assign((context, event) => {
|
|
180
158
|
const { activityNo, receiveNo } = event.data
|
|
181
159
|
return {
|
|
@@ -188,11 +166,6 @@ export default function (request) {
|
|
|
188
166
|
callback: event.data?.callback || (() => {}),
|
|
189
167
|
}
|
|
190
168
|
}),
|
|
191
|
-
setOrderColumn: assign((context, event) => {
|
|
192
|
-
return {
|
|
193
|
-
orderColumn: event.data?.orderColumn || 'createTime',
|
|
194
|
-
}
|
|
195
|
-
}),
|
|
196
169
|
doCallback: (context, event) => {
|
|
197
170
|
context.callback()
|
|
198
171
|
},
|
|
@@ -205,7 +178,6 @@ export default function (request) {
|
|
|
205
178
|
services: {
|
|
206
179
|
fetchRewardList: async (context, event) => {
|
|
207
180
|
const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret }))
|
|
208
|
-
const orderColumn = context.orderColumn
|
|
209
181
|
const getPointsRewardAPI = request.send(
|
|
210
182
|
activity.getRewardList({
|
|
211
183
|
rewardType: 'POINTS',
|
|
@@ -218,26 +190,11 @@ export default function (request) {
|
|
|
218
190
|
rewardType: 'CASH,FREE,PRIZE',
|
|
219
191
|
count: 30,
|
|
220
192
|
appSecret,
|
|
221
|
-
orderColumn,
|
|
222
193
|
})
|
|
223
194
|
)
|
|
224
195
|
const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI])
|
|
225
196
|
return [otherRewardList, pointsRewardList, rewardList]
|
|
226
197
|
},
|
|
227
|
-
fetchOtherRewardList: async (context, event) => {
|
|
228
|
-
const orderColumn = context.orderColumn
|
|
229
|
-
|
|
230
|
-
const getOtherRewardAPI = request.send(
|
|
231
|
-
activity.getRewardList({
|
|
232
|
-
rewardType: 'CASH,FREE,PRIZE',
|
|
233
|
-
count: 30,
|
|
234
|
-
appSecret,
|
|
235
|
-
orderColumn,
|
|
236
|
-
})
|
|
237
|
-
)
|
|
238
|
-
const [otherRewardList] = await Promise.all([getOtherRewardAPI])
|
|
239
|
-
return [otherRewardList]
|
|
240
|
-
},
|
|
241
198
|
fetchWithdrawRulePreview: async (context, event) => {
|
|
242
199
|
const { receiveNo } = context
|
|
243
200
|
const data = await request.send(
|