@jetthai/cuora 1.1.337 → 1.1.338-dev-1

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,20 @@
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.338-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.338...v1.1.338-dev-1) (2025-02-04)
6
+
7
+ ### [1.1.336-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.337...v1.1.336-dev-10) (2025-02-04)
8
+
9
+ ### [1.1.336-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.336-dev-8...v1.1.336-dev-9) (2025-02-03)
10
+
11
+ ### [1.1.336-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.336-dev-7...v1.1.336-dev-8) (2025-02-03)
12
+
13
+ ### [1.1.336-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.336-dev-6...v1.1.336-dev-7) (2025-01-24)
14
+
15
+ ### [1.1.336-dev-6](https://github.com/jetthai/cuora-module/compare/v1.1.336...v1.1.336-dev-6) (2025-01-24)
16
+
17
+ ### [1.1.338](https://github.com/jetthai/cuora-module/compare/v1.1.337...v1.1.338) (2025-02-04)
18
+
5
19
  ### [1.1.337](https://github.com/jetthai/cuora-module/compare/v1.1.336...v1.1.337) (2025-02-04)
6
20
 
7
21
  ### [1.1.336](https://github.com/jetthai/cuora-module/compare/v1.1.335...v1.1.336) (2025-01-14)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.337",
3
+ "version": "1.1.338-dev-1",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/src/api/auth.js CHANGED
@@ -5,10 +5,10 @@ export default {
5
5
  method: 'post',
6
6
  isPublic: true,
7
7
  }),
8
- login: ({ username, password, provider, countryCode, phone, email, dt, reCaptchaToken }) => ({
8
+ login: ({ username, password, provider, countryCode, phone, email, dt, reCaptchaToken, additionalUserInfo, loginType, isSignature }) => ({
9
9
  url: 'login',
10
10
  method: 'post',
11
- params: { username, password, provider, countryCode, phone, email, dt },
11
+ params: { username, password, provider, countryCode, phone, email, dt, additionalUserInfo, loginType, isSignature },
12
12
  isPublic: true,
13
13
  headers: { 'x-access-captcha': reCaptchaToken },
14
14
  }),
package/src/api/common.js CHANGED
@@ -6,4 +6,5 @@ export default {
6
6
  getAnnouncements: ({ appSecret }) => ({ url: 'getAnnouncements', params: { appSecret }, method: 'get', isPublic: true }),
7
7
  getNavbar: ({ appSecret } = {}) => ({ url: 'getNavbarSetting', params: { appSecret }, method: 'get', isPublic: true }),
8
8
  getDefaultAffiliateCode: ({ appSecret }) => ({ url: 'getAffiliateCode', params: { appSecret }, method: 'get', isPublic: true }),
9
+ getSiteInfoConfig: ({ appSecret, config }) => ({ url: 'get-site-config', method: 'get', params: { appSecret, config }, isPublic: true }),
9
10
  }
package/src/api/game.js CHANGED
@@ -98,4 +98,6 @@ export default {
98
98
  params: { providerId, seqNo, lang },
99
99
  isPublic: true,
100
100
  }),
101
+ getFreeGameList: () => ({ method: 'get', url: 'activities/getFreeGameRewardList' }),
102
+ getFreeGameReward: ({ activityNo, receiveNo }) => ({ method: 'post', url: 'activities/getFreeGameReward', params: { activityNo, receiveNo } }),
101
103
  }
@@ -222,10 +222,10 @@ export default {
222
222
  params: { transferType: 'WITHDRAW', amount },
223
223
  }),
224
224
  getPromotionsList: () => ({ url: `payment/v2/bankWallet/promotions`, method: 'get' }),
