@jetthai/cuora 1.0.150 → 1.0.151

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,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.0.151](https://github.com/jetthai/cuora-module/compare/v1.0.150...v1.0.151) (2022-07-27)
6
+
5
7
  ### [1.0.150](https://github.com/jetthai/cuora-module/compare/v1.0.149...v1.0.150) (2022-07-27)
6
8
 
7
9
  ### [1.0.149](https://github.com/jetthai/cuora-module/compare/v1.0.148...v1.0.149) (2022-07-26)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.0.150",
3
+ "version": "1.0.151",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -48,4 +48,5 @@ export default {
48
48
  getRewardList: ({ rewardType, count, appSecret }) => ({ url: 'activities/rewards', method: 'get', params: { rewardType, count, appSecret } }),
49
49
  exchange: (data) => ({ url: 'activities/exchange', method: 'post', params: data }),
50
50
  collect: (data) => ({ url: 'activities/collect', method: 'post', params: data }),
51
+ getVipTable: () => ({ url: 'activities/viptable', method: 'get' }),
51
52
  }
package/src/api/user.js CHANGED
@@ -10,7 +10,6 @@ export default {
10
10
  setPreference: ({ defaultCategory }) => ({ url: 'settings/preference', method: 'post', params: { defaultCategory } }),
11
11
  resetOtp: ({ requestId, number }) => ({ url: 'reset', method: 'post', params: { requestId, number } }),
12
12
  getAffiliate: () => ({ url: 'affiliate', method: 'get' }),
13
- getVipTable: () => ({ url: 'viptable', method: 'get' }),
14
13
  postAffiliate: ({ affiliateCode }) => ({ url: 'affiliate', method: 'post', params: { affiliateCode } }),
15
14
  passwordRecovery: (recoveryData) => ({ url: 'recovery', method: 'post', params: recoveryData, isPublic: true }),
16
15
  passwordAbandon: ({ number }) => ({ url: 'recovery/abandon', method: 'post', params: { number }, isPublic: true }),
@@ -291,14 +291,14 @@ export default function (request) {
291
291
  const redirectURL = urljoin(
292
292
  request.config.fullURL,
293
293
  'login?' +
294
- qs.stringify({
295
- provider,
296
- redirectURI: `${window.location.protocol}//${window.location.host}`,
297
- channel: cookies.get('channel') || channel || defaultChannel || 'official',
298
- subchannel: cookies.get('subchannel') || subchannel || defaultSubchannel || 'pwa',
299
- // dt,
300
- platform: 'pwa',
301
- })
294
+ qs.stringify({
295
+ provider,
296
+ redirectURI: `${window.location.protocol}//${window.location.host}`,
297
+ channel: cookies.get('channel') || channel || defaultChannel || 'official',
298
+ subchannel: cookies.get('subchannel') || subchannel || defaultSubchannel || 'pwa',
299
+ // dt,
300
+ platform: 'pwa',
301
+ })
302
302
  )
303
303
  window.location.href = redirectURL
304
304
  },
@@ -16,7 +16,7 @@ export default function (request) {
16
16
  currentCategory: 'direct',
17
17
  currentMethod: null,
18
18
  amount: null,
19
- result: null,
19
+ result: null
20
20
  },
21
21
  states: {
22
22
  loading: {
@@ -51,7 +51,7 @@ export default function (request) {
51
51
  loaded: {
52
52
  on: {
53
53
  SELECT_DIRECT: {
54
- actions: ['setDirect', 'reset'],
54
+ actions: ['setDirect', 'reset']
55
55
  },
56
56
  SELECT_BANK: {
57
57
  actions: 'setSelectedBank',
@@ -142,7 +142,7 @@ export default function (request) {
142
142
  }),
143
143
  setAmount: assign((context, event) => {
144
144
  return {
145
- amount: event.data,
145
+ amount: event.data
146
146
  }
147
147
  }),
148
148
  setCalculation: assign((context, event) => {
@@ -200,7 +200,7 @@ export default function (request) {
200
200
  payment.submitDepositTransactionBank({
201
201
  method: currentMethod,
202
202
  amount,
203
- applyerBankCode: selectedBank.bankCode,
203
+ applyerBankCode: selectedBank.bankCode
204
204
  })
205
205
  )
206
206
  },
@@ -15,7 +15,7 @@ export default function (request) {
15
15
  channel: null,
16
16
  subchannel: null,
17
17
  signUpData: {},
18
- reCaptchaToken: null,
18
+ reCaptchaToken: null
19
19
  },
20
20
  states: {
21
21
  idle: {
@@ -49,7 +49,7 @@ export default function (request) {
49
49
  setReCaptchaToken: assign((context, event) => {
50
50
  const { reCaptchaToken } = event.data
51
51
  return {
52
- reCaptchaToken,
52
+ reCaptchaToken
53
53
  }
54
54
  }),
55
55
  setSignUpPhone: assign((context, event) => {
@@ -89,7 +89,7 @@ export default function (request) {
89
89
  channel: cookies.get('channel') || defaultChannel || channel,
90
90
  subchannel: cookies.get('subchannel') || defaultSubchannel || subchannel,
91
91
  dt,
92
- reCaptchaToken: context.reCaptchaToken,
92
+ reCaptchaToken: context.reCaptchaToken
93
93
  })
94
94
  )
95
95
  },
@@ -1,5 +1,5 @@
1
1
  import { createMachine, assign } from 'xstate'
2
- import user from '../api/user'
2
+ import activity from '../api/activity'
3
3
  export default function (request) {
4
4
  return createMachine(
5
5
  {
@@ -13,7 +13,7 @@ export default function (request) {
13
13
  cashbackOthers: [],
14
14
  cashbackSlot: [],
15
15
  cashbackFishing: [],
16
- upgradeReward: [],
16
+ upgradeReward: []
17
17
  },
18
18
  states: {
19
19
  fetching: {
@@ -26,23 +26,23 @@ export default function (request) {
26
26
  onError: {
27
27
  target: 'fail',
28
28
  },
29
- },
29
+ }
30
30
  },
31
31
  completed: {},
32
- fail: {},
33
- },
32
+ fail: {}
33
+ }
34
34
  },
35
35
  {
36
36
  actions: {
37
37
  setVipTable: assign((context, event) => {
38
38
  const vipTable = event.data
39
39
  const filterVipTable = vipTable.filter((item) => item.title !== 'rookie' && item.title !== 'guest')
40
- const fasterWithdraw = filterVipTable.map((item) => item.fasterWithdraw)
41
- const fasterReward = filterVipTable.map((item) => item.fasterReward)
42
- const cashbackOthers = filterVipTable.map((item) => item.cashbackOther)
43
- const cashbackSlot = filterVipTable.map((item) => item.cashbackSlot)
44
- const cashbackFishing = filterVipTable.map((item) => item.cashbackFishing)
45
- const upgradeReward = filterVipTable.map((item) => {
40
+ const fasterWithdraw = filterVipTable.map(item => item.fasterWithdraw)
41
+ const fasterReward = filterVipTable.map(item => item.fasterReward)
42
+ const cashbackOthers = filterVipTable.map(item => item.cashbackOther)
43
+ const cashbackSlot = filterVipTable.map(item => item.cashbackSlot)
44
+ const cashbackFishing = filterVipTable.map(item => item.cashbackFishing)
45
+ const upgradeReward = filterVipTable.map(item => {
46
46
  return {
47
47
  reward: item.upgradeReward,
48
48
  type: item.rewardType,
@@ -57,22 +57,22 @@ export default function (request) {
57
57
  cashbackOthers,
58
58
  cashbackSlot,
59
59
  cashbackFishing,
60
- upgradeReward,
60
+ upgradeReward
61
61
  }
62
62
  }),
63
63
  },
64
64
  services: {
65
65
  fetchVipTable: async (context, event) => {
66
- const { viptable = {} } = await request.send(user.getVipTable())
66
+ const { viptable = {} } = await request.send(activity.getVipTable())
67
67
  const { data = [] } = viptable
68
- data.map((item) => {
68
+ data.map(item => {
69
69
  item.title = item.title.toLowerCase()
70
70
  return item
71
71
  })
72
72
 
73
73
  return data
74
74
  },
75
- },
75
+ }
76
76
  }
77
77
  )
78
- }
78
+ }