@jetthai/cuora 1.1.74-ac → 1.1.74

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.74-ac",
3
+ "version": "1.1.74",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -50,5 +50,4 @@ export default {
50
50
  exchange: (data) => ({ url: 'activities/exchange', method: 'post', params: data }),
51
51
  collect: (data) => ({ url: 'activities/collect', method: 'post', params: data }),
52
52
  getVipTable: () => ({ url: 'activities/viptable', method: 'get' }),
53
- getRankingList: () => ({ url: 'activities/ranking', method: 'get' }),
54
53
  }
package/src/api/auth.js CHANGED
@@ -31,8 +31,8 @@ export default {
31
31
  },
32
32
  isPublic: true,
33
33
  }),
34
- register: ({ channel, subchannel, ac, fc = null, reCaptchaToken, dt, ...rest }) => {
35
- const params = pickBy({ channel, subchannel, ac, fc }, (value) => {
34
+ register: ({ channel, subchannel, referralCode, affiliate = null, reCaptchaToken, dt, ...rest }) => {
35
+ const params = pickBy({ channel, subchannel, referralCode, affiliate }, (value) => {
36
36
  return value !== undefined && value !== null
37
37
  })
38
38
  const qs = Object.keys(params)
package/src/api/user.js CHANGED
@@ -14,11 +14,6 @@ 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 } }),
22
17
  passwordRecovery: (recoveryData) => ({ url: 'recovery', method: 'post', params: recoveryData, isPublic: true }),
23
18
  passwordAbandon: ({ number }) => ({ url: 'recovery/abandon', method: 'post', params: { number }, isPublic: true }),
24
19
  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: 'friend_invite_friends_activity',
9
+ id: 'affiliate_invite_friends_activity',
10
10
  context: {
11
- friendsEnable: false,
11
+ affiliateEnable: false,
12
12
  activityNo: null,
13
13
  bindingCode: null,
14
14
  uidSite: null,
15
15
  receiveNo: null,
16
- friendCode: '',
16
+ affiliateCode: '',
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: 'fetchFriendsCode',
30
+ src: 'fetchAffiliateCode',
31
31
  onDone: {
32
32
  target: 'checking',
33
- actions: 'setFriendsCode',
33
+ actions: 'setAffiliateCode',
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: 'isFriendsEnable' }, { target: 'idle' }],
41
+ always: [{ target: 'fetching2', cond: 'isAffiliateEnable' }, { target: 'idle' }],
42
42
  },
