@jetthai/cuora 1.1.399-dev-1 → 1.1.399-dev-2
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 +2 -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 +3 -1
- package/src/api/otp.js +5 -0
- package/src/machine/auth_otp_v3.js +42 -11
- package/src/machine/common.js +13 -1
- package/src/request/request.js +13 -0
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.1.399-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.399-dev-1...v1.1.399-dev-2) (2025-11-24)
|
|
6
|
+
|
|
5
7
|
### [1.1.399-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.399...v1.1.399-dev-1) (2025-11-21)
|
|
6
8
|
|
|
7
9
|
### [1.1.399](https://github.com/jetthai/cuora-module/compare/v1.2.0...v1.1.399) (2025-11-19)
|
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,7 @@ 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'
|
|
11
|
+
import otp from './otp.js'
|
|
10
12
|
|
|
11
|
-
export default { activity, auth, common, game, mailbox, payment, user, form, ranking }
|
|
13
|
+
export default { activity, auth, common, game, mailbox, payment, user, form, ranking, account, otp }
|
package/src/api/otp.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
verification: (data) => ({ url: 'otp-verification-point/verify', method: 'POST', params: data }),
|
|
3
|
+
acknowledge: (data) => ({ url: 'otp-verification-point/acknowledge', method: 'POST', params: data }),
|
|
4
|
+
reset: (data) => ({ url: 'otp-verification-point/reset-otp', method: 'POST', params: data }),
|
|
5
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assign, createMachine } from 'xstate'
|
|
2
2
|
import user from '../api/user.js'
|
|
3
|
-
import
|
|
3
|
+
import otp from '../api/otp.js'
|
|
4
4
|
|
|
5
5
|
export default function (request) {
|
|
6
6
|
return createMachine(
|
|
@@ -178,12 +178,16 @@ export default function (request) {
|
|
|
178
178
|
}
|
|
179
179
|
}),
|
|
180
180
|
setVerificationData: assign((context, event) => {
|
|
181
|
-
const {
|
|
181
|
+
const { request_id, ttl, email, countryCode, phone } = event.data
|
|
182
182
|
return {
|
|
183
|
-
requestId,
|
|
184
|
-
ttl: ttl
|
|
185
|
-
target
|
|
186
|
-
|
|
183
|
+
requestId: request_id,
|
|
184
|
+
ttl: ttl, // 後端傳過來的是毫秒
|
|
185
|
+
target: {
|
|
186
|
+
provider: context.strategy,
|
|
187
|
+
email: email,
|
|
188
|
+
countryCode: countryCode,
|
|
189
|
+
phone: phone,
|
|
190
|
+
},
|
|
187
191
|
}
|
|
188
192
|
}),
|
|
189
193
|
decreaseTtl: assign((context, evnet) => {
|
|
@@ -239,24 +243,51 @@ export default function (request) {
|
|
|
239
243
|
return await request.send(user.getUserInfo())
|
|
240
244
|
},
|
|
241
245
|
verify: async (context, event) => {
|
|
242
|
-
return await request.send(
|
|
246
|
+
return await request.send(
|
|
247
|
+
otp.verification({
|
|
248
|
+
strategy: context.strategy,
|
|
249
|
+
email: event.data.email,
|
|
250
|
+
countryCode: event.data.country_code,
|
|
251
|
+
phone: event.data.tel,
|
|
252
|
+
})
|
|
253
|
+
)
|
|
243
254
|
},
|
|
244
255
|
sendPhone: async (context, event) => {
|
|
245
256
|
const { countryCode, phone } = context
|
|
246
|
-
return await request.send(
|
|
257
|
+
return await request.send(
|
|
258
|
+
otp.verification({
|
|
259
|
+
strategy: 'phone',
|
|
260
|
+
countryCode,
|
|
261
|
+
phone,
|
|
262
|
+
})
|
|
263
|
+
)
|
|
247
264
|
},
|
|
248
265
|
sendEmail: async (context, event) => {
|
|
249
266
|
const { email } = context
|
|
250
|
-
return await request.send(
|
|
267
|
+
return await request.send(
|
|
268
|
+
otp.verification({
|
|
269
|
+
strategy: 'email',
|
|
270
|
+
email,
|
|
271
|
+
})
|
|
272
|
+
)
|
|
251
273
|
},
|
|
252
274
|
resetOtp: async (context, event) => {
|
|
253
275
|
const { requestId, target } = context
|
|
254
|
-
return await request.send(
|
|
276
|
+
return await request.send(
|
|
277
|
+
otp.reset({
|
|
278
|
+
request_id: requestId,
|
|
279
|
+
})
|
|
280
|
+
)
|
|
255
281
|
},
|
|
256
282
|
acknowledge: async (context, event) => {
|
|
257
283
|
const { requestId, target } = context
|
|
258
284
|
const code = event.data
|
|
259
|
-
return await request.send(
|
|
285
|
+
return await request.send(
|
|
286
|
+
otp.acknowledge({
|
|
287
|
+
request_id: requestId,
|
|
288
|
+
code,
|
|
289
|
+
})
|
|
290
|
+
)
|
|
260
291
|
},
|
|
261
292
|
},
|
|
262
293
|
}
|
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') || ''
|
package/src/request/request.js
CHANGED
|
@@ -140,6 +140,19 @@ 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',
|
|
152
|
+
// 11/10
|
|
153
|
+
'otp-verification-point/verify',
|
|
154
|
+
'otp-verification-point/acknowledge',
|
|
155
|
+
'otp-verification-point/reset-otp',
|
|
143
156
|
]
|
|
144
157
|
|
|
145
158
|
function isValid(value) {
|