@jetthai/cuora 1.1.330-dev-3 → 1.1.330-dev-5
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
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
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.330-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.330-dev-4...v1.1.330-dev-5) (2024-12-23)
|
|
6
|
+
|
|
7
|
+
### [1.1.330-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.330-dev-3...v1.1.330-dev-4) (2024-12-19)
|
|
8
|
+
|
|
5
9
|
### [1.1.330-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.330-dev-2...v1.1.330-dev-3) (2024-12-19)
|
|
6
10
|
|
|
7
11
|
### [1.1.330-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.330-1...v1.1.330-dev-2) (2024-12-18)
|
package/package.json
CHANGED
package/src/api/game.js
CHANGED
|
@@ -92,4 +92,10 @@ export default {
|
|
|
92
92
|
addListFavorite: (code) => ({ method: 'post', url: 'game/list/v3/addMyFavorite', params: { games: [code] } }),
|
|
93
93
|
removeListFavorite: (code) => ({ method: 'post', url: 'game/list/v3/removeMyFavorite', params: { games: [code] } }),
|
|
94
94
|
getGameInfo: ({ appSecret, gameCode }) => ({ method: 'get', url: 'game/info', params: { appSecret, gameCode } }),
|
|
95
|
+
getGameReplayInfo: ({ providerId, seqNo, lang }) => ({
|
|
96
|
+
method: 'get',
|
|
97
|
+
url: 'game/gameReplay',
|
|
98
|
+
params: { providerId, seqNo, lang },
|
|
99
|
+
isPublic: true,
|
|
100
|
+
}),
|
|
95
101
|
}
|
|
@@ -54,7 +54,7 @@ export default function (request, context) {
|
|
|
54
54
|
entry: 'setDuration',
|
|
55
55
|
after: {
|
|
56
56
|
1000: {
|
|
57
|
-
target: '
|
|
57
|
+
target: 'received',
|
|
58
58
|
},
|
|
59
59
|
},
|
|
60
60
|
},
|
|
@@ -62,7 +62,7 @@ export default function (request, context) {
|
|
|
62
62
|
entry: 'setDuration',
|
|
63
63
|
after: {
|
|
64
64
|
1000: {
|
|
65
|
-
target: '
|
|
65
|
+
target: 'receivable',
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
68
|
on: {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { assign, createMachine } from 'xstate'
|
|
2
|
+
import game from '../api/game.js'
|
|
3
|
+
|
|
4
|
+
export default function (request, context) {
|
|
5
|
+
// const { appSecret } = request.config
|
|
6
|
+
const { providerId, seqNo, lang } = context
|
|
7
|
+
return createMachine(
|
|
8
|
+
{
|
|
9
|
+
id: 'game_replay',
|
|
10
|
+
initial: 'fetching',
|
|
11
|
+
context: {
|
|
12
|
+
gameReplayInfo: {},
|
|
13
|
+
},
|
|
14
|
+
states: {
|
|
15
|
+
fetching: {
|
|
16
|
+
invoke: {
|
|
17
|
+
src: 'fetchGameReplayInfo',
|
|
18
|
+
onDone: {
|
|
19
|
+
target: 'idle',
|
|
20
|
+
actions: 'setGameReplayInfo',
|
|
21
|
+
},
|
|
22
|
+
onError: {
|
|
23
|
+
target: 'idle',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
idle: {},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
actions: {
|
|
32
|
+
setGameReplayInfo: assign((context, event) => {
|
|
33
|
+
return {
|
|
34
|
+
gameReplayInfo: event.data.data,
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
services: {
|
|
39
|
+
// 取得遊戲重播資訊
|
|
40
|
+
fetchGameReplayInfo: async (context, event) => {
|
|
41
|
+
return await request.send(game.getGameReplayInfo({ providerId, seqNo, lang }))
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
}
|
package/src/machine/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import game_search_cash from './game_search_cash.js'
|
|
|
9
9
|
import game_search_v2 from './game_search_v2.js'
|
|
10
10
|
import game_hot_new from './game_hot_new.js'
|
|
11
11
|
import game_info from './game_info.js'
|
|
12
|
+
import game_replay from './game_replay.js'
|
|
12
13
|
import inbox from './inbox.js'
|
|
13
14
|
import merge from './merge.js'
|
|
14
15
|
import payment_data from './payment_data.js'
|
|
@@ -49,6 +50,7 @@ export default {
|
|
|
49
50
|
game_search_v2,
|
|
50
51
|
game_hot_new,
|
|
51
52
|
game_info,
|
|
53
|
+
game_replay,
|
|
52
54
|
inbox,
|
|
53
55
|
merge,
|
|
54
56
|
payment_data,
|