43
43
  fetching2: {
44
44
  invoke: {
45
- src: 'fetchFriendsData',
45
+ src: 'fetchAffiliateData',
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_FRIEND_CODE: {
57
+ BIND_AFFILIATE_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: 'postFriends',
74
+ src: 'postAffiliate',
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
- setFriendsCode: assign((context, event) => {
119
- const { friendCode = '' } = event.data || {}
118
+ setAffiliateCode: assign((context, event) => {
119
+ const { affiliateCode = '' } = event.data || {}
120
120
  return {
121
- friendCode,
121
+ affiliateCode,
122
122
  }
123
123
  }),
124
124
  setInitialData: assign((context, event) => {
@@ -175,20 +175,20 @@ export default function (request) {
175
175
  const { page } = context.levelDownLine
176
176
  return page.current < page.total
177
177
  },
178
- isFriendsEnable: (context, event) => context.friendsEnable,
178
+ isAffiliateEnable: (context, event) => context.affiliateEnable,
179
179
  },
180
180
  services: {
181
- fetchFriendsCode: async () => {
182
- return await request.send(user.getFriends())
181
+ fetchAffiliateCode: async () => {
182
+ return await request.send(user.getAffiliate())
183
183
  },
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]
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]
189
189
  },
190
- postFriends: async (context, event) => {
191
- return await request.send(user.postFriends({ friendCode: context.bindingCode }))
190
+ postAffiliate: async (context, event) => {
191
+ return await request.send(user.postAffiliate({ affiliateCode: context.bindingCode }))
192
192
  },
193
193
  awardPrize: async (context, event) => {
194
194
  const { activityNo, uidSite, bindingCode } = context
@@ -199,7 +199,7 @@ export default function (request) {
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.getFriendsDashboardList({ level: currentLevel, page, row: 10 }))
202
+ const resopnseData = await request.send(user.getAffiliateDashboardList({ 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 friend_invite_friends_activity from './friend_invite_friends_activity.js'
7
+ import affiliate_invite_friends_activity from './affiliate_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
- friend_invite_friends_activity,
25
+ affiliate_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
- friendCode: null,
15
+ affiliateCode: null,
16
16
  downlineCount: 0,
17
17
  },
18
18
  initial: 'idle',
19
19
  states: {
20
20
  idle: {
21
21
  on: {
22
- FETCH_FRIEND_CODE: {
22
+ FETCH_AFFILIATE_CODE: {
23
23
  target: 'fetching',
24
24
  },
25
- BIND_FRIEND_CODE: {
25
+ BIND_AFFILIATE_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 { friendCode, downlineCount } = event.data
77
+ const { affiliateCode, downlineCount } = event.data
78
78
  return {
79
- friendCode,
79
+ affiliateCode,
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({ friendCode: context.bindingCode }))
101
+ return await request.send(user.postAffiliate({ affiliateCode: 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
- fc: null,
39
+ affiliate: 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, fc } = event.data
324
+ const { provider, channel, subchannel, affiliate } = event.data
325
325
 
326
326
  const dt = await getDeviceToken({
327
327
  fpToken,
@@ -330,7 +330,7 @@ export default function (request) {
330
330
  })
331
331
  sentry.setTag('dt', dt)
332
332
 
333
- const affiliateCode = storage.get('ac')
333
+ const referralCode = storage.get('referralCode')
334
334
  const messages = {
335
335
  url: window.location.href,
336
336
  channelOrders: [
@@ -338,18 +338,18 @@ export default function (request) {
338
338
  { channel: defaultChannel, subchannel: defaultSubchannel },
339
339
  { channel: channel, subchannel: subchannel },
340
340
  ],
341
- affiliateCode,
341
+ referralCode,
342
342
  }
343
343
  sentry.captureMessage(JSON.stringify(messages))
344
344
 
345
345
  const referralObj = {}
346
346
  if (![undefined, 'undefined', null, 'null'].includes(referralCode)) {
347
- referralObj.ac = affiliateCode
347
+ referralObj.referralCode = referralCode
348
+ } else {
349
+ ;(referralObj.channel = storage.get('channel') || defaultChannel || channel),
350
+ (referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel)
348
351
  }
349
352
 
350
- referralObj.channel = storage.get('channel') || defaultChannel || channel
351
- referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel
352
-
353
353
  const redirectURL = urljoin(
354
354
  request.config.fullURL,
355
355
  'login?' +
@@ -359,7 +359,7 @@ export default function (request) {
359
359
  ...referralObj,
360
360
  // dt,
361
361
  platform: 'pwa',
362
- fc,
362
+ affiliate,
363
363
  }).toString()
364
364
  )
365
365
 
@@ -41,7 +41,7 @@ export default function (request) {
41
41
  sentNormalBroadcastList: [],
42
42
  channel: null,
43
43
  subchannel: null,
44
- affiliateCode: null,
44
+ referralCode: null,
45
45
  },
46
46
  states: {
47
47
  config: {
@@ -157,7 +157,7 @@ export default function (request) {
157
157
  let urlParams = new URLSearchParams(window.location.search)
158
158
  const channel = urlParams.get('channel') || storage.get('channel') || defaultChannel || 'official'
159
159
  const subchannel = urlParams.get('subchannel') || storage.get('subchannel') || defaultSubchannel || 'pwa'
160
- const affiliateCode = urlParams.get('ac') || urlParams.get('referralCode') || storage.get('ac') || storage.get('referralCode')
160
+ const referralCode = urlParams.get('referralCode') || storage.get('referralCode')
161
161
 
162
162
  storage.set('channel', channel, {
163
163
  path: '/',
@@ -167,7 +167,7 @@ export default function (request) {
167
167
  path: '/',
168
168
  maxAge: 60 * 60 * 24 * 7,
169
169
  })
170
- storage.set('ac', affiliateCode, {
170
+ storage.set('referralCode', referralCode, {
171
171
  path: '/',
172
172
  maxAge: 60 * 60 * 24 * 7,
173
173
  })
@@ -175,7 +175,7 @@ export default function (request) {
175
175
  return {
176
176
  channel,
177
177
  subchannel,
178
- affiliateCode,
178
+ referralCode,
179
179
  }
180
180
  }
181
181
  }),
@@ -105,7 +105,7 @@ export default function (request) {
105
105
  actions: 'setAmount',
106
106
  },
107
107
  CONFIRM: {
108
- target: 'debouncing',
108
+ target: 'calculating',
109
109
  },
110
110
  BACK: {
111
111
  target: 'loaded',
@@ -131,25 +131,10 @@ export default function (request) {
131
131
  calculating: {
132
132
  invoke: {
133
133
  src: 'fetchCalculation',
134
- onDone: [
135
- {
136
- target: 'submitting',
137
- actions: 'setCalculation',
138
- cond: (context, event) => {
139
- const { siteConfig = {}, selectedCard = {} } = context
140
- return siteConfig.walletMode === '2' && selectedCard.jumpLinkEnable === 1
141
- },
142
- },
143
- {
144
- target: 'cardInfo',
145
- actions: 'setCalculation',
146
- cond: 'isFreeWalletMode',
147
- },
148
- {
149
- target: 'calculated',
150
- actions: 'setCalculation',
151
- },
152
- ],
134
+ onDone: {
135
+ target: 'calculated',
136
+ actions: 'setCalculation',
137
+ },
153
138
  onError: {
154
139
  target: 'calculable',
155
140
  },
@@ -158,17 +143,10 @@ export default function (request) {
158
143
  calculable: {
159
144
  entry: 'clearCalculation',
160
145
  on: {
161
- SELECT_AMOUNT: [
162
- {
163
- target: 'pending',
164
- actions: 'setAmount',
165
- cond: 'isFreeWalletMode',
166
- },
167
- {
168
- target: 'debouncing',
169
- actions: 'setAmount',
170
- },
171
- ],
146
+ SELECT_AMOUNT: {
147
+ target: 'debouncing',
148
+ actions: 'setAmount',
149
+ },
172
150
  BACK: {
173
151
  target: 'loaded',
174
152
  },
@@ -333,9 +311,6 @@ export default function (request) {
333
311
  isFreeWalletMode: (context, event) => {
334
312
  return context.siteConfig?.walletMode === '2'
335
313
  },
336
- isDoubleWalletMode: (context, event) => {
337
- return context.siteConfig?.walletMode === '4'
338
- },
339
314
  isSubmittable: (context, event) => {
340
315
  const { cardNumber, serialNumber } = context
341
316
  return cardNumber && serialNumber
@@ -10,7 +10,6 @@ export default function (request) {
10
10
  id: 'game',
11
11
  type: 'parallel',
12
12
  context: {
13
- base: '',
14
13
  loadable: false,
15
14
  isLastPage: false,
16
15
  room: null,
@@ -370,7 +369,6 @@ export default function (request) {
370
369
  }
371
370
  },
372
371
  connectGame: async (context, event) => {
373
- const returnProviders = ['RSG', 'KP', 'EPICWIN', 'KA', 'AMBSLOT', 'SEXY_VENUS', 'SEXY_SEXYBCRT', 'PG', 'NPG']
374
372
  const { lang, isMobile } = context
375
373
  const { providerId, gameId, gameTypeId, mappingId } = context.game
376
374
  const params = {
@@ -381,7 +379,7 @@ export default function (request) {
381
379
  is_demo: false,
382
380
  is_mobile: isMobile,
383
381
  lang,
384
- return_url: returnProviders.includes(providerId) ? `${window.location.origin}${context.base}return` : window.location.href, // For providers to return.
382
+ return_url: window.location.href,
385
383
  }
386
384
  const { redirect_url } = await request.send(api.playGame(params))
387
385
  return { gameURL: redirect_url }
@@ -14,7 +14,7 @@ export default function (request) {
14
14
  channel: null,
15
15
  subchannel: null,
16
16
  signUpData: {},
17
- fc: null,
17
+ affiliate: 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 { fc } = event.data
64
+ const { affiliate } = event.data
65
65
  return {
66
- fc,
66
+ affiliate,
67
67
  }
68
68
  }),
69
69
  setSignUpPhone: assign((context, event) => {
@@ -112,7 +112,7 @@ export default function (request) {
112
112
  const dt = await getDeviceToken({ fpToken, sentry, hosts: request.hosts })
113
113
  sentry.setTag('dt', dt)
114
114
 
115
- const affiliateCode = storage.get('ac')
115
+ const referralCode = storage.get('referralCode')
116
116
  const messages = {
117
117
  url: window.location.href,
118
118
  channelOrders: [
@@ -120,25 +120,25 @@ export default function (request) {
120
120
  { channel: defaultChannel, subchannel: defaultSubchannel },
121
121
  { channel: channel, subchannel: subchannel },
122
122
  ],
123
- affiliateCode,
123
+ referralCode,
124
124
  }
125
125
  sentry.captureMessage(JSON.stringify(messages))
126
126
 
127
127
  const referralObj = {}
128
128
  if (![undefined, 'undefined', null, 'null'].includes(referralCode)) {
129
- referralObj.ac = affiliateCode
129
+ referralObj.referralCode = referralCode
130
+ } else {
131
+ ;(referralObj.channel = storage.get('channel') || defaultChannel || channel),
132
+ (referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel)
130
133
  }
131
134
 
132
- referralObj.channel = storage.get('channel') || defaultChannel || channel
133
- referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel
134
-
135
135
  return await request.send(
136
136
  auth.register({
137
137
  ...signUpData,
138
138
  ...referralObj,
139
139
  dt,
140
140
  reCaptchaToken: context.reCaptchaToken,
141
- fc: context.fc,
141
+ affiliate: context.affiliate,
142
142
  })
143
143
  )
144
144
  },