@jetthai/cuora 1.1.361-dev-1 → 1.1.361-dev-2
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/api/game.js +12 -0
- package/src/machine/game_betslip.js +46 -0
- package/src/machine/index.js +2 -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.361-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.361-dev-1...v1.1.361-dev-2) (2025-06-11)
|
|
6
|
+
|
|
5
7
|
### [1.1.361-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.361...v1.1.361-dev-1) (2025-06-09)
|
|
6
8
|
|
|
7
9
|
### [1.1.361](https://github.com/jetthai/cuora-module/compare/v1.1.360...v1.1.361) (2025-06-03)
|
package/package.json
CHANGED
package/src/api/game.js
CHANGED
|
@@ -99,4 +99,16 @@ export default {
|
|
|
99
99
|
getFreeGameList: () => ({ method: 'get', url: 'activities/getFreeGameRewardList' }),
|
|
100
100
|
getFreeGameReward: ({ activityNo, receiveNo }) => ({ method: 'post', url: 'activities/getFreeGameReward', params: { activityNo, receiveNo } }),
|
|
101
101
|
getV3GameInfo: ({ appSecret, gameCodes }) => ({ method: 'post', url: 'game/list/v3/gameInfo', params: { appSecret, gameCodes } }),
|
|
102
|
+
getProvableResult: ({ providerId, seqNo, lang, uidSite, appSecret }) => ({
|
|
103
|
+
method: 'get',
|
|
104
|
+
url: 'game/provable-result',
|
|
105
|
+
params: { providerId, seqNo, lang, uidSite, appSecret },
|
|
106
|
+
isPublic: true,
|
|
107
|
+
}),
|
|
108
|
+
getBetslip: ({ providerId, seqNo, lang, appSecret }) => ({
|
|
109
|
+
method: 'get',
|
|
110
|
+
url: 'game/betslip',
|
|
111
|
+
params: { providerId, seqNo, lang, appSecret },
|
|
112
|
+
isPublic: true,
|
|
113
|
+
}),
|
|
102
114
|
}
|
|
@@ -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_betslip',
|
|
10
|
+
initial: 'fetching',
|
|
11
|
+
context: {
|
|
12
|
+
gameBetSlip: {},
|
|
13
|
+
},
|
|
14
|
+
states: {
|
|
15
|
+
fetching: {
|
|
16
|
+
invoke: {
|
|
17
|
+
src: 'fetchBetslip',
|
|
18
|
+
onDone: {
|
|
19
|
+
target: 'idle',
|
|
20
|
+
actions: 'setBetslip',
|
|
21
|
+
},
|
|
22
|
+
onError: {
|
|
23
|
+
target: 'idle',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
idle: {},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
actions: {
|
|
32
|
+
setBetslip: assign((context, event) => {
|
|
33
|
+
return {
|
|
34
|
+
gameBetSlip: event.data,
|
|
35
|
+
}
|
|
36
|
+
}),
|
|
37
|
+
},
|
|
38
|
+
services: {
|
|
39
|
+
// 取得遊戲注單
|
|
40
|
+
fetchBetslip: async (context, event) => {
|
|
41
|
+
return await request.send(game.getBetslip({ providerId, seqNo, lang, appSecret }))
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
}
|
package/src/machine/index.js
CHANGED
|
@@ -10,6 +10,7 @@ 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
12
|
import game_replay from './game_replay.js'
|
|
13
|
+
import game_betslip from './game_betslip.js'
|
|
13
14
|
import inbox from './inbox.js'
|
|
14
15
|
import merge from './merge.js'
|
|
15
16
|
import payment_data from './payment_data.js'
|
|
@@ -53,6 +54,7 @@ export default {
|
|
|
53
54
|
game_hot_new,
|
|
54
55
|
game_info,
|
|
55
56
|
game_replay,
|
|
57
|
+
game_betslip,
|
|
56
58
|
inbox,
|
|
57
59
|
merge,
|
|
58
60
|
payment_data,
|