@jetthai/cuora 1.1.77-doubleWallet-fix → 1.1.78

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.77-doubleWallet-fix",
3
+ "version": "1.1.78",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/src/api/auth.js CHANGED
@@ -31,8 +31,8 @@ export default {
31
31
  },
32
32
  isPublic: true,
33
33
  }),
34
- register: ({ channel, subchannel, referralCode, affiliate = null, reCaptchaToken, dt, ...rest }) => {
35
- const params = pickBy({ channel, subchannel, referralCode, affiliate }, (value) => {
34
+ register: ({ channel, subchannel, ac, fc = null, reCaptchaToken, dt, ...rest }) => {
35
+ const params = pickBy({ channel, subchannel, ac, fc }, (value) => {
36
36
  return value !== undefined && value !== null
37
37
  })
38
38
  const qs = Object.keys(params)
package/src/api/user.js CHANGED
@@ -14,6 +14,11 @@ export default {
14
14
  getAffiliateDashboard: () => ({ url: 'affiliate/dashboard', method: 'get' }),
15
15
  getAffiliateDashboardList: ({ level, page, row }) => ({ url: 'affiliate/dashboard/list', method: 'post', params: { level, page, row } }),
16
16
  postAffiliate: ({ affiliateCode }) => ({ url: 'affiliate', method: 'post', params: { affiliateCode } }),
17
+ getFriends: () => ({ url: 'friends', method: 'get' }),
18
+ getFriendsHome: () => ({ url: 'friends/home', method: 'get' }),
19
+ getFriendsDashboard: () => ({ url: 'friends/dashboard', method: 'get' }),
20
+ getFriendsDashboardList: ({ level, page, row }) => ({ url: 'friends/dashboard/list', method: 'post', params: { level, page, row } }),
21
+ postFriends: ({ friendCode }) => ({ url: 'friends', method: 'post', params: { friendCode } }),
17
22
  passwordRecovery: (recoveryData) => ({ url: 'recovery', method: 'post', params: recoveryData, isPublic: true }),
18
23
  passwordAbandon: ({ number }) => ({ url: 'recovery/abandon', method: 'post', params: { number }, isPublic: true }),
19
24
  passwordAcknowledge: (acknowledgeData) => ({ url: 'recovery/acknowledge', method: 'post', params: acknowledgeData, isPublic: true }),
@@ -6,14 +6,14 @@ export default function (request) {
6
6
  const { appSecret } = request.config
7
7
  return createMachine(
8
8
  {
9
- id: 'affiliate_invite_friends_activity',
9
+ id: 'friend_invite_friends_activity',
10
10
  context: {
11
- affiliateEnable: false,
11
+ friendsEnable: false,
12
12
  activityNo: null,
13
13
  bindingCode: null,
14
14
  uidSite: null,
15
15
  receiveNo: null,
16
- affiliateCode: '',
16
+ friendCode: '',
17
17
  commission: 0,
18
18
  downLine: 0,
19
19
  activeDownLine: 0,
@@ -27,10 +27,10 @@ export default function (request) {
27
27
  states: {
28
28
  fetching1: {
29
29
  invoke: {
30
- src: 'fetchAffiliateCode',
30
+ src: 'fetchFriendsCode',
31
31
  onDone: {
32
32
  target: 'checking',
33
- actions: 'setAffiliateCode',
33
+ actions: 'setFriendsCode',
34
34
  },
35
35
  onError: {
36
36
  target: 'fetching2',
@@ -38,11 +38,11 @@ export default function (request) {
38
38
  },
39
39
  },
40
40
  checking: {
41
- always: [{ target: 'fetching2', cond: 'isAffiliateEnable' }, { target: 'idle' }],
41
+ always: [{ target: 'fetching2', cond: 'isFriendsEnable' }, { target: 'idle' }],
42
42
  },
43
43
  fetching2: {
44
44
  invoke: {
45
- src: 'fetchAffiliateData',
45
+ src: 'fetchFriendsData',
46
46
  onDone: {
47
47
  target: 'idle',
48
48
  actions: 'setInitialData',
@@ -54,7 +54,7 @@ export default function (request) {
54
54
  },
55
55
  idle: {
56
56
  on: {
57
- BIND_AFFILIATE_CODE: {
57
+ BIND_FRIEND_CODE: {
58
58
  target: 'binding',
59
59
  actions: ['setBindingCode', 'setUidSite', 'setActivityNo'],
60
60
  },
@@ -71,7 +71,7 @@ export default function (request) {
71
71
  },
72
72
  binding: {
73
73
  invoke: {
74
- src: 'postAffiliate',
74
+ src: 'postFriends',
75
75
  onDone: {
76
76
  target: 'awarding',
77
77
  },
@@ -115,10 +115,10 @@ export default function (request) {
115
115
  },
116
116
  {
117
117
  actions: {
118
- setAffiliateCode: assign((context, event) => {
119
- const { affiliateCode = '' } = event.data || {}
118
+ setFriendsCode: assign((context, event) => {
119
+ const { friendCode = '' } = event.data || {}
120
120
  return {
121
- affiliateCode,
121
+ friendCode,
122
122
  }
123
123
  }),
124
124
  setInitialData: assign((context, event) => {
@@ -175,31 +175,31 @@ export default function (request) {
175
175
  const { page } = context.levelDownLine
176
176
  return page.current < page.total
177
177
  },
178
- isAffiliateEnable: (context, event) => context.affiliateEnable,
178
+ isFriendsEnable: (context, event) => context.friendsEnable,
179
179
  },
180
180
  services: {
181
- fetchAffiliateCode: async () => {
182
- return await request.send(user.getAffiliate())
181
+ fetchFriendsCode: async () => {
182
+ return await request.send(user.getFriends())
183
183
  },
184
- fetchAffiliateData: async (context, event) => {
185
- const affiliateHomeAPI = request.send(user.getAffiliateHome())
186
- const affiliateDashboard = request.send(user.getAffiliateDashboard())
187
- const [affiliateHomeData, affiliateDashboardData] = await Promise.all([affiliateHomeAPI, affiliateDashboard])
188
- return [affiliateHomeData, affiliateDashboardData]
184
+ fetchFriendsData: async (context, event) => {
185
+ const friendsHomeAPI = request.send(user.getFriendsHome())
186
+ const friendsDashboard = request.send(user.getFriendsDashboard())
187
+ const [friendsHomeData, friendsDashboardData] = await Promise.all([friendsHomeAPI, friendsDashboard])
188
+ return [friendsHomeData, friendsDashboardData]
189
189
  },
190
- postAffiliate: async (context, event) => {
191
- return await request.send(user.postAffiliate({ affiliateCode: context.bindingCode }))
190
+ postFriends: async (context, event) => {
191
+ return await request.send(user.postFriends({ friendCode: context.bindingCode }))
192
192
  },
193
193
  awardPrize: async (context, event) => {
194
194
  const { activityNo, uidSite, bindingCode } = context
195
- const { data } = await request.send(api.sentAward({ activityNo, uidSite, affiliateCode: bindingCode, appSecret }))
195
+ const { data } = await request.send(api.sentAward({ activityNo, uidSite, friendCode: bindingCode, appSecret }))
196
196
  return data
197
197
  },
198
198
  fetchLevelDownLineList: async (context, event) => {
199
199
  const { currentLevel, page, levelDownLine } = context
200
200
  const copiedObj = JSON.parse(JSON.stringify(levelDownLine))
201
201
  const copiedList = copiedObj.data
202
- const resopnseData = await request.send(user.getAffiliateDashboardList({ level: currentLevel, page, row: 10 }))
202
+ const resopnseData = await request.send(user.getFriendsDashboardList({ level: currentLevel, page, row: 10 }))
203
203
  if (!!copiedList && !!resopnseData?.data) {
204
204
  const combindData = {
205
205
  ...resopnseData,
@@ -4,7 +4,7 @@ import diamond_shop_activity_fc from './diamond_shop_activity_fc.js'
4
4
  import diamond_shop_activity_vn from './diamond_shop_activity_vn.js'
5
5
  import fafafa_activity from './fafafa_activity.js'
6
6
  import invite_friends_activity from './invite_friends_activity.js'
7
- import affiliate_invite_friends_activity from './affiliate_invite_friends_activity.js'
7
+ import friend_invite_friends_activity from './friend_invite_friends_activity.js'
8
8
  import ranking_activity from './ranking_activity.js'
9
9
  import return_bonus_activity from './return_bonus_activity.js'
10
10
  import specify_bets_activity from './specify_bets_activity.js'
@@ -22,7 +22,7 @@ export default {
22
22
  diamond_shop_activity_vn,
23
23
  fafafa_activity,
24
24
  invite_friends_activity,
25
- affiliate_invite_friends_activity,
25
+ friend_invite_friends_activity,
26
26
  ranking_activity,
27
27
  return_bonus_activity,
28
28
  specify_bets_activity,
@@ -12,17 +12,17 @@ export default function (request) {
12
12
  bindingCode: null,
13
13
  uidSite: null,
14
14
  receiveNo: null,
15
- affiliateCode: null,
15
+ friendCode: null,
16
16
  downlineCount: 0,
17
17
  },
18
18
  initial: 'idle',
19
19
  states: {
20
20
  idle: {
21
21
  on: {
22
- FETCH_AFFILIATE_CODE: {
22
+ FETCH_FRIEND_CODE: {
23
23
  target: 'fetching',
24
24
  },
25
- BIND_AFFILIATE_CODE: {
25
+ BIND_FRIEND_CODE: {
26
26
  target: 'binding',
27
27
  actions: ['setActivityNo', 'setBindingCode', 'setUidSite'],
28
28
  },
@@ -74,9 +74,9 @@ export default function (request) {
74
74
  {
75
75
  actions: {
76
76
  setAffiliateCode: assign((context, event) => {
77
- const { affiliateCode, downlineCount } = event.data
77
+ const { friendCode, downlineCount } = event.data
78
78
  return {
79
- affiliateCode,
79
+ friendCode,
80
80
  downlineCount,
81
81
  }
82
82
  }),
@@ -98,7 +98,7 @@ export default function (request) {
98
98
  },
99
99
  services: {
100
100
  postAffiliate: async (context, event) => {
101
- return await request.send(user.postAffiliate({ affiliateCode: context.bindingCode }))
101
+ return await request.send(user.postAffiliate({ friendCode: context.bindingCode }))
102
102
  },
103
103
  fetchAffiliate: async (context, event) => {
104
104
  return await request.send(user.getAffiliate())
@@ -36,7 +36,7 @@ export default function (request) {
36
36
  userInfo: {},
37
37
  redirectURL: null,
38
38
  reCaptchaToken: null,
39
- affiliate: null,
39
+ fc: null,
40
40
  },
41
41
  states: {
42
42
  idle: {
@@ -321,7 +321,7 @@ export default function (request) {
321
321
  return { token }
322
322
  }),
323
323
  redirectTo3Party: async (context, event) => {
324
- const { provider, channel, subchannel, affiliate } = event.data
324
+ const { provider, channel, subchannel, fc } = event.data
325
325
 
326
326
  const dt = await getDeviceToken({
327
327
  fpToken,
@@ -359,7 +359,7 @@ export default function (request) {
359
359
  ...referralObj,
360
360
  // dt,
361
361
  platform: 'pwa',
362
- affiliate,
362
+ fc,
363
363
  }).toString()
364
364
  )
365
365
 
@@ -100,11 +100,6 @@ export default function (request) {
100
100
  },
101
101
  ],
102
102
  SELECT_AMOUNT: [
103
- {
104
- target: 'debouncing',
105
- actions: 'setAmount',
106
- cond: 'isDoubleWalletMode',
107
- },
108
103
  {
109
104
  target: 'pending',
110
105
  actions: 'addAmount',
@@ -163,11 +158,6 @@ export default function (request) {
163
158
  debouncing: {
164
159
  on: {
165
160
  SELECT_AMOUNT: [
166
- {
167
- target: 'debouncing',
168
- actions: 'setAmount',
169
- cond: 'isDoubleWalletMode',
170
- },
171
161
  {
172
162
  target: 'debouncing',
173
163
  actions: 'addAmount',
@@ -202,11 +192,6 @@ export default function (request) {
202
192
  entry: 'clearCalculation',
203
193
  on: {
204
194
  SELECT_AMOUNT: [
205
- {
206
- target: 'debouncing',
207
- actions: 'setAmount',
208
- cond: 'isDoubleWalletMode',
209
- },
210
195
  {
211
196
  target: 'pending',
212
197
  actions: 'addAmount',
@@ -407,9 +392,6 @@ export default function (request) {
407
392
  }),
408
393
  },
409
394
  guards: {
410
- isDoubleWalletMode: (context, event) => {
411
- return context.siteConfig?.walletMode === '4'
412
- },
413
395
  isFreeWalletMode: (context, event) => {
414
396
  return context.siteConfig?.walletMode === '2'
415
397
  },
@@ -218,7 +218,6 @@ export default function (request) {
218
218
  setLastPage: assign((context, event) => {
219
219
  const { index, content } = context
220
220
  return {
221
- loadable: false,
222
221
  isLastPage: index >= content?.totalPage - 1,
223
222
  }
224
223
  }),
@@ -14,7 +14,7 @@ export default function (request) {
14
14
  channel: null,
15
15
  subchannel: null,
16
16
  signUpData: {},
17
- affiliate: null,
17
+ fc: null,
18
18
  reCaptchaToken: null,
19
19
  registrationData: {
20
20
  account: null,
@@ -61,9 +61,9 @@ export default function (request) {
61
61
  }
62
62
  }),
63
63
  setAffiliate: assign((context, event) => {
64
- const { affiliate } = event.data
64
+ const { fc } = event.data
65
65
  return {
66
- affiliate,
66
+ fc,
67
67
  }
68
68
  }),
69
69
  setSignUpPhone: assign((context, event) => {
@@ -138,7 +138,7 @@ export default function (request) {
138
138
  ...referralObj,
139
139
  dt,
140
140
  reCaptchaToken: context.reCaptchaToken,
141
- affiliate: context.affiliate,
141
+ fc: context.fc,
142
142
  })
143
143
  )
144
144
  },