225
- getWithdrawRulePreview: ({ applyType, applyNo, amount }) => ({
225
+ getWithdrawRulePreview: ({ applyType, applyNo, amount, isFreeGame }) => ({
226
226
  url: `payment/v2/bankWallet/promotion/preview`,
227
227
  method: 'post',
228
- params: { applyType, applyNo, amount },
228
+ params: { applyType, applyNo, amount, isFreeGame },
229
229
  }),
230
230
  applyPromotions: ({ promotionsNo, amount }) => ({
231
231
  url: `payment/v2/bankWallet/promotion/apply`,
@@ -33,6 +33,7 @@ export default function (request) {
33
33
  email: null,
34
34
  username: null,
35
35
  password: null,
36
+ additionalUserInfo: null,
36
37
  },
37
38
  countryAbbr: null,
38
39
  userInfo: {},
@@ -271,6 +272,10 @@ export default function (request) {
271
272
  LOGIN_APP: {
272
273
  target: '.authenticationApp',
273
274
  },
275
+ LOGIN_TELEGRAM: {
276
+ target: '.authentication',
277
+ actions: 'setLoginTelegram',
278
+ },
274
279
  SET_PLAY: {
275
280
  actions: 'setPlay',
276
281
  },
@@ -353,6 +358,17 @@ export default function (request) {
353
358
  },
354
359
  }
355
360
  }),
361
+ setLoginTelegram: assign((context, event) => {
362
+ const { loginType, additionalUserInfo, isSignature } = event.data
363
+ return {
364
+ loginData: {
365
+ provider: 'telegram',
366
+ loginType,
367
+ additionalUserInfo,
368
+ isSignature,
369
+ },
370
+ }
371
+ }),
356
372
  fetchToken: assign((context, event) => {
357
373
  const token = storage.get(tokenKey)
358
374
  return {
@@ -414,7 +430,7 @@ export default function (request) {
414
430
  }),
415
431
  redirectTo3Party: async (context, event) => {
416
432
  const { provider, channel, subchannel, fc } = event.data
417
- const deviceTokenEnable = context.siteConfig?.dtVerify === '1'
433
+ const deviceTokenEnable = context.siteConfig?.dtVerify
418
434
 
419
435
  const dt = await getDeviceToken({
420
436
  fpToken,
@@ -497,7 +513,7 @@ export default function (request) {
497
513
  return await request.send(user.getUserInfo())
498
514
  },
499
515
  checkDeviceToken: async (context, event) => {
500
- const deviceTokenEnable = context.siteConfig?.dtVerify === '1'
516
+ const deviceTokenEnable = context.siteConfig?.dtVerify
501
517
  if (deviceTokenEnable) {
502
518
  const { exist } = await request.send(user.checkDt())
503
519
  if (!exist) {
@@ -17,7 +17,7 @@ export default function (request) {
17
17
  lineat: null,
18
18
  },
19
19
  loginMethods: {},
20
- forceValidation: '0',
20
+ forceValidation: false,
21
21
  urls: {
22
22
  widget: null,
23
23
  },
@@ -55,8 +55,8 @@ export default function (request) {
55
55
  target: 'fetching',
56
56
  cond: (context, event) => {
57
57
  const { siteConfig = {}, promotion = {}, selectedCrypto } = context
58
- const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
59
- return !!selectedCrypto && walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
58
+ const { walletMode = '', bonusPreviewEnable } = siteConfig
59
+ return !!selectedCrypto && walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
60
60
  },
61
61
  },
62
62
  { target: 'loaded' },
@@ -72,8 +72,8 @@ export default function (request) {
72
72
  target: 'fetching',
73
73
  cond: (context, event) => {
74
74
  const { siteConfig = {}, promotion = {} } = context
75
- const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
76
- return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
75
+ const { walletMode = '', bonusPreviewEnable } = siteConfig
76
+ return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
77
77
  },
78
78
  },
79
79
  { target: 'loaded' },
@@ -49,8 +49,8 @@ export default function (request) {
49
49
  target: 'fetching',
50
50
  cond: (context, event) => {
51
51
  const { siteConfig = {}, promotion = {}, selectedCard } = context
52
- const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
53
- return !!selectedCard && walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
52
+ const { walletMode = '', bonusPreviewEnable } = siteConfig
53
+ return !!selectedCard && walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
54
54
  },
55
55
  },
56
56
  { target: 'loaded' },
@@ -78,8 +78,8 @@ export default function (request) {
78
78
  actions: 'setCard',
79
79
  cond: (context, event) => {
80
80
  const { siteConfig = {}, promotion = {} } = context
81
- const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
82
- return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
81
+ const { walletMode = '', bonusPreviewEnable } = siteConfig
82
+ return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
83
83
  },
84
84
  },
85
85
  {
@@ -216,8 +216,8 @@ export default function (request) {
216
216
  actions: 'setCard',
217
217
  cond: (context, event) => {
218
218
  const { siteConfig = {}, promotion = {} } = context
219
- const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
220
- return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
219
+ const { walletMode = '', bonusPreviewEnable } = siteConfig
220
+ return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
221
221
  },
222
222
  },
223
223
  {
@@ -49,8 +49,8 @@ export default function (request) {
49
49
  target: 'fetching',
50
50
  cond: (context, event) => {
51
51
  const { siteConfig = {}, promotion = {}, selectedQrcode } = context
52
- const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
53
- return !!selectedQrcode && walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
52
+ const { walletMode = '', bonusPreviewEnable } = siteConfig
53
+ return !!selectedQrcode && walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
54
54
  },
55
55
  },
56
56
  {
@@ -86,8 +86,8 @@ export default function (request) {
86
86
  actions: 'setQrcode',
87
87
  cond: (context, event) => {
88
88
  const { siteConfig = {}, promotion = {} } = context
89
- const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
90
- return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
89
+ const { walletMode = '', bonusPreviewEnable } = siteConfig
90
+ return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
91
91
  },
92
92
  },
93
93
  {
@@ -314,8 +314,8 @@ export default function (request) {
314
314
  actions: 'setQrcode',
315
315
  cond: (context, event) => {
316
316
  const { siteConfig = {}, promotion = {} } = context
317
- const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
318
- return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
317
+ const { walletMode = '', bonusPreviewEnable } = siteConfig
318
+ return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
319
319
  },
320
320
  },
321
321
  {
@@ -74,8 +74,8 @@ export default function (request) {
74
74
  target: 'fetching',
75
75
  cond: (context, event) => {
76
76
  const { siteConfig = {}, promotion = {} } = context
77
- const { walletMode = '', bonusPreviewEnable = '0' } = siteConfig
78
- return walletMode === '4' && bonusPreviewEnable === '1' && promotion.activityNo != 'none'
77
+ const { walletMode = '', bonusPreviewEnable } = siteConfig
78
+ return walletMode === '4' && bonusPreviewEnable && promotion.activityNo != 'none'
79
79
  },
80
80
  },
81
81
  { target: 'loaded' },
@@ -26,12 +26,16 @@ export default function () {
26
26
  { target: 'logout', cond: 'isLogout' },
27
27
  { target: 'deposit', cond: 'isNoBalance' },
28
28
  { target: 'unfinishedGame', cond: 'isUnfinishedGame', actions: 'setUnfinishedGame' },
29
+ { target: 'freeGameSettle', cond: 'isFreeGameSettle' },
30
+ { target: 'freeGameGiveUp', cond: 'isFreeGameGiveUp' },
29
31
  // { target: 'hall' },
30
32
  ],
31
33
  },
32
34
  logout: {},
33
35
  deposit: {},
34
36
  unfinishedGame: {},
37
+ freeGameSettle: {},
38
+ freeGameGiveUp: {},
35
39
  // hall: {},
36
40
  },
37
41
  },
@@ -65,6 +69,12 @@ export default function () {
65
69
  isUnfinishedGame: (context, event) => {
66
70
  return context.error.extend?.includes?.('unfinished_')
67
71
  },
72
+ isFreeGameSettle: (context, event) => {
73
+ return context.error.code === 'ERR_G124'
74
+ },
75
+ isFreeGameGiveUp: (context, event) => {
76
+ return context.error.code === 'ERR_G125'
77
+ },
68
78
  },
69
79
  services: {},
70
80
  }
@@ -344,9 +344,9 @@ export default function (request) {
344
344
  const isCustomerReply = data[0]?.from === 'SYSTEM'
345
345
  let combindedContent = ''
346
346
  if (isCustomerReply) {
347
- combindedContent = '-\n-------------------------\n' + data[0]?.content || '' + '\n-------------------------\n' + data[1]?.content || ''
347
+ combindedContent = data[0]?.content || '' + '\n' + data[1]?.content || ''
348
348
  } else {
349
- combindedContent = `-\n-------------------------\n${data[0]?.content || ''}`
349
+ combindedContent = `${data[0]?.content || ''}`
350
350
  }
351
351
  return {
352
352
  messageDetail: data,
@@ -30,6 +30,7 @@ export default function (request) {
30
30
  withdrawRules: [],
31
31
  withdrawRule: {},
32
32
  withdrawCheck: {},
33
+ freeGameDetail: [],
33
34
  amount: null,
34
35
  calculation: null,
35
36
 
@@ -134,11 +135,11 @@ export default function (request) {
134
135
  invoke: {
135
136
  src: 'convertFreeCredit',
136
137
  onDone: [
137
- {
138
- target: '#withdraw_manual.otp',
139
- actions: 'setOtp',
140
- cond: 'isOtpRequired',
141
- },
138
+ // {
139
+ // target: '#withdraw_manual.otp',
140
+ // actions: 'setOtp',
141
+ // cond: 'isOtpRequired',
142
+ // },
142
143
  { target: 'converted' },
143
144
  ],
144
145
  onError: {
@@ -147,10 +148,10 @@ export default function (request) {
147
148
  },
148
149
  },
149
150
  converted: {
150
- always: [
151
- { target: '#withdraw_manual.cash.unbound', cond: 'isBankNotBound' },
152
- { target: '#withdraw_manual.cash.withdrawable', cond: 'hasAttachmentType' },
153
- ],
151
+ // always: [
152
+ // { target: '#withdraw_manual.cash.unbound', cond: 'isBankNotBound' },
153
+ // { target: '#withdraw_manual.cash.withdrawable', cond: 'hasAttachmentType' },
154
+ // ],
154
155
  },
155
156
  },
156
157
  },
@@ -407,7 +408,7 @@ export default function (request) {
407
408
  }
408
409
  }),
409
410
  updateWithdrawCondition: assign((context, event) => {
410
- const { enableWithdraw, enableWithdrawAmount, currentWithdrawLimit, targetWithdrawLimit, balance } = event.data
411
+ const { enableWithdraw, enableWithdrawAmount, currentWithdrawLimit, targetWithdrawLimit, balance, freeGameDetail } = event.data
411
412
  const withdrawRules = event.data?.rules || []
412
413
  const rules = withdrawRules.filter((rule) => rule.maxWithdrawAmount > 0)
413
414
  const lastMatchedIndex = findLastIndex(rules, (rule) => balance >= rule.greaterEqualThen)
@@ -431,6 +432,7 @@ export default function (request) {
431
432
  enableWithdrawAmount: +enableWithdrawAmount,
432
433
  enableWithdraw,
433
434
  withdrawRules,
435
+ freeGameDetail,
434
436
  }
435
437
  }),
436
438
  setWithdrawRulePreview: assign((context, event) => {
@@ -507,8 +509,13 @@ export default function (request) {
507
509
  return !context.boundBanks?.length
508
510
  },
509
511
  isConvertible: (context, event) => {
510
- const { enableWithdraw } = context
511
- return enableWithdraw
512
+ const { enableWithdraw, freeGameDetail } = context
513
+ const isFreeGame = freeGameDetail?.length > 0
514
+ if (isFreeGame) {
515
+ return freeGameDetail[0]?.freeGameCount === freeGameDetail[0]?.freeGameUsedCount
516
+ } else {
517
+ return enableWithdraw
518
+ }
512
519
  },
513
520
  isNotWithdrawable: (context, event) => {
514
521
  const { balance, enableWithdraw, paymentDetail } = context
@@ -107,11 +107,11 @@ export default function (request) {
107
107
  invoke: {
108
108
  src: 'convertFreeCredit',
109
109
  onDone: [
110
- {
111
- target: '#withdraw_vn.otp',
112
- actions: 'setOtp',
113
- cond: 'isOtpRequired',
114
- },
110
+ // {
111
+ // target: '#withdraw_vn.otp',
112
+ // actions: 'setOtp',
113
+ // cond: 'isOtpRequired',
114
+ // },
115
115
  { target: 'converted' },
116
116
  ],
117
117
  onError: {
@@ -120,10 +120,10 @@ export default function (request) {
120
120
  },
121
121
  },
122
122
  converted: {
123
- always: [
124
- { target: '#withdraw_vn.cash.unbound', cond: 'isBankNotBound' },
125
- { target: '#withdraw_vn.cash.withdrawable', cond: 'hasAttachmentType' },
126
- ],
123
+ // always: [
124
+ // { target: '#withdraw_vn.cash.unbound', cond: 'isBankNotBound' },
125
+ // { target: '#withdraw_vn.cash.withdrawable', cond: 'hasAttachmentType' },
126
+ // ],
127
127
  },
128
128
  },
129
129
  },
@@ -110,7 +110,6 @@ export default class Request {
110
110
 
111
111
  _checkToken(req) {
112
112
  if (!req.isPublic && !this.getToken()) {
113
- console.error(req)
114
113
  throw { code: 'ERR_A103', url: req.url }
115
114
  }
116
115
  }
@@ -23,7 +23,6 @@ const getDeviceToken = async ({ fpToken, sentry, hosts, enable = true }) => {
23
23
  throw new Error('[Device Token] No token from FingerprintJS.')
24
24
  }
25
25
 
26
- console.log('[Device Token]', `${dt} from ${endpoints}`)
27
26
  sentry?.setTag('dt', dt)
28
27
  } catch (error) {
29
28
  console.error('[Device Token]', `${dt} from ${endpoints}`, error)