@jetthai/cuora 1.0.153 → 1.0.155
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,22 @@
|
|
|
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.0.155](https://github.com/jetthai/cuora-module/compare/v1.0.152-1...v1.0.155) (2022-08-02)
|
|
6
|
+
|
|
7
|
+
### [1.0.154](https://github.com/jetthai/cuora-module/compare/v1.0.153-1...v1.0.154) (2022-07-28)
|
|
8
|
+
|
|
9
|
+
### [1.0.153-1](https://github.com/jetthai/cuora-module/compare/v1.0.153...v1.0.153-1) (2022-07-28)
|
|
10
|
+
|
|
11
|
+
### [1.0.153](https://github.com/jetthai/cuora-module/compare/v1.0.149-2...v1.0.153) (2022-07-28)
|
|
12
|
+
|
|
13
|
+
### [1.0.149-2](https://github.com/jetthai/cuora-module/compare/v1.0.152...v1.0.149-2) (2022-07-28)
|
|
14
|
+
|
|
15
|
+
### [1.0.149-1](https://github.com/jetthai/cuora-module/compare/v1.0.151...v1.0.149-1) (2022-07-27)
|
|
16
|
+
|
|
17
|
+
### [1.0.154](https://github.com/jetthai/cuora-module/compare/v1.0.153-1...v1.0.154) (2022-07-28)
|
|
18
|
+
|
|
19
|
+
### [1.0.153-1](https://github.com/jetthai/cuora-module/compare/v1.0.153...v1.0.153-1) (2022-07-28)
|
|
20
|
+
|
|
5
21
|
### [1.0.153](https://github.com/jetthai/cuora-module/compare/v1.0.149-2...v1.0.153) (2022-07-28)
|
|
6
22
|
|
|
7
23
|
### [1.0.152](https://github.com/jetthai/cuora-module/compare/v1.0.149-1...v1.0.152) (2022-07-27)
|
|
@@ -10,6 +26,8 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
10
26
|
|
|
11
27
|
### [1.0.150](https://github.com/jetthai/cuora-module/compare/v1.0.149...v1.0.150) (2022-07-27)
|
|
12
28
|
|
|
29
|
+
### [1.0.152-1](https://github.com/jetthai/cuora-module/compare/v1.0.152...v1.0.152-1) (2022-08-02)
|
|
30
|
+
|
|
13
31
|
### [1.0.152](https://github.com/jetthai/cuora-module/compare/v1.0.151...v1.0.152) (2022-07-27)
|
|
14
32
|
|
|
15
33
|
### [1.0.151](https://github.com/jetthai/cuora-module/compare/v1.0.150...v1.0.151) (2022-07-27)
|
package/package.json
CHANGED
package/src/api/auth.js
CHANGED
|
@@ -11,10 +11,10 @@ export default {
|
|
|
11
11
|
isPublic: true,
|
|
12
12
|
headers: { 'x-access-captcha': reCaptchaToken },
|
|
13
13
|
}),
|
|
14
|
-
register: ({ channel = 'official', subchannel = 'pwa', reCaptchaToken, ...rest }) => ({
|
|
14
|
+
register: ({ channel = 'official', subchannel = 'pwa', reCaptchaToken, dt, ...rest }) => ({
|
|
15
15
|
url: `register?channel=${channel}&subchannel=${subchannel}`,
|
|
16
16
|
method: 'post',
|
|
17
|
-
params: rest,
|
|
17
|
+
params: { dt, ...rest },
|
|
18
18
|
isPublic: true,
|
|
19
19
|
headers: { 'x-access-captcha': reCaptchaToken },
|
|
20
20
|
}),
|
package/src/machine/auth.js
CHANGED
|
@@ -4,9 +4,10 @@ import qs from 'qs'
|
|
|
4
4
|
import { assign, createMachine } from 'xstate'
|
|
5
5
|
import auth from '../api/auth'
|
|
6
6
|
import user from '../api/user'
|
|
7
|
+
import { getDeviceToken } from '../util/deviceToken'
|
|
7
8
|
|
|
8
9
|
export default function (request) {
|
|
9
|
-
const { clientId, sentry, defaultChannel, defaultSubchannel } = request.config
|
|
10
|
+
const { clientId, fpToken, sentry, defaultChannel, defaultSubchannel } = request.config
|
|
10
11
|
const tokenKey = `cuora_${clientId}`
|
|
11
12
|
const userKey = `cuora_tempuser`
|
|
12
13
|
const accountPhoneKey = 'account_phone'
|
|
@@ -288,17 +289,28 @@ export default function (request) {
|
|
|
288
289
|
}),
|
|
289
290
|
redirectTo3Party: async (context, event) => {
|
|
290
291
|
const { provider, channel, subchannel } = event.data
|
|
292
|
+
|
|
293
|
+
const dt = await getDeviceToken({ fpToken, sentry, apiURL: request.config.apiURL })
|
|
294
|
+
sentry.setTag('dt', dt)
|
|
295
|
+
const messages = [
|
|
296
|
+
{ channel: cookies.get('channel'), subchannel: cookies.get('subchannel') },
|
|
297
|
+
{ channel: defaultChannel, subchannel: defaultSubchannel },
|
|
298
|
+
{ channel: channel, subchannel: subchannel },
|
|
299
|
+
{ url: window.location.href },
|
|
300
|
+
]
|
|
301
|
+
sentry.captureMessage(JSON.stringify(messages))
|
|
302
|
+
|
|
291
303
|
const redirectURL = urljoin(
|
|
292
304
|
request.config.fullURL,
|
|
293
305
|
'login?' +
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
306
|
+
qs.stringify({
|
|
307
|
+
provider,
|
|
308
|
+
redirectURI: `${window.location.protocol}//${window.location.host}`,
|
|
309
|
+
channel: cookies.get('channel') || channel || defaultChannel || 'official',
|
|
310
|
+
subchannel: cookies.get('subchannel') || subchannel || defaultSubchannel || 'pwa',
|
|
311
|
+
// dt,
|
|
312
|
+
platform: 'pwa',
|
|
313
|
+
})
|
|
302
314
|
)
|
|
303
315
|
window.location.href = redirectURL
|
|
304
316
|
},
|
|
@@ -16,7 +16,7 @@ export default function (request) {
|
|
|
16
16
|
states: {
|
|
17
17
|
fetching: {
|
|
18
18
|
invoke: {
|
|
19
|
-
src: '
|
|
19
|
+
src: 'fetchInitData',
|
|
20
20
|
onDone: {
|
|
21
21
|
target: 'idle',
|
|
22
22
|
actions: 'setBanks',
|
|
@@ -79,8 +79,9 @@ export default function (request) {
|
|
|
79
79
|
{
|
|
80
80
|
actions: {
|
|
81
81
|
setBanks: assign((context, event) => {
|
|
82
|
-
const bankList = event.data
|
|
82
|
+
const { bankList = [], paymentInfo = {} } = event.data
|
|
83
83
|
return {
|
|
84
|
+
holderName: paymentInfo.bankInfo[0]?.holderName,
|
|
84
85
|
bankList,
|
|
85
86
|
bank: bankList[0],
|
|
86
87
|
}
|
|
@@ -93,10 +94,11 @@ export default function (request) {
|
|
|
93
94
|
},
|
|
94
95
|
},
|
|
95
96
|
services: {
|
|
96
|
-
|
|
97
|
+
fetchInitData: async (context, event) => {
|
|
97
98
|
const paymentDetail = await request.send(payment.getPaymentDetail({ transferType: 'WITHDRAW' }))
|
|
98
99
|
const method = paymentDetail.find((payment) => payment.category === 'manual').method
|
|
99
|
-
|
|
100
|
+
const [bankList, paymentInfo] = await Promise.all([request.send(payment.getBankList(method)), request.send(payment.getPaymentInfo())])
|
|
101
|
+
return { bankList, paymentInfo }
|
|
100
102
|
},
|
|
101
103
|
updatePaymentInfo: async (context, event) => {
|
|
102
104
|
const { bank, branch, accountNumber, holderName } = context
|
|
@@ -16,7 +16,7 @@ export default function (request) {
|
|
|
16
16
|
currentCategory: 'direct',
|
|
17
17
|
currentMethod: null,
|
|
18
18
|
amount: null,
|
|
19
|
-
result: null
|
|
19
|
+
result: null,
|
|
20
20
|
},
|
|
21
21
|
states: {
|
|
22
22
|
loading: {
|
|
@@ -51,7 +51,7 @@ export default function (request) {
|
|
|
51
51
|
loaded: {
|
|
52
52
|
on: {
|
|
53
53
|
SELECT_DIRECT: {
|
|
54
|
-
actions: ['setDirect', 'reset']
|
|
54
|
+
actions: ['setDirect', 'reset'],
|
|
55
55
|
},
|
|
56
56
|
SELECT_BANK: {
|
|
57
57
|
actions: 'setSelectedBank',
|
|
@@ -142,7 +142,7 @@ export default function (request) {
|
|
|
142
142
|
}),
|
|
143
143
|
setAmount: assign((context, event) => {
|
|
144
144
|
return {
|
|
145
|
-
amount: event.data
|
|
145
|
+
amount: event.data,
|
|
146
146
|
}
|
|
147
147
|
}),
|
|
148
148
|
setCalculation: assign((context, event) => {
|
|
@@ -200,7 +200,7 @@ export default function (request) {
|
|
|
200
200
|
payment.submitDepositTransactionBank({
|
|
201
201
|
method: currentMethod,
|
|
202
202
|
amount,
|
|
203
|
-
applyerBankCode: selectedBank.bankCode
|
|
203
|
+
applyerBankCode: selectedBank.bankCode,
|
|
204
204
|
})
|
|
205
205
|
)
|
|
206
206
|
},
|
|
@@ -104,6 +104,15 @@ export default function (request) {
|
|
|
104
104
|
const { channel, subchannel, signUpData } = context
|
|
105
105
|
const dt = await getDeviceToken({ fpToken, sentry, apiURL: request.config.apiURL })
|
|
106
106
|
|
|
107
|
+
sentry.setTag('dt', dt)
|
|
108
|
+
const messages = [
|
|
109
|
+
{ channel: cookies.get('channel'), subchannel: cookies.get('subchannel') },
|
|
110
|
+
{ channel: defaultChannel, subchannel: defaultSubchannel },
|
|
111
|
+
{ channel: channel, subchannel: subchannel },
|
|
112
|
+
{ url: window.location.href },
|
|
113
|
+
]
|
|
114
|
+
sentry.captureMessage(JSON.stringify(messages))
|
|
115
|
+
|
|
107
116
|
return await request.send(
|
|
108
117
|
auth.register({
|
|
109
118
|
...signUpData,
|
package/src/machine/vip_table.js
CHANGED
|
@@ -19,11 +19,11 @@ export default function (request) {
|
|
|
19
19
|
onError: {
|
|
20
20
|
target: 'fail',
|
|
21
21
|
},
|
|
22
|
-
}
|
|
22
|
+
},
|
|
23
23
|
},
|
|
24
24
|
completed: {},
|
|
25
|
-
fail: {}
|
|
26
|
-
}
|
|
25
|
+
fail: {},
|
|
26
|
+
},
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
actions: {
|
|
@@ -37,14 +37,14 @@ export default function (request) {
|
|
|
37
37
|
fetchVipTable: async (context, event) => {
|
|
38
38
|
const { viptable = {} } = await request.send(activity.getVipTable())
|
|
39
39
|
const { data = [] } = viptable
|
|
40
|
-
data.map(item => {
|
|
40
|
+
data.map((item) => {
|
|
41
41
|
item.title = item.title.toLowerCase()
|
|
42
42
|
return item
|
|
43
43
|
})
|
|
44
44
|
|
|
45
45
|
return data
|
|
46
46
|
},
|
|
47
|
-
}
|
|
47
|
+
},
|
|
48
48
|
}
|
|
49
49
|
)
|
|
50
|
-
}
|
|
50
|
+
}
|