@jetthai/cuora 1.1.393 → 1.1.394-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 +4 -0
- package/package.json +1 -1
- package/src/api/account.js +8 -0
- package/src/api/common.js +5 -0
- package/src/api/index.js +2 -1
- package/src/machine/auth.js +2 -2
- package/src/machine/auth_otp_v3.js +19 -10
- package/src/machine/bank_binding.js +0 -1
- package/src/machine/common.js +13 -1
- package/src/machine/game_search_cash.js +5 -2
- package/src/request/request.js +9 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
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.394-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.394...v1.1.394-dev-1) (2025-11-10)
|
|
6
|
+
|
|
7
|
+
### [1.1.394](https://github.com/jetthai/cuora-module/compare/v1.1.393...v1.1.394) (2025-11-04)
|
|
8
|
+
|
|
5
9
|
### [1.1.393](https://github.com/jetthai/cuora-module/compare/v1.1.392...v1.1.393) (2025-10-17)
|
|
6
10
|
|
|
7
11
|
### [1.1.392](https://github.com/jetthai/cuora-module/compare/v1.1.391...v1.1.392) (2025-10-17)
|
package/package.json
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
bindingStatus: () => ({ url: 'account-binding/status', method: 'GET' }),
|
|
3
|
+
applyBinding: (data) => ({ url: 'account-binding/bind', method: 'POST', params: data }),
|
|
4
|
+
bindingVerification: (data) => ({ url: 'account-binding/acknowledge', method: 'POST', params: data }),
|
|
5
|
+
bindThirdParty: (data) => ({ url: 'account-binding/bind-third-party', method: 'GET', params: data }),
|
|
6
|
+
bindPassword: (data) => ({ url: 'account-binding/bind-password', method: 'POST', params: data }),
|
|
7
|
+
resetOtp: (data) => ({ url: 'account-binding/reset-otp', method: 'POST', params: data }),
|
|
8
|
+
}
|
package/src/api/common.js
CHANGED
|
@@ -7,4 +7,9 @@ export default {
|
|
|
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
9
|
getSiteInfoConfig: ({ appSecret, config }) => ({ url: 'get-site-config', method: 'get', params: { appSecret, config }, isPublic: true }),
|
|
10
|
+
sendPixel: ({ appSecret, eventId, fbc, fbp, event }) => ({
|
|
11
|
+
url: 'pixel',
|
|
12
|
+
method: 'post',
|
|
13
|
+
params: { appSecret, eventId, fbc, fbp, event },
|
|
14
|
+
}),
|
|
10
15
|
}
|
package/src/api/index.js
CHANGED
|
@@ -7,5 +7,6 @@ import payment from './payment.js'
|
|
|
7
7
|
import user from './user.js'
|
|
8
8
|
import form from './form.js'
|
|
9
9
|
import ranking from './ranking.js'
|
|
10
|
+
import account from './account.js'
|
|
10
11
|
|
|
11
|
-
export default { activity, auth, common, game, mailbox, payment, user, form, ranking }
|
|
12
|
+
export default { activity, auth, common, game, mailbox, payment, user, form, ranking, account }
|
package/src/machine/auth.js
CHANGED
|
@@ -451,7 +451,7 @@ export default function (request) {
|
|
|
451
451
|
affiliateCode,
|
|
452
452
|
nickname,
|
|
453
453
|
}
|
|
454
|
-
sentry
|
|
454
|
+
sentry?.captureMessage(JSON.stringify(messages))
|
|
455
455
|
|
|
456
456
|
const referralObj = {}
|
|
457
457
|
if (![undefined, 'undefined', null, 'null'].includes(affiliateCode)) {
|
|
@@ -481,7 +481,7 @@ export default function (request) {
|
|
|
481
481
|
window.location.href = redirectURL
|
|
482
482
|
},
|
|
483
483
|
setUserInfo: assign((context, event) => {
|
|
484
|
-
sentry
|
|
484
|
+
sentry?.setUser({ id: event.data.uid_site })
|
|
485
485
|
return {
|
|
486
486
|
userInfo: event.data,
|
|
487
487
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
2
|
import user from '../api/user.js'
|
|
3
3
|
import auth from '../api/auth.js'
|
|
4
|
+
import account from '../api/account.js'
|
|
4
5
|
|
|
5
6
|
export default function (request) {
|
|
6
7
|
return createMachine(
|
|
@@ -178,12 +179,16 @@ export default function (request) {
|
|
|
178
179
|
}
|
|
179
180
|
}),
|
|
180
181
|
setVerificationData: assign((context, event) => {
|
|
181
|
-
const {
|
|
182
|
+
const { request_id, ttl, email, countryCode, phone } = event.data
|
|
182
183
|
return {
|
|
183
|
-
requestId,
|
|
184
|
-
ttl: ttl
|
|
185
|
-
target
|
|
186
|
-
|
|
184
|
+
requestId: request_id,
|
|
185
|
+
ttl: ttl, // 後端傳過來的是毫秒
|
|
186
|
+
target: {
|
|
187
|
+
provider: context.strategy,
|
|
188
|
+
email: email,
|
|
189
|
+
countryCode: countryCode,
|
|
190
|
+
phone: phone,
|
|
191
|
+
},
|
|
187
192
|
}
|
|
188
193
|
}),
|
|
189
194
|
decreaseTtl: assign((context, evnet) => {
|
|
@@ -239,24 +244,28 @@ export default function (request) {
|
|
|
239
244
|
return await request.send(user.getUserInfo())
|
|
240
245
|
},
|
|
241
246
|
verify: async (context, event) => {
|
|
242
|
-
return await request.send(
|
|
247
|
+
return await request.send(account.applyBinding({ provider: context.strategy }))
|
|
243
248
|
},
|
|
244
249
|
sendPhone: async (context, event) => {
|
|
245
250
|
const { countryCode, phone } = context
|
|
246
|
-
return await request.send(
|
|
251
|
+
return await request.send(account.applyBinding({ provider: 'phone', countryCode, phone }))
|
|
247
252
|
},
|
|
248
253
|
sendEmail: async (context, event) => {
|
|
249
254
|
const { email } = context
|
|
250
|
-
return await request.send(
|
|
255
|
+
return await request.send(account.applyBinding({ provider: 'email', email }))
|
|
251
256
|
},
|
|
252
257
|
resetOtp: async (context, event) => {
|
|
253
258
|
const { requestId, target } = context
|
|
254
|
-
return await request.send(
|
|
259
|
+
return await request.send(
|
|
260
|
+
account.resetOtp({
|
|
261
|
+
request_id: requestId,
|
|
262
|
+
})
|
|
263
|
+
)
|
|
255
264
|
},
|
|
256
265
|
acknowledge: async (context, event) => {
|
|
257
266
|
const { requestId, target } = context
|
|
258
267
|
const code = event.data
|
|
259
|
-
return await request.send(
|
|
268
|
+
return await request.send(account.bindingVerification({ requestId, code }))
|
|
260
269
|
},
|
|
261
270
|
},
|
|
262
271
|
}
|
package/src/machine/common.js
CHANGED
|
@@ -55,7 +55,7 @@ export default function (request) {
|
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
fetching: {
|
|
58
|
-
entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel'],
|
|
58
|
+
entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel', 'setFbclid'],
|
|
59
59
|
invoke: {
|
|
60
60
|
src: 'fetchConfig',
|
|
61
61
|
onDone: [
|
|
@@ -237,6 +237,18 @@ export default function (request) {
|
|
|
237
237
|
isMobile: userAgent?.device?.type,
|
|
238
238
|
}
|
|
239
239
|
}),
|
|
240
|
+
setFbclid: assign(() => {
|
|
241
|
+
const urlParams = new URLSearchParams(window.location.search)
|
|
242
|
+
const fbclid = urlParams.get('fbclid') || ''
|
|
243
|
+
if (fbclid !== '') {
|
|
244
|
+
const timestamp = Date.now()
|
|
245
|
+
const cookieRecord = 'fb.1.' + timestamp + '.' + fbclid
|
|
246
|
+
document.cookie = `_fbc=${cookieRecord}; path=/; max-age=${60 * 60 * 24 * 7}`
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
fbclid,
|
|
250
|
+
}
|
|
251
|
+
}),
|
|
240
252
|
setPixel: assign(() => {
|
|
241
253
|
let urlParams = new URLSearchParams(window.location.search)
|
|
242
254
|
const pix = urlParams.get('pix') || storage.get('pix') || ''
|
|
@@ -66,6 +66,9 @@ export default function (request) {
|
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
|
+
resetDebounce: {
|
|
70
|
+
always: 'debouncing',
|
|
71
|
+
},
|
|
69
72
|
debouncing: {
|
|
70
73
|
after: {
|
|
71
74
|
500: {
|
|
@@ -135,12 +138,12 @@ export default function (request) {
|
|
|
135
138
|
},
|
|
136
139
|
on: {
|
|
137
140
|
SET_KEYWORD: {
|
|
138
|
-
target: '.
|
|
141
|
+
target: '.resetDebounce',
|
|
139
142
|
actions: ['setKeyword', 'setLang'],
|
|
140
143
|
cond: 'isInitialized',
|
|
141
144
|
},
|
|
142
145
|
CLEAR_KEYWORD: {
|
|
143
|
-
target: '.
|
|
146
|
+
target: '.resetDebounce',
|
|
144
147
|
actions: 'clearKeyword',
|
|
145
148
|
},
|
|
146
149
|
SET_TAG_ID: [
|
package/src/request/request.js
CHANGED
|
@@ -140,6 +140,15 @@ const supportVersion2List = [
|
|
|
140
140
|
'game/list/v3/gameInfo',
|
|
141
141
|
'payment/v2/uploadCommonSlip',
|
|
142
142
|
'game/history/options',
|
|
143
|
+
// 09/30
|
|
144
|
+
'pixel',
|
|
145
|
+
// 10/09
|
|
146
|
+
'account-binding/status',
|
|
147
|
+
'account-binding/bind',
|
|
148
|
+
'account-binding/acknowledge',
|
|
149
|
+
'account-binding/bind-third-party',
|
|
150
|
+
'account-binding/bind-password',
|
|
151
|
+
'account-binding/reset-otp',
|
|
143
152
|
]
|
|
144
153
|
|
|
145
154
|
function isValid(value) {
|