@jetthai/cuora 1.0.158 → 1.0.160
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 +4 -0
- package/package.json +2 -2
- package/src/api/index.js +8 -8
- package/src/index.js +5 -5
- package/src/machine/activity/activity.js +2 -2
- package/src/machine/activity/continue_deposit_activity.js +2 -2
- package/src/machine/activity/deposit_activity.js +2 -2
- package/src/machine/activity/diamond_shop_activity_fc.js +2 -2
- package/src/machine/activity/diamond_shop_activity_vn.js +2 -3
- package/src/machine/activity/fafafa_activity.js +3 -3
- package/src/machine/activity/index.js +13 -13
- package/src/machine/activity/invite_friends_activity.js +3 -3
- package/src/machine/activity/mini_game_activity.js +2 -2
- package/src/machine/activity/ranking_activity.js +2 -2
- package/src/machine/activity/return_bonus_activity.js +3 -3
- package/src/machine/activity/specify_bets_activity.js +2 -2
- package/src/machine/activity/specify_turnover_activity.js +2 -2
- package/src/machine/activity/time_bomb_activity.js +2 -2
- package/src/machine/auth.js +6 -7
- package/src/machine/auth_otp.js +2 -2
- package/src/machine/auth_otp_v2.js +2 -2
- package/src/machine/auth_otp_v3.js +3 -3
- package/src/machine/bank_binding.js +2 -2
- package/src/machine/bonus.js +2 -2
- package/src/machine/common.js +3 -3
- package/src/machine/deposit/crypto.js +3 -4
- package/src/machine/deposit/deposit_fc.js +3 -3
- package/src/machine/deposit/direct.js +2 -2
- package/src/machine/deposit/index.js +7 -7
- package/src/machine/deposit/loadcard_vn.js +2 -2
- package/src/machine/deposit/manual_vn.js +2 -2
- package/src/machine/deposit/qrcode_v2.js +2 -2
- package/src/machine/deposit/qrcode_vn.js +2 -2
- package/src/machine/error.js +1 -1
- package/src/machine/game.js +2 -2
- package/src/machine/game_favorite.js +2 -2
- package/src/machine/game_hot_new.js +2 -2
- package/src/machine/game_search.js +2 -2
- package/src/machine/inbox.js +3 -3
- package/src/machine/index.js +30 -32
- package/src/machine/leaderboard.js +2 -2
- package/src/machine/merge.js +2 -2
- package/src/machine/payment_data.js +2 -2
- package/src/machine/reward.js +2 -2
- package/src/machine/reward_fc.js +2 -2
- package/src/machine/setting.js +1 -1
- package/src/machine/side.js +18 -34
- package/src/machine/user_info.js +2 -2
- package/src/machine/user_reset_password.js +2 -2
- package/src/machine/user_sign_up.js +3 -3
- package/src/machine/vip_table.js +2 -2
- package/src/machine/welcome.js +3 -3
- package/src/machine/withdraw_crypto.js +6 -6
- package/src/machine/withdraw_fc.js +2 -3
- package/src/machine/withdraw_vn.js +5 -5
- package/src/request/request.js +2 -2
- package/src/util/index.js +1 -1
- package/src/machine/side_v2.js +0 -159
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.0.160](https://github.com/jetthai/cuora-module/compare/v1.0.159...v1.0.160) (2022-08-17)
|
|
6
|
+
|
|
7
|
+
### [1.0.159](https://github.com/jetthai/cuora-module/compare/v1.0.158...v1.0.159) (2022-08-11)
|
|
8
|
+
|
|
5
9
|
### [1.0.158](https://github.com/jetthai/cuora-module/compare/v1.0.157...v1.0.158) (2022-08-11)
|
|
6
10
|
|
|
7
11
|
### [1.0.157](https://github.com/jetthai/cuora-module/compare/v1.0.156...v1.0.157) (2022-08-11)
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jetthai/cuora",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.160",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"release": "standard-version && git push --follow-tags origin master && npm publish"
|
|
8
9
|
},
|
|
@@ -19,7 +20,6 @@
|
|
|
19
20
|
"dependencies": {
|
|
20
21
|
"@fingerprintjs/fingerprintjs-pro": "^3.5.7",
|
|
21
22
|
"lodash": "^4.17.21",
|
|
22
|
-
"qs": "^6.10.1",
|
|
23
23
|
"ua-parser-js": "^0.7.28",
|
|
24
24
|
"universal-cookie": "^4.0.4",
|
|
25
25
|
"url-join": "^4.0.1",
|
package/src/api/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import activity from './activity'
|
|
2
|
-
import auth from './auth'
|
|
3
|
-
import common from './common'
|
|
4
|
-
import game from './game'
|
|
5
|
-
import mailbox from './mailbox'
|
|
6
|
-
import payment from './payment'
|
|
7
|
-
import user from './user'
|
|
8
|
-
import form from './form'
|
|
1
|
+
import activity from './activity.js'
|
|
2
|
+
import auth from './auth.js'
|
|
3
|
+
import common from './common.js'
|
|
4
|
+
import game from './game.js'
|
|
5
|
+
import mailbox from './mailbox.js'
|
|
6
|
+
import payment from './payment.js'
|
|
7
|
+
import user from './user.js'
|
|
8
|
+
import form from './form.js'
|
|
9
9
|
|
|
10
10
|
export default { activity, auth, common, game, mailbox, payment, user, form }
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import api from './api'
|
|
2
|
-
import machine from './machine'
|
|
3
|
-
import Request from './request/request'
|
|
4
|
-
import Config from './request/config'
|
|
5
|
-
import util from './util'
|
|
1
|
+
import api from './api/index.js'
|
|
2
|
+
import machine from './machine/index.js'
|
|
3
|
+
import Request from './request/request.js'
|
|
4
|
+
import Config from './request/config.js'
|
|
5
|
+
import util from './util/index.js'
|
|
6
6
|
export { api, machine, Request, Config, util }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createMachine, assign
|
|
2
|
-
import api from '../../api/activity'
|
|
1
|
+
import { createMachine, assign } from 'xstate/lib/index.js'
|
|
2
|
+
import api from '../../api/activity.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import api from '../../api/activity'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import api from '../../api/activity.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import api from '../../api/activity'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import api from '../../api/activity.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import api from '../../api/activity'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import api from '../../api/activity.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import apiActivity from '../../api/activity.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
|
6
|
-
const apiActivity = api.activity
|
|
7
6
|
return createMachine(
|
|
8
7
|
{
|
|
9
8
|
id: 'diamond_shop_activity',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import isEqual from 'lodash/isEqual'
|
|
3
|
-
import api from '../../api/activity'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import isEqual from 'lodash/isEqual.js'
|
|
3
|
+
import api from '../../api/activity.js'
|
|
4
4
|
|
|
5
5
|
export default function (request) {
|
|
6
6
|
const { appSecret } = request.config
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import continue_deposit_activity from './continue_deposit_activity'
|
|
2
|
-
import deposit_activity from './deposit_activity'
|
|
3
|
-
import diamond_shop_activity_fc from './diamond_shop_activity_fc'
|
|
4
|
-
import diamond_shop_activity_vn from './diamond_shop_activity_vn'
|
|
5
|
-
import fafafa_activity from './fafafa_activity'
|
|
6
|
-
import invite_friends_activity from './invite_friends_activity'
|
|
7
|
-
import ranking_activity from './ranking_activity'
|
|
8
|
-
import return_bonus_activity from './return_bonus_activity'
|
|
9
|
-
import specify_bets_activity from './specify_bets_activity'
|
|
10
|
-
import specify_turnover_activity from './specify_turnover_activity'
|
|
11
|
-
import time_bomb_activity from './time_bomb_activity'
|
|
12
|
-
import mini_game_activity from './mini_game_activity'
|
|
13
|
-
import activity from './activity'
|
|
1
|
+
import continue_deposit_activity from './continue_deposit_activity.js'
|
|
2
|
+
import deposit_activity from './deposit_activity.js'
|
|
3
|
+
import diamond_shop_activity_fc from './diamond_shop_activity_fc.js'
|
|
4
|
+
import diamond_shop_activity_vn from './diamond_shop_activity_vn.js'
|
|
5
|
+
import fafafa_activity from './fafafa_activity.js'
|
|
6
|
+
import invite_friends_activity from './invite_friends_activity.js'
|
|
7
|
+
import ranking_activity from './ranking_activity.js'
|
|
8
|
+
import return_bonus_activity from './return_bonus_activity.js'
|
|
9
|
+
import specify_bets_activity from './specify_bets_activity.js'
|
|
10
|
+
import specify_turnover_activity from './specify_turnover_activity.js'
|
|
11
|
+
import time_bomb_activity from './time_bomb_activity.js'
|
|
12
|
+
import mini_game_activity from './mini_game_activity.js'
|
|
13
|
+
import activity from './activity.js'
|
|
14
14
|
|
|
15
15
|
export default {
|
|
16
16
|
continue_deposit_activity,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { assign, createMachine
|
|
2
|
-
import user from '../../api/user'
|
|
3
|
-
import api from '../../api/activity'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import user from '../../api/user.js'
|
|
3
|
+
import api from '../../api/activity.js'
|
|
4
4
|
|
|
5
5
|
export default function (request) {
|
|
6
6
|
const { appSecret } = request.config
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import api from '../../api/activity'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import api from '../../api/activity.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import api from '../../api/activity'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import api from '../../api/activity.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import api from '../../api/activity'
|
|
3
|
-
import isEqual from 'lodash/isEqual'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import api from '../../api/activity.js'
|
|
3
|
+
import isEqual from 'lodash/isEqual.js'
|
|
4
4
|
|
|
5
5
|
export default function (request) {
|
|
6
6
|
const { appSecret } = request.config
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import api from '../../api/activity'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import api from '../../api/activity.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import api from '../../api/activity'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import api from '../../api/activity.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import api from '../../api/activity'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import api from '../../api/activity.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
package/src/machine/auth.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import urljoin from 'url-join'
|
|
2
2
|
import Cookies from 'universal-cookie'
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { getDeviceToken } from '../util/deviceToken'
|
|
3
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
4
|
+
import auth from '../api/auth.js'
|
|
5
|
+
import user from '../api/user.js'
|
|
6
|
+
import { getDeviceToken } from '../util/deviceToken.js'
|
|
8
7
|
|
|
9
8
|
export default function (request) {
|
|
10
9
|
const { clientId, fpToken, sentry, defaultChannel, defaultSubchannel } = request.config
|
|
@@ -305,14 +304,14 @@ export default function (request) {
|
|
|
305
304
|
const redirectURL = urljoin(
|
|
306
305
|
request.config.fullURL,
|
|
307
306
|
'login?' +
|
|
308
|
-
|
|
307
|
+
new URLSearchParams({
|
|
309
308
|
provider,
|
|
310
309
|
redirectURI: `${window.location.protocol}//${window.location.host}`,
|
|
311
310
|
channel: cookies.get('channel') || channel || defaultChannel || 'official',
|
|
312
311
|
subchannel: cookies.get('subchannel') || subchannel || defaultSubchannel || 'pwa',
|
|
313
312
|
// dt,
|
|
314
313
|
platform: 'pwa',
|
|
315
|
-
})
|
|
314
|
+
}).toString()
|
|
316
315
|
)
|
|
317
316
|
window.location.href = redirectURL
|
|
318
317
|
},
|
package/src/machine/auth_otp.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import user from '../api/user'
|
|
3
|
-
import auth from '../api/auth'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import user from '../api/user.js'
|
|
3
|
+
import auth from '../api/auth.js'
|
|
4
4
|
|
|
5
5
|
export default function (request) {
|
|
6
6
|
return createMachine(
|
package/src/machine/bonus.js
CHANGED
package/src/machine/common.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import UAParser from 'ua-parser-js'
|
|
2
2
|
import Cookies from 'universal-cookie'
|
|
3
|
-
import { assign, createMachine } from 'xstate'
|
|
4
|
-
import pickBy from 'lodash/pickBy'
|
|
5
|
-
import api from '../api/common'
|
|
3
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
4
|
+
import pickBy from 'lodash/pickBy.js'
|
|
5
|
+
import api from '../api/common.js'
|
|
6
6
|
const cookies = new Cookies()
|
|
7
7
|
|
|
8
8
|
export default function (request) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import padStart from 'lodash/padStart'
|
|
3
|
-
import payment from '../../api/payment'
|
|
4
|
-
import toNumber from 'lodash/toNumber'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import padStart from 'lodash/padStart.js'
|
|
3
|
+
import payment from '../../api/payment.js'
|
|
5
4
|
|
|
6
5
|
export default function (request) {
|
|
7
6
|
return createMachine(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import toNumber from 'lodash/toNumber'
|
|
3
|
-
import payment from '../../api/payment'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import toNumber from 'lodash/toNumber.js'
|
|
3
|
+
import payment from '../../api/payment.js'
|
|
4
4
|
|
|
5
5
|
export default function (request) {
|
|
6
6
|
return createMachine(
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import manual_vn from './manual_vn'
|
|
2
|
-
import loadcard_vn from './loadcard_vn'
|
|
3
|
-
import qrcode_vn from './qrcode_vn'
|
|
4
|
-
import qrcode_v2 from './qrcode_v2'
|
|
5
|
-
import deposit_fc from './deposit_fc'
|
|
6
|
-
import crypto from './crypto'
|
|
7
|
-
import direct from './direct'
|
|
1
|
+
import manual_vn from './manual_vn.js'
|
|
2
|
+
import loadcard_vn from './loadcard_vn.js'
|
|
3
|
+
import qrcode_vn from './qrcode_vn.js'
|
|
4
|
+
import qrcode_v2 from './qrcode_v2.js'
|
|
5
|
+
import deposit_fc from './deposit_fc.js'
|
|
6
|
+
import crypto from './crypto.js'
|
|
7
|
+
import direct from './direct.js'
|
|
8
8
|
|
|
9
9
|
export default { manual_vn, loadcard_vn, qrcode_vn, qrcode_v2, deposit_fc, crypto, direct }
|
package/src/machine/error.js
CHANGED
package/src/machine/game.js
CHANGED
package/src/machine/inbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import mailbox from '../api/mailbox'
|
|
3
|
-
import activity from '../api/activity'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import mailbox from '../api/mailbox.js'
|
|
3
|
+
import activity from '../api/activity.js'
|
|
4
4
|
|
|
5
5
|
const messageState = {
|
|
6
6
|
// always: [{ actions: 'showUnread', cond: 'isShowUnread' }],
|
package/src/machine/index.js
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
import activity from './activity'
|
|
2
|
-
import auth from './auth'
|
|
3
|
-
import auth_otp from './auth_otp'
|
|
4
|
-
import welcome from './welcome'
|
|
5
|
-
import common from './common'
|
|
6
|
-
import error from './error'
|
|
7
|
-
import game from './game'
|
|
8
|
-
import game_favorite from './game_favorite'
|
|
9
|
-
import game_search from './game_search'
|
|
10
|
-
import game_hot_new from './game_hot_new'
|
|
11
|
-
import inbox from './inbox'
|
|
12
|
-
import merge from './merge'
|
|
13
|
-
import payment_data from './payment_data'
|
|
14
|
-
import reward_fc from './reward_fc'
|
|
15
|
-
import reward from './reward'
|
|
16
|
-
import setting from './setting'
|
|
17
|
-
import side from './side'
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import vip_table from './vip_table'
|
|
1
|
+
import activity from './activity/index.js'
|
|
2
|
+
import auth from './auth.js'
|
|
3
|
+
import auth_otp from './auth_otp.js'
|
|
4
|
+
import welcome from './welcome.js'
|
|
5
|
+
import common from './common.js'
|
|
6
|
+
import error from './error.js'
|
|
7
|
+
import game from './game.js'
|
|
8
|
+
import game_favorite from './game_favorite.js'
|
|
9
|
+
import game_search from './game_search.js'
|
|
10
|
+
import game_hot_new from './game_hot_new.js'
|
|
11
|
+
import inbox from './inbox.js'
|
|
12
|
+
import merge from './merge.js'
|
|
13
|
+
import payment_data from './payment_data.js'
|
|
14
|
+
import reward_fc from './reward_fc.js'
|
|
15
|
+
import reward from './reward.js'
|
|
16
|
+
import setting from './setting.js'
|
|
17
|
+
import side from './side.js'
|
|
18
|
+
import user_info from './user_info.js'
|
|
19
|
+
import user_sign_up from './user_sign_up.js'
|
|
20
|
+
import user_reset_password from './user_reset_password.js'
|
|
21
|
+
import bank_binding from './bank_binding.js'
|
|
22
|
+
import withdraw_fc from './withdraw_fc.js'
|
|
23
|
+
import withdraw_vn from './withdraw_vn.js'
|
|
24
|
+
import withdraw_crypto from './withdraw_crypto.js'
|
|
25
|
+
import deposit from './deposit/index.js'
|
|
26
|
+
import bonus from './bonus.js'
|
|
27
|
+
import leaderboard from './leaderboard.js'
|
|
28
|
+
import auth_otp_v2 from './auth_otp_v2.js'
|
|
29
|
+
import auth_otp_v3 from './auth_otp_v3.js'
|
|
30
|
+
import vip_table from './vip_table.js'
|
|
32
31
|
|
|
33
32
|
export default {
|
|
34
33
|
...activity,
|
|
@@ -49,7 +48,6 @@ export default {
|
|
|
49
48
|
reward_fc,
|
|
50
49
|
setting,
|
|
51
50
|
side,
|
|
52
|
-
side_v2,
|
|
53
51
|
user_info,
|
|
54
52
|
user_sign_up,
|
|
55
53
|
user_reset_password,
|
package/src/machine/merge.js
CHANGED
package/src/machine/reward.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createMachine, assign, send } from 'xstate'
|
|
2
|
-
import activity from '../api/activity'
|
|
1
|
+
import { createMachine, assign, send } from 'xstate/lib/index.js'
|
|
2
|
+
import activity from '../api/activity.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
package/src/machine/reward_fc.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createMachine, assign, send } from 'xstate'
|
|
2
|
-
import activity from '../api/activity'
|
|
1
|
+
import { createMachine, assign, send } from 'xstate/lib/index.js'
|
|
2
|
+
import activity from '../api/activity.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
const { appSecret } = request.config
|
package/src/machine/setting.js
CHANGED
package/src/machine/side.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import api from '../api/game'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import api from '../api/game.js'
|
|
3
3
|
|
|
4
4
|
export default function (request) {
|
|
5
5
|
return createMachine(
|
|
@@ -28,52 +28,28 @@ export default function (request) {
|
|
|
28
28
|
initial: 'home',
|
|
29
29
|
states: {
|
|
30
30
|
home: {
|
|
31
|
-
entry:
|
|
31
|
+
entry: createSideAction('home'),
|
|
32
32
|
},
|
|
33
33
|
favorite: {
|
|
34
|
-
entry:
|
|
34
|
+
entry: createSideAction('favorite'),
|
|
35
35
|
},
|
|
36
36
|
hot: {
|
|
37
|
-
entry:
|
|
38
|
-
if (!context.roomHistory.some((item) => item.id === context.menu.hot.id)) {
|
|
39
|
-
return { room: context.menu['hot'] }
|
|
40
|
-
}
|
|
41
|
-
}),
|
|
37
|
+
entry: createSideAction('hot'),
|
|
42
38
|
},
|
|
43
39
|
new: {
|
|
44
|
-
entry:
|
|
45
|
-
if (!context.roomHistory.some((item) => item.id === context.menu.new.id)) {
|
|
46
|
-
return { room: context.menu['new'] }
|
|
47
|
-
}
|
|
48
|
-
}),
|
|
40
|
+
entry: createSideAction('new'),
|
|
49
41
|
},
|
|
50
42
|
slot: {
|
|
51
|
-
entry:
|
|
52
|
-
if (!context.roomHistory.some((item) => item.id === context.menu.slot.id)) {
|
|
53
|
-
return { room: context.menu['slot'] }
|
|
54
|
-
}
|
|
55
|
-
}),
|
|
43
|
+
entry: createSideAction('slot'),
|
|
56
44
|
},
|
|
57
45
|
fish: {
|
|
58
|
-
entry:
|
|
59
|
-
if (!context.roomHistory.some((item) => item.id === context.menu.fish.id)) {
|
|
60
|
-
return { room: context.menu['fish'] }
|
|
61
|
-
}
|
|
62
|
-
}),
|
|
46
|
+
entry: createSideAction('fish'),
|
|
63
47
|
},
|
|
64
48
|
arcade: {
|
|
65
|
-
entry:
|
|
66
|
-
if (!context.roomHistory.some((item) => item.id === context.menu.arcade.id)) {
|
|
67
|
-
return { room: context.menu['arcade'] }
|
|
68
|
-
}
|
|
69
|
-
}),
|
|
49
|
+
entry: createSideAction('arcade'),
|
|
70
50
|
},
|
|
71
51
|
table: {
|
|
72
|
-
entry:
|
|
73
|
-
if (!context.roomHistory.some((item) => item.id === context.menu.table.id)) {
|
|
74
|
-
return { room: context.menu['table'] }
|
|
75
|
-
}
|
|
76
|
-
}),
|
|
52
|
+
entry: createSideAction('table'),
|
|
77
53
|
},
|
|
78
54
|
search: {},
|
|
79
55
|
history: {
|
|
@@ -168,3 +144,11 @@ export default function (request) {
|
|
|
168
144
|
}
|
|
169
145
|
)
|
|
170
146
|
}
|
|
147
|
+
|
|
148
|
+
function createSideAction(name) {
|
|
149
|
+
return assign((context, event) => {
|
|
150
|
+
if (!context.roomHistory.some((item) => item.id === context.menu[name].id)) {
|
|
151
|
+
return { room: context.menu[name] }
|
|
152
|
+
}
|
|
153
|
+
})
|
|
154
|
+
}
|
package/src/machine/user_info.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
2
|
import Cookies from 'universal-cookie'
|
|
3
|
-
import auth from '../api/auth'
|
|
4
|
-
import { getDeviceToken } from '../util/deviceToken'
|
|
3
|
+
import auth from '../api/auth.js'
|
|
4
|
+
import { getDeviceToken } from '../util/deviceToken.js'
|
|
5
5
|
|
|
6
6
|
const cookies = new Cookies()
|
|
7
7
|
|
package/src/machine/vip_table.js
CHANGED
package/src/machine/welcome.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { assign, createMachine
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
2
|
import Cookies from 'universal-cookie'
|
|
3
|
-
import payment from '../api/payment'
|
|
4
|
-
import user from '../api/user'
|
|
3
|
+
import payment from '../api/payment.js'
|
|
4
|
+
import user from '../api/user.js'
|
|
5
5
|
|
|
6
6
|
const cookies = new Cookies()
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import findLastIndex from 'lodash/findLastIndex'
|
|
3
|
-
import payment from '../api/payment'
|
|
4
|
-
import common from '../api/common'
|
|
5
|
-
import user from '../api/user'
|
|
6
|
-
import api from '../api/payment'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import findLastIndex from 'lodash/findLastIndex.js'
|
|
3
|
+
import payment from '../api/payment.js'
|
|
4
|
+
import common from '../api/common.js'
|
|
5
|
+
import user from '../api/user.js'
|
|
6
|
+
import api from '../api/payment.js'
|
|
7
7
|
|
|
8
8
|
export default function (request) {
|
|
9
9
|
const { appSecret } = request.config
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import api from '../api/payment'
|
|
3
|
-
import findLastIndex from 'lodash/findLastIndex'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import api from '../api/payment.js'
|
|
4
3
|
|
|
5
4
|
export default function (request) {
|
|
6
5
|
return createMachine(
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import findLastIndex from 'lodash/findLastIndex'
|
|
3
|
-
import payment from '../api/payment'
|
|
4
|
-
import common from '../api/common'
|
|
5
|
-
import user from '../api/user'
|
|
1
|
+
import { assign, createMachine } from 'xstate/lib/index.js'
|
|
2
|
+
import findLastIndex from 'lodash/findLastIndex.js'
|
|
3
|
+
import payment from '../api/payment.js'
|
|
4
|
+
import common from '../api/common.js'
|
|
5
|
+
import user from '../api/user.js'
|
|
6
6
|
|
|
7
7
|
export default function (request) {
|
|
8
8
|
const { appSecret } = request.config
|
package/src/request/request.js
CHANGED
package/src/util/index.js
CHANGED
package/src/machine/side_v2.js
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { assign, createMachine } from 'xstate'
|
|
2
|
-
import api from '../api/game'
|
|
3
|
-
|
|
4
|
-
export default function (request) {
|
|
5
|
-
return createMachine(
|
|
6
|
-
{
|
|
7
|
-
id: 'side',
|
|
8
|
-
initial: 'preparing',
|
|
9
|
-
context: {
|
|
10
|
-
menu: {},
|
|
11
|
-
room: null,
|
|
12
|
-
roomHistory: [],
|
|
13
|
-
},
|
|
14
|
-
states: {
|
|
15
|
-
preparing: {
|
|
16
|
-
invoke: {
|
|
17
|
-
src: 'getRoomItems',
|
|
18
|
-
onDone: {
|
|
19
|
-
target: 'room',
|
|
20
|
-
actions: 'makeMenu',
|
|
21
|
-
},
|
|
22
|
-
onError: {
|
|
23
|
-
target: 'room',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
room: {
|
|
28
|
-
initial: 'home',
|
|
29
|
-
states: {
|
|
30
|
-
home: {
|
|
31
|
-
entry: createSideAction('home'),
|
|
32
|
-
},
|
|
33
|
-
favorite: {
|
|
34
|
-
entry: createSideAction('favorite'),
|
|
35
|
-
},
|
|
36
|
-
hot: {
|
|
37
|
-
entry: createSideAction('hot'),
|
|
38
|
-
},
|
|
39
|
-
new: {
|
|
40
|
-
entry: createSideAction('new'),
|
|
41
|
-
},
|
|
42
|
-
slot: {
|
|
43
|
-
entry: createSideAction('slot'),
|
|
44
|
-
},
|
|
45
|
-
fish: {
|
|
46
|
-
entry: createSideAction('fish'),
|
|
47
|
-
},
|
|
48
|
-
arcade: {
|
|
49
|
-
entry: createSideAction('arcade'),
|
|
50
|
-
},
|
|
51
|
-
table: {
|
|
52
|
-
entry: createSideAction('table'),
|
|
53
|
-
},
|
|
54
|
-
search: {},
|
|
55
|
-
history: {
|
|
56
|
-
type: 'history',
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
feature: {
|
|
61
|
-
on: {
|
|
62
|
-
RETURN: { target: 'room.history' },
|
|
63
|
-
CLICK_HOT: { target: 'room.hot' },
|
|
64
|
-
CLICK_NEW: { target: 'room.new' },
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
category: {
|
|
68
|
-
on: {
|
|
69
|
-
RETURN: { target: 'room.history' },
|
|
70
|
-
CLICK_SLOT: { target: 'room.slot' },
|
|
71
|
-
CLICK_FISH: { target: 'room.fish' },
|
|
72
|
-
CLICK_ARCADE: { target: 'room.arcade' },
|
|
73
|
-
CLICK_TABLE: { target: 'room.table' },
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
on: {
|
|
78
|
-
CLICK_HOME: { target: 'room.home' },
|
|
79
|
-
CLICK_FAVORITE: { target: 'room.favorite' },
|
|
80
|
-
CLICK_FEATURE: { target: 'feature' },
|
|
81
|
-
CLICK_CATEGORY: { target: 'category' },
|
|
82
|
-
CLICK_SEARCH: { target: 'room.search' },
|
|
83
|
-
FORWARD_ROOM: { actions: 'forwardRoom' },
|
|
84
|
-
BACKWARD_ROOM: { actions: 'backwardRoom' },
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
actions: {
|
|
89
|
-
makeMenu: assign((context, event) => {
|
|
90
|
-
const { list = [] } = event.data
|
|
91
|
-
const map = {
|
|
92
|
-
home: ['SYSTEM_PERSONAL', 'SYSTEM_INDEX_LIST'],
|
|
93
|
-
favorite: 'SYSTEM_MY_FAVORITE',
|
|
94
|
-
hot: 'SYSTEM_TOP_GAME',
|
|
95
|
-
new: 'SYSTEM_NEW_GAME',
|
|
96
|
-
slot: 'SYSTEM_BIG_CATEGORY_SLOT',
|
|
97
|
-
fish: 'SYSTEM_BIG_CATEGORY_FISHING',
|
|
98
|
-
arcade: 'SYSTEM_BIG_CATEGORY_ARCADE',
|
|
99
|
-
table: 'SYSTEM_BIG_CATEGORY_TABLECARD',
|
|
100
|
-
limit: 'SYSTEM_ACTIVITY_LIMIT_GAME',
|
|
101
|
-
}
|
|
102
|
-
const menu = {}
|
|
103
|
-
Object.keys(map).forEach((key) => {
|
|
104
|
-
if (Array.isArray(map[key])) {
|
|
105
|
-
// 若是陣列則依順序決定館別內容
|
|
106
|
-
map[key].some((val) => {
|
|
107
|
-
const category = list.find((item) => item.category === val)
|
|
108
|
-
if (category) {
|
|
109
|
-
menu[key] = category
|
|
110
|
-
return true
|
|
111
|
-
} else {
|
|
112
|
-
return false
|
|
113
|
-
}
|
|
114
|
-
})
|
|
115
|
-
} else {
|
|
116
|
-
menu[key] = list.find((item) => item.category === map[key])
|
|
117
|
-
}
|
|
118
|
-
})
|
|
119
|
-
return { menu }
|
|
120
|
-
}),
|
|
121
|
-
forwardRoom: assign((context, event) => {
|
|
122
|
-
const currentRoom = event.data
|
|
123
|
-
return {
|
|
124
|
-
room: currentRoom,
|
|
125
|
-
roomHistory: [...context.roomHistory, context.room],
|
|
126
|
-
}
|
|
127
|
-
}),
|
|
128
|
-
backwardRoom: assign((context, event) => {
|
|
129
|
-
const newRoomHistory = context.roomHistory.slice(0, -1)
|
|
130
|
-
return {
|
|
131
|
-
room: newRoomHistory.slice(-1)[0],
|
|
132
|
-
roomHistory: newRoomHistory,
|
|
133
|
-
}
|
|
134
|
-
}),
|
|
135
|
-
resetRoomHistory: assign((context, event) => {
|
|
136
|
-
return {
|
|
137
|
-
roomHistory: [],
|
|
138
|
-
}
|
|
139
|
-
}),
|
|
140
|
-
},
|
|
141
|
-
services: {
|
|
142
|
-
getRoomItems: async (context, event) => {
|
|
143
|
-
return await request.send(api.getGameCategory({ id: context.room?.id }))
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
}
|
|
147
|
-
)
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function createSideAction(name) {
|
|
151
|
-
return assign((context, event) => {
|
|
152
|
-
const { roomHistory } = context
|
|
153
|
-
if (roomHistory.some((history) => history.id === context.menu[name].id)) {
|
|
154
|
-
return { room: roomHistory.slice(-1)[0], roomHistory: roomHistory.slice(0, -1) }
|
|
155
|
-
} else {
|
|
156
|
-
return { room: context.menu[name], roomHistory: [context.menu[name]] }
|
|
157
|
-
}
|
|
158
|
-
})
|
|
159
|
-
}
|