@jetthai/cuora 1.1.293-dev-5 → 1.1.293

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,44 +2,6 @@
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.293-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.296...v1.1.293-dev-5) (2024-08-20)
6
-
7
- ### [1.1.293-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.293-dev-3...v1.1.293-dev-4) (2024-08-20)
8
-
9
- ### [1.1.293-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.295...v1.1.293-dev-3) (2024-08-17)
10
-
11
- ### [1.1.293-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.293-dev-1...v1.1.293-dev-2) (2024-08-16)
12
-
13
- ### [1.1.293-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.293-dev...v1.1.293-dev-1) (2024-08-15)
14
-
15
- ### [1.1.293-dev](https://github.com/jetthai/cuora-module/compare/v1.1.294...v1.1.293-dev) (2024-08-15)
16
-
17
- ### [1.1.294](https://github.com/jetthai/cuora-module/compare/v1.1.293...v1.1.294) (2024-08-14)
18
-
19
- ### [1.1.293-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.293-dev-3...v1.1.293-dev-4) (2024-08-20)
20
-
21
- ### [1.1.293-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.295...v1.1.293-dev-3) (2024-08-17)
22
-
23
- ### [1.1.293-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.293-dev-1...v1.1.293-dev-2) (2024-08-16)
24
-
25
- ### [1.1.293-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.293-dev...v1.1.293-dev-1) (2024-08-15)
26
-
27
- ### [1.1.293-dev](https://github.com/jetthai/cuora-module/compare/v1.1.294...v1.1.293-dev) (2024-08-15)
28
-
29
- ### [1.1.294](https://github.com/jetthai/cuora-module/compare/v1.1.293...v1.1.294) (2024-08-14)
30
-
31
- ### [1.1.293-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.293-dev-1...v1.1.293-dev-2) (2024-08-16)
32
-
33
- ### [1.1.293-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.293-dev...v1.1.293-dev-1) (2024-08-15)
34
-
35
- ### [1.1.293-dev](https://github.com/jetthai/cuora-module/compare/v1.1.294...v1.1.293-dev) (2024-08-15)
36
-
37
- ### [1.1.294](https://github.com/jetthai/cuora-module/compare/v1.1.293...v1.1.294) (2024-08-14)
38
-
39
- ### [1.1.296](https://github.com/jetthai/cuora-module/compare/v1.1.295...v1.1.296) (2024-08-20)
40
-
41
- ### [1.1.295](https://github.com/jetthai/cuora-module/compare/v1.1.293...v1.1.295) (2024-08-17)
42
-
43
5
  ### [1.1.293](https://github.com/jetthai/cuora-module/compare/v1.1.292...v1.1.293) (2024-08-14)
44
6
 
45
7
  ### [1.1.292](https://github.com/jetthai/cuora-module/compare/v1.1.291...v1.1.292) (2024-08-12)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.293-dev-5",
3
+ "version": "1.1.293",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/src/api/common.js CHANGED
@@ -4,5 +4,4 @@ export default {
4
4
  feeds: ({ appSecret }) => ({ url: 'feeds', method: 'get', params: { appSecret }, isPublic: true }),
5
5
  broadcast: () => ({ url: 'broadcast', method: 'get', isPublic: true }),
6
6
  getAnnouncements: ({ appSecret }) => ({ url: 'getAnnouncements', params: { appSecret }, method: 'get', isPublic: true }),
7
- getNavbar: ({ appSecret } = {}) => ({ url: 'getNavbarSetting', params: { appSecret }, method: 'get', isPublic: true }),
8
7
  }
@@ -120,8 +120,8 @@ export default function (request) {
120
120
  }
121
121
  }),
122
122
  setInitData: assign((context, event) => {
123
- const { enableCollectButton = false, lastCollectTime = 0, lastEstimateTime = 0, rewardType } = event.data
124
- return { enableCollectButton, lastCollectTime, lastEstimateTime, rewardType }
123
+ const { enableCollectButton = false, lastCollectTime = 0, lastEstimateTime = 0 } = event.data
124
+ return { enableCollectButton, lastCollectTime, lastEstimateTime }
125
125
  }),
