@jetthai/cuora 1.0.160 → 1.0.162

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/bundle.cjs +14309 -0
  3. package/package.json +5 -1
  4. package/rollup.config.js +14 -0
  5. package/src/machine/activity/activity.js +1 -1
  6. package/src/machine/activity/continue_deposit_activity.js +1 -1
  7. package/src/machine/activity/deposit_activity.js +1 -1
  8. package/src/machine/activity/diamond_shop_activity_fc.js +1 -1
  9. package/src/machine/activity/diamond_shop_activity_vn.js +1 -1
  10. package/src/machine/activity/fafafa_activity.js +4 -2
  11. package/src/machine/activity/invite_friends_activity.js +1 -1
  12. package/src/machine/activity/mini_game_activity.js +1 -1
  13. package/src/machine/activity/ranking_activity.js +1 -1
  14. package/src/machine/activity/return_bonus_activity.js +4 -2
  15. package/src/machine/activity/specify_bets_activity.js +1 -1
  16. package/src/machine/activity/specify_turnover_activity.js +1 -1
  17. package/src/machine/activity/time_bomb_activity.js +1 -1
  18. package/src/machine/auth.js +4 -2
  19. package/src/machine/auth_otp.js +1 -1
  20. package/src/machine/auth_otp_v2.js +1 -1
  21. package/src/machine/auth_otp_v3.js +1 -1
  22. package/src/machine/bank_binding.js +1 -1
  23. package/src/machine/bonus.js +1 -1
  24. package/src/machine/common.js +6 -3
  25. package/src/machine/deposit/crypto.js +4 -2
  26. package/src/machine/deposit/deposit_fc.js +4 -2
  27. package/src/machine/deposit/direct.js +1 -1
  28. package/src/machine/deposit/loadcard_vn.js +1 -1
  29. package/src/machine/deposit/manual_vn.js +1 -1
  30. package/src/machine/deposit/qrcode_v2.js +29 -8
  31. package/src/machine/deposit/qrcode_vn.js +1 -1
  32. package/src/machine/error.js +1 -1
  33. package/src/machine/game.js +4 -2
  34. package/src/machine/game_favorite.js +1 -1
  35. package/src/machine/game_hot_new.js +1 -1
  36. package/src/machine/game_search.js +1 -1
  37. package/src/machine/inbox.js +1 -1
  38. package/src/machine/leaderboard.js +1 -1
  39. package/src/machine/merge.js +1 -1
  40. package/src/machine/payment_data.js +1 -1
  41. package/src/machine/reward.js +1 -1
  42. package/src/machine/reward_fc.js +1 -1
  43. package/src/machine/setting.js +1 -1
  44. package/src/machine/side.js +1 -1
  45. package/src/machine/user_info.js +1 -1
  46. package/src/machine/user_reset_password.js +1 -1
  47. package/src/machine/user_sign_up.js +1 -1
  48. package/src/machine/vip_table.js +1 -1
  49. package/src/machine/welcome.js +1 -1
  50. package/src/machine/withdraw_crypto.js +4 -2
  51. package/src/machine/withdraw_fc.js +1 -1
  52. package/src/machine/withdraw_vn.js +4 -2
  53. package/src/request/config.js +3 -1
  54. package/src/request/request.js +3 -1
  55. package/dist/index.js +0 -2
  56. package/dist/index.js.LICENSE.txt +0 -30
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.160",
3
+ "version": "1.0.162",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
7
7
  "scripts": {
8
+ "build": "rollup --config rollup.config.js",
8
9
  "release": "standard-version && git push --follow-tags origin master && npm publish"
9
10
  },
