@jetthai/cuora 1.1.130 → 1.1.131
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 -0
- package/package.json +1 -1
- package/src/machine/game_search_cash.js +71 -7
- package/src/machine/game_v2_1.js +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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.131](https://github.com/jetthai/cuora-module/compare/v1.1.130...v1.1.131) (2023-07-02)
|
|
6
|
+
|
|
5
7
|
### [1.1.130](https://github.com/jetthai/cuora-module/compare/v1.1.129...v1.1.130) (2023-06-28)
|
|
6
8
|
|
|
7
9
|
### [1.1.129](https://github.com/jetthai/cuora-module/compare/v1.1.128...v1.1.129) (2023-06-28)
|
package/package.json
CHANGED
|
@@ -76,6 +76,18 @@ export default function (request) {
|
|
|
76
76
|
},
|
|
77
77
|
},
|
|
78
78
|
},
|
|
79
|
+
fetchingGamesByKeyword: {
|
|
80
|
+
invoke: {
|
|
81
|
+
src: 'fetchGamesByKeyword',
|
|
82
|
+
onDone: {
|
|
83
|
+
target: 'idle',
|
|
84
|
+
actions: ['setGames', 'setTagList', 'setTagId'],
|
|
85
|
+
},
|
|
86
|
+
onError: {
|
|
87
|
+
target: 'idle',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
79
91
|
sendingTrace: {
|
|
80
92
|
invoke: {
|
|
81
93
|
src: 'sendTrace',
|
|
@@ -87,6 +99,17 @@ export default function (request) {
|
|
|
87
99
|
},
|
|
88
100
|
},
|
|
89
101
|
},
|
|
102
|
+
sendingMayLikeTrace: {
|
|
103
|
+
invoke: {
|
|
104
|
+
src: 'sendMayLikeTrace',
|
|
105
|
+
onDone: {
|
|
106
|
+
target: 'idle',
|
|
107
|
+
},
|
|
108
|
+
onError: {
|
|
109
|
+
target: 'fail',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
90
113
|
fail: {},
|
|
91
114
|
},
|
|
92
115
|
on: {
|
|
@@ -104,7 +127,14 @@ export default function (request) {
|
|
|
104
127
|
actions: 'setTagId',
|
|
105
128
|
},
|
|
106
129
|
PRESS_ENTER: {
|
|
107
|
-
target: '
|
|
130
|
+
target: 'fetchingGamesByKeyword',
|
|
131
|
+
},
|
|
132
|
+
PLAY_GAME: {
|
|
133
|
+
target: 'sendingTrace',
|
|
134
|
+
actions: 'setGameCode',
|
|
135
|
+
},
|
|
136
|
+
PLAY_MAY_LIKE_GAME: {
|
|
137
|
+
target: 'sendingMayLikeTrace',
|
|
108
138
|
},
|
|
109
139
|
},
|
|
110
140
|
},
|
|
@@ -144,7 +174,7 @@ export default function (request) {
|
|
|
144
174
|
}
|
|
145
175
|
}),
|
|
146
176
|
setTagId: assign((context, event) => {
|
|
147
|
-
const { tagId
|
|
177
|
+
const { tagId } = event.data
|
|
148
178
|
const { mainTagList, tagList, lang } = context
|
|
149
179
|
if (tagList.length === 0) {
|
|
150
180
|
const tagIndex = mainTagList.findIndex((tag) => tag.id === tagId)
|
|
@@ -165,10 +195,10 @@ export default function (request) {
|
|
|
165
195
|
}
|
|
166
196
|
}),
|
|
167
197
|
setGames: assign((context, event) => {
|
|
168
|
-
const { traceId,
|
|
198
|
+
const { traceId, gameList } = event.data
|
|
169
199
|
return {
|
|
170
200
|
traceId: traceId,
|
|
171
|
-
gameList:
|
|
201
|
+
gameList: gameList,
|
|
172
202
|
}
|
|
173
203
|
}),
|
|
174
204
|
setKeyword: assign((context, event) => {
|
|
@@ -187,8 +217,9 @@ export default function (request) {
|
|
|
187
217
|
}
|
|
188
218
|
}),
|
|
189
219
|
setTagList: assign((context, event) => {
|
|
220
|
+
const { tagList } = event.data
|
|
190
221
|
return {
|
|
191
|
-
tagList
|
|
222
|
+
tagList,
|
|
192
223
|
}
|
|
193
224
|
}),
|
|
194
225
|
setGameCode: assign((context, event) => {
|
|
@@ -216,7 +247,9 @@ export default function (request) {
|
|
|
216
247
|
fetchTags: async (context, event) => {
|
|
217
248
|
const { keyword, lang } = context
|
|
218
249
|
const { result } = await request.send(game.getGameTags({ q: keyword, lang }))
|
|
219
|
-
return
|
|
250
|
+
return {
|
|
251
|
+
tagList: result,
|
|
252
|
+
}
|
|
220
253
|
},
|
|
221
254
|
fetchInitialData: async (context, event) => {
|
|
222
255
|
const { keyword, lang } = context
|
|
@@ -242,7 +275,31 @@ export default function (request) {
|
|
|
242
275
|
clickDefault,
|
|
243
276
|
})
|
|
244
277
|
)
|
|
245
|
-
return { traceId, result }
|
|
278
|
+
return { traceId, gameList: result }
|
|
279
|
+
},
|
|
280
|
+
fetchGamesByKeyword: async (context, event) => {
|
|
281
|
+
const { keyword, click, clickDefault, lang } = context
|
|
282
|
+
const tag = await request.send(game.getGameTags({ q: keyword, lang }))
|
|
283
|
+
|
|
284
|
+
const tagId = tag.result[0].id
|
|
285
|
+
const tagIndex = null
|
|
286
|
+
|
|
287
|
+
const { traceId, result } = await request.send(
|
|
288
|
+
game.getGameSearchList({
|
|
289
|
+
id: tagId,
|
|
290
|
+
index: tagIndex,
|
|
291
|
+
q: keyword,
|
|
292
|
+
click,
|
|
293
|
+
clickDefault,
|
|
294
|
+
})
|
|
295
|
+
)
|
|
296
|
+
|
|
297
|
+
return {
|
|
298
|
+
tagId,
|
|
299
|
+
traceId,
|
|
300
|
+
gameList: result,
|
|
301
|
+
tagList: tag.result,
|
|
302
|
+
}
|
|
246
303
|
},
|
|
247
304
|
sendTrace: async (context, event) => {
|
|
248
305
|
const { traceId, tagId, tagIndex, gameCode, gameCodeIndex, keyword: query, click, clickDefault } = context
|
|
@@ -259,6 +316,13 @@ export default function (request) {
|
|
|
259
316
|
})
|
|
260
317
|
)
|
|
261
318
|
},
|
|
319
|
+
sendMayLikeTrace: async (context, event) => {
|
|
320
|
+
return await request.send(
|
|
321
|
+
game.setGameSearchTrace({
|
|
322
|
+
isYouMayLike: 1,
|
|
323
|
+
})
|
|
324
|
+
)
|
|
325
|
+
},
|
|
262
326
|
},
|
|
263
327
|
}
|
|
264
328
|
)
|