126
126
  setEstimateResult: assign((context, event) => {
127
127
  const {
@@ -244,14 +244,7 @@ export default function (request, context) {
244
244
  isSubmittable: (context, event) => {
245
245
  const { selectedCrypto, selectedAddress, selectedAmount, depositTime, receipt, calculation, siteConfig } = context
246
246
  const { bankDepositProofIsOptional = '1' } = siteConfig
247
- return (
248
- selectedCrypto &&
249
- selectedAddress &&
250
- selectedAmount &&
251
- (bankDepositProofIsOptional === '2' ? true : depositTime) &&
252
- calculation &&
253
- (receipt || bankDepositProofIsOptional !== '1')
254
- )
247
+ return selectedCrypto && selectedAddress && selectedAmount && depositTime && calculation && (receipt || bankDepositProofIsOptional === '0')
255
248
  },
256
249
  },
257
250
  services: {
@@ -553,7 +553,7 @@ export default function (request) {
553
553
  gametype_id: gameTypeId,
554
554
  mapping_id: mappingId,
555
555
  is_demo: false,
556
- is_mobile: isMobile === 'mobile' ? 'y' : null,
556
+ is_mobile: isMobile,
557
557
  lang,
558
558
  return_url: returnProviders.includes(providerId) ? `${window.location.origin}${context.base}return` : window.location.href, // For providers to return.
559
559
  }
@@ -35,7 +35,6 @@ import promotions from './promotions.js'
35
35
  import roulette_v2 from './roulette_v2.js'
36
36
  import honor_board_cash from './honor_board_cash.js'
37
37
  import user_photo from './user_photo.js'
38
- import navbar from './navbar.js'
39
38
 
40
39
  export default {
41
40
  ...activity,
@@ -74,6 +73,5 @@ export default {
74
73
  roulette_v2,
75
74
  honor_board_cash,
76
75
  user_photo,
77
- navbar,
78
76
  ...withdraw,
79
77
  }
@@ -35,7 +35,7 @@ export default function (request) {
35
35
  on: {
36
36
  SET_ACTIVITY_NO: {
37
37
  target: 'fetching',
38
- actions: ['setActivityNo', 'setDefaultActivity'],
38
+ actions: 'setActivityNo',
39
39
  },
40
40
  },
41
41
  },
@@ -141,11 +141,6 @@ export default function (request) {
141
141
  activityNo: event.data,
142
142
  }
143
143
  }),
144
- setDefaultActivity: assign((context, event) => {
145
- return {
146
- activityDetail: event.detail,
147
- }
148
- }),
149
144
  setInitData: assign((context, event) => {
150
145
  const { rewardList = [], latestSpinLeft = 0, spinLeft = 0, unCollectRewards = [], periodEndTime = '0' } = event.data || {}
151
146
  const combindedRewardList = rewardList.reduce((arr, item, index) => {
@@ -257,9 +252,9 @@ export default function (request) {
257
252
  },
258
253
  services: {
259
254
  fetchActivityDetail: async (context, event) => {
260
- const { activityNo, activityDetail = {} } = context
255
+ const { activityNo } = context
261
256
  const { data } = await request.send(api.getActivityDetail({ activityNo, appSecret }))
262
- return data.activityNo ? data : activityDetail
257
+ return data
263
258
  },
264
259
  exchange: async (context, event) => {
265
260
  const { activityNo, spinCount } = context
@@ -143,21 +143,7 @@ export default function (request) {
143
143
  }
144
144
  }),
145
145
  setSignUpEmail: assign((context, event) => {
146
- const {
147
- email,
148
- nick_name,
149
- password,
150
- channel,
151
- subchannel,
152
- bankCode,
153
- bankAccount,
154
- holderName,
155
- branch,
156
- branchCode,
157
- affiliateCode,
158
- countryCode,
159
- phone,
160
- } = event.data
146
+ const { email, nick_name, password, channel, subchannel, bankCode, bankAccount, holderName, branch, branchCode, affiliateCode } = event.data
161
147
  return {
162
148
  signUpData: {
163
149
  provider: 'email',
@@ -170,8 +156,6 @@ export default function (request) {
170
156
  branch,
171
157
  branchCode,
172
158
  affiliateCode,
173
- countryCode,
174
- phone,
175
159
  },
176
160
  channel,
177
161
  subchannel,
@@ -501,8 +501,8 @@ export default function (request) {
501
501
  return !context.boundBanks?.length
502
502
  },
503
503
  isConvertible: (context, event) => {
504
- const { enableWithdraw } = context
505
- return enableWithdraw
504
+ const { balance, enableWithdraw } = context
505
+ return balance > 0 && enableWithdraw
506
506
  },
507
507
  isNotWithdrawable: (context, event) => {
508
508
  const { balance, enableWithdraw, paymentDetail } = context
@@ -1,57 +0,0 @@
1
- import { assign, createMachine } from 'xstate'
2
- import common from '../api/common.js'
3
-
4
- export default function (request) {
5
- const { appSecret } = request.config
6
- return createMachine(
7
- {
8
- id: 'navbar',
9
- initial: 'fetching',
10
- context: {
11
- navbar: null,
12
- },
13
- states: {
14
- fetching: {
15
- invoke: {
16
- src: 'fetchNavbar',
17
- onDone: {
18
- target: 'idle',
19
- actions: 'setNavbar',
20
- },
21
- onError: {
22
- target: 'idle',
23
- },
24
- },
25
- },
26
- idle: {},
27
- },
28
- },
29
- {
30
- actions: {
31
- setNavbar: assign((context, event) => {
32
- const { navbarConfig } = event.data
33
- return {
34
- navbar: navbarConfig,
35
- }
36
- }),
37
- },
38
- services: {
39
- fetchNavbar: async (context, event) => {
40
- const navbar = await request.send(common.getNavbar({ appSecret }))
41
- const base64Url = navbar.config.split('.')[0]
42
- const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/')
43
- const decodeResult = decodeURIComponent(
44
- window
45
- .atob(base64)
46
- .split('')
47
- .map((c) => {
48
- return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)
49
- })
50
- .join('')
51
- )
52
- return { navbarConfig: JSON.parse(decodeResult) }
53
- },
54
- },
55
- }
56
- )
57
- }