10
11
  "repository": {
@@ -14,7 +15,10 @@
14
15
  "author": "Neil",
15
16
  "license": "ISC",
16
17
  "devDependencies": {
18
+ "@rollup/plugin-node-resolve": "^13.3.0",
19
+ "@rollup/plugin-replace": "^4.0.0",
17
20
  "prettier": "^2.3.0",
21
+ "rollup": "^2.78.1",
18
22
  "standard-version": "^9.3.1"
19
23
  },
20
24
  "dependencies": {
@@ -0,0 +1,14 @@
1
+ import resolve from '@rollup/plugin-node-resolve';
2
+ import replace from '@rollup/plugin-replace'
3
+
4
+ export default {
5
+ input: 'src/index.js',
6
+ output: {
7
+ file: 'dist/bundle.cjs',
8
+ format: 'cjs'
9
+ },
10
+ plugins: [
11
+ replace({'process.env.NODE_ENV': JSON.stringify('production')}),
12
+ resolve()
13
+ ]
14
+ }
@@ -1,4 +1,4 @@
1
- import { createMachine, assign } from 'xstate/lib/index.js'
1
+ import { createMachine, assign } from 'xstate'
2
2
  import api from '../../api/activity.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../../api/activity.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../../api/activity.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../../api/activity.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import apiActivity from '../../api/activity.js'
3
3
 
4
4
  export default function (request) {
@@ -1,7 +1,9 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
2
- import isEqual from 'lodash/isEqual.js'
1
+ import { assign, createMachine } from 'xstate'
2
+ // import isEqual from 'lodash/isEqual.js'
3
3
  import api from '../../api/activity.js'
4
4
 
5
+ const isEqual = require('lodash/isEqual')
6
+
5
7
  export default function (request) {
6
8
  const { appSecret } = request.config
7
9
  return createMachine(
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import user from '../../api/user.js'
3
3
  import api from '../../api/activity.js'
4
4
 
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../../api/activity.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../../api/activity.js'
3
3
 
4
4
  export default function (request) {
@@ -1,6 +1,8 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../../api/activity.js'
3
- import isEqual from 'lodash/isEqual.js'
3
+ // import isEqual from 'lodash/isEqual.js'
4
+
5
+ const isEqual = require('lodash/isEqual')
4
6
 
5
7
  export default function (request) {
6
8
  const { appSecret } = request.config
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../../api/activity.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../../api/activity.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../../api/activity.js'
3
3
 
4
4
  export default function (request) {
@@ -1,10 +1,12 @@
1
- import urljoin from 'url-join'
1
+ // import urljoin from 'url-join'
2
2
  import Cookies from 'universal-cookie'
3
- import { assign, createMachine } from 'xstate/lib/index.js'
3
+ import { assign, createMachine } from 'xstate'
4
4
  import auth from '../api/auth.js'
5
5
  import user from '../api/user.js'
6
6
  import { getDeviceToken } from '../util/deviceToken.js'
7
7
 
8
+ const urljoin = require('url-join')
9
+
8
10
  export default function (request) {
9
11
  const { clientId, fpToken, sentry, defaultChannel, defaultSubchannel } = request.config
10
12
  const tokenKey = `cuora_${clientId}`
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../api/user.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import user from '../api/user.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import user from '../api/user.js'
3
3
  import auth from '../api/auth.js'
4
4
 
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import payment from '../api/payment.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine, send } from 'xstate/lib/index.js'
1
+ import { assign, createMachine, send } from 'xstate'
2
2
  import payment from '../api/payment.js'
3
3
 
4
4
  export default function (request) {
@@ -1,8 +1,11 @@
1
- import UAParser from 'ua-parser-js'
1
+ // import UAParser from 'ua-parser-js'
2
2
  import Cookies from 'universal-cookie'
3
- import { assign, createMachine } from 'xstate/lib/index.js'
4
- import pickBy from 'lodash/pickBy.js'
3
+ import { assign, createMachine } from 'xstate'
4
+ // import pickBy from 'lodash/pickBy.js'
5
5
  import api from '../api/common.js'
6
+
7
+ const pickBy = require('lodash/pickBy')
8
+ const UAParser = require('ua-parser-js')
6
9
  const cookies = new Cookies()
7
10
 
8
11
  export default function (request) {
@@ -1,7 +1,9 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
2
- import padStart from 'lodash/padStart.js'
1
+ import { assign, createMachine } from 'xstate'
2
+ // import padStart from 'lodash/padStart.js'
3
3
  import payment from '../../api/payment.js'
4
4
 
5
+ const padStart = require('lodash/padStart')
6
+
5
7
  export default function (request) {
6
8
  return createMachine(
7
9
  {
@@ -1,7 +1,9 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
2
- import toNumber from 'lodash/toNumber.js'
1
+ import { assign, createMachine } from 'xstate'
2
+ // import toNumber from 'lodash/toNumber.js'
3
3
  import payment from '../../api/payment.js'
4
4
 
5
+ const toNumber = require('lodash/toNumber')
6
+
5
7
  export default function (request) {
6
8
  return createMachine(
7
9
  {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import payment from '../../api/payment.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import payment from '../../api/payment.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import payment from '../../api/payment.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import payment from '../../api/payment.js'
3
3
 
4
4
  export default function (request) {
@@ -41,28 +41,49 @@ export default function (request) {
41
41
  actions: 'setQrcode',
42
42
  },
43
43
  SELECT_AMOUNT: {
44
- target: 'calculable',
44
+ target: 'debouncing',
45
45
  actions: 'addAmount',
46
46
  },
47
47
  KEY_IN: {
48
- target: 'calculable',
48
+ target: 'calculating',
49
49
  actions: 'setAmount',
50
50
  },
51
51
  },
52
52
  },
53
+ debouncing: {
54
+ on: {
55
+ SELECT_AMOUNT: {
56
+ target: 'debouncing',
57
+ actions: 'addAmount',
58
+ },
59
+ KEY_IN: {
60
+ target: 'debouncing',
61
+ actions: 'setAmount',
62
+ },
63
+ BACK: {
64
+ target: 'loaded',
65
+ },
66
+ },
67
+ after: {
68
+ 1000: {
69
+ target: 'calculating',
70
+ },
71
+ },
72
+ },
53
73
  fail: {},
54
74
  calculable: {
55
75
  entry: 'clearCalculation',
56
76
  on: {
57
77
  SELECT_AMOUNT: {
78
+ target: 'debouncing',
58
79
  actions: 'addAmount',
59
80
  },
60
81
  KEY_IN: {
61
- target: 'calculable',
82
+ target: 'debouncing',
62
83
  actions: 'setAmount',
63
84
  },
64
85
  CALCULATE: {
65
- target: 'calculating',
86
+ target: 'debouncing',
66
87
  },
67
88
  BACK: {
68
89
  target: 'loaded',
@@ -84,11 +105,11 @@ export default function (request) {
84
105
  calculated: {
85
106
  on: {
86
107
  SELECT_AMOUNT: {
87
- target: 'calculable',
108
+ target: 'debouncing',
88
109
  actions: 'addAmount',
89
110
  },
90
111
  KEY_IN: {
91
- target: 'calculable',
112
+ target: 'debouncing',
92
113
  actions: 'setAmount',
93
114
  },
94
115
  CONFIRM: {
@@ -98,7 +119,7 @@ export default function (request) {
98
119
  target: 'loaded',
99
120
  },
100
121
  CLEAR_CALCULATION: {
101
- target: 'calculable',
122
+ target: 'debouncing',
102
123
  actions: 'clearCalculation',
103
124
  },
104
125
  },
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import payment from '../../api/payment.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
 
3
3
  export default function () {
4
4
  return createMachine(
@@ -1,6 +1,8 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../api/game.js'
3
- import UAParser from 'ua-parser-js'
3
+ // import UAParser from 'ua-parser-js'
4
+
5
+ const UAParser = require('ua-parser-js')
4
6
 
5
7
  export default function (request) {
6
8
  return createMachine(
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../api/game.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../api/game.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { createMachine, assign, send } from 'xstate/lib/index.js'
1
+ import { createMachine, assign, send } from 'xstate'
2
2
  import game from '../api/game.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import mailbox from '../api/mailbox.js'
3
3
  import activity from '../api/activity.js'
4
4
 
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../api/activity.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../api/payment.js'
3
3
  export default function (request) {
4
4
  return createMachine(
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import payment from '../api/payment.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { createMachine, assign, send } from 'xstate/lib/index.js'
1
+ import { createMachine, assign, send } from 'xstate'
2
2
  import activity from '../api/activity.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { createMachine, assign, send } from 'xstate/lib/index.js'
1
+ import { createMachine, assign, send } from 'xstate'
2
2
  import activity from '../api/activity.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
 
3
3
  export default function () {
4
4
  return createMachine(
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../api/game.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import user from '../api/user.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import user from '../api/user.js'
3
3
 
4
4
  export default function (request) {
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import Cookies from 'universal-cookie'
3
3
  import auth from '../api/auth.js'
4
4
  import { getDeviceToken } from '../util/deviceToken.js'
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import activity from '../api/activity.js'
3
3
  export default function (request) {
4
4
  return createMachine(
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import Cookies from 'universal-cookie'
3
3
  import payment from '../api/payment.js'
4
4
  import user from '../api/user.js'
@@ -1,10 +1,12 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
2
- import findLastIndex from 'lodash/findLastIndex.js'
1
+ import { assign, createMachine } from 'xstate'
2
+ // import findLastIndex from 'lodash/findLastIndex.js'
3
3
  import payment from '../api/payment.js'
4
4
  import common from '../api/common.js'
5
5
  import user from '../api/user.js'
6
6
  import api from '../api/payment.js'
7
7
 
8
+ const findLastIndex = require('lodash/findLastIndex')
9
+
8
10
  export default function (request) {
9
11
  const { appSecret } = request.config
10
12
  return createMachine(
@@ -1,4 +1,4 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
1
+ import { assign, createMachine } from 'xstate'
2
2
  import api from '../api/payment.js'
3
3
 
4
4
  export default function (request) {
@@ -1,9 +1,11 @@
1
- import { assign, createMachine } from 'xstate/lib/index.js'
2
- import findLastIndex from 'lodash/findLastIndex.js'
1
+ import { assign, createMachine } from 'xstate'
2
+ // import findLastIndex from 'lodash/findLastIndex.js'
3
3
  import payment from '../api/payment.js'
4
4
  import common from '../api/common.js'
5
5
  import user from '../api/user.js'
6
6
 
7
+ const findLastIndex = require('lodash/findLastIndex')
8
+
7
9
  export default function (request) {
8
10
  const { appSecret } = request.config
9
11
  return createMachine(
@@ -1,4 +1,6 @@
1
- import urljoin from 'url-join'
1
+ // import urljoin from 'url-join'
2
+
3
+ const urljoin = require('url-join')
2
4
 
3
5
  export default class Config {
4
6
  constructor({ apiURL, apiVersion, clientId, appSecret, platform, version, fpToken, sentry, defaultChannel, defaultSubchannel }) {
@@ -1,6 +1,8 @@
1
- import pickBy from 'lodash/pickBy.js'
1
+ // import pickBy from 'lodash/pickBy.js'
2
2
  import Cookie from './cookie.js'
3
3
 
4
+ const pickBy = require('lodash/pickBy')
5
+
4
6
  function isValid(value) {
5
7
  return value !== undefined && value !== null
6
8
  }