@jetthai/cuora 1.1.128-dev-2 → 1.1.128

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +0 -424
  2. package/package.json +1 -1
  3. package/src/api/activity.js +0 -28
  4. package/src/api/auth.js +0 -6
  5. package/src/api/common.js +1 -2
  6. package/src/api/game.js +4 -5
  7. package/src/api/mailbox.js +5 -9
  8. package/src/api/payment.js +8 -103
  9. package/src/api/user.js +0 -2
  10. package/src/machine/activity/activity.js +16 -56
  11. package/src/machine/activity/activity_cash.js +14 -78
  12. package/src/machine/activity/diamond_shop_activity_cash.js +92 -57
  13. package/src/machine/activity/diamond_shop_activity_vn.js +89 -54
  14. package/src/machine/activity/fafafa_activity.js +1 -8
  15. package/src/machine/activity/friend_invite_friends_activity.js +1 -3
  16. package/src/machine/activity/index.js +0 -6
  17. package/src/machine/activity/roulette_activity_v2.js +2 -11
  18. package/src/machine/activity/sign_in_activity.js +13 -20
  19. package/src/machine/auth.js +5 -54
  20. package/src/machine/bank_binding.js +12 -112
  21. package/src/machine/bank_binding_amb.js +1 -6
  22. package/src/machine/common.js +24 -92
  23. package/src/machine/deposit/amb.js +3 -5
  24. package/src/machine/deposit/crypto.js +10 -14
  25. package/src/machine/deposit/crypto_button.js +5 -9
  26. package/src/machine/deposit/crypto_cash.js +5 -2
  27. package/src/machine/deposit/direct.js +15 -2
  28. package/src/machine/deposit/direct_cash.js +26 -6
  29. package/src/machine/deposit/float.js +3 -5
  30. package/src/machine/deposit/index.js +0 -14
  31. package/src/machine/deposit/loadcard_cash.js +27 -6
  32. package/src/machine/deposit/loadcard_vn.js +13 -2
  33. package/src/machine/deposit/manual_cash.js +38 -89
  34. package/src/machine/deposit/manual_vn.js +53 -99
  35. package/src/machine/deposit/qrcode_cash.js +23 -12
  36. package/src/machine/deposit/qrcode_v2.js +14 -3
  37. package/src/machine/deposit/usdt_cash.js +2 -0
  38. package/src/machine/deposit/vpay.js +3 -5
  39. package/src/machine/game_search_cash.js +12 -137
  40. package/src/machine/game_search_v2.js +4 -4
  41. package/src/machine/game_v2_1.js +7 -131
  42. package/src/machine/inbox.js +34 -259
  43. package/src/machine/index.js +0 -6
  44. package/src/machine/leaderboard.js +8 -31
  45. package/src/machine/reward_cash.js +1 -1
  46. package/src/machine/side_v2.js +1 -1
  47. package/src/machine/user_sign_up.js +7 -71
  48. package/src/machine/withdraw/index.js +0 -6
  49. package/src/machine/withdraw/withdraw_crypto.js +66 -1
  50. package/src/machine/withdraw/withdraw_manual_cash.js +14 -44
  51. package/src/machine/withdraw/withdraw_vn.js +7 -42
  52. package/src/machine/withdraw/withdraw_vn2.js +37 -64
  53. package/src/util/constant.js +0 -18
  54. package/src/util/deviceToken.js +2 -2
  55. package/src/machine/activity/cash_rain_activity.js +0 -153
  56. package/src/machine/activity/instant_rebate_activity.js +0 -214
  57. package/src/machine/activity/vip_card_activity.js +0 -140
  58. package/src/machine/deposit/crypto_bank.js +0 -317
  59. package/src/machine/deposit/crypto_bank_cash.js +0 -280
  60. package/src/machine/deposit/crypto_qrcode.js +0 -147
  61. package/src/machine/deposit/crypto_qrcode_cash.js +0 -131
  62. package/src/machine/deposit/crypto_way.js +0 -220
  63. package/src/machine/deposit/crypto_way_cash.js +0 -242
  64. package/src/machine/deposit/krway.js +0 -151
  65. package/src/machine/game_info.js +0 -57
  66. package/src/machine/honor_board_cash.js +0 -63
  67. package/src/machine/user_photo.js +0 -65
  68. package/src/machine/withdraw/withdraw_crypto2.js +0 -540
  69. package/src/machine/withdraw/withdraw_krway.js +0 -207
  70. package/src/machine/withdraw/withdraw_manual.js +0 -595
@@ -1,4 +1,5 @@
1
1
  export default {
2
+ // getPaymentHistory: () => ({ url: 'payment/history', method: 'post' }),
2
3
  getPaymentHistory: (returnDays) => ({ url: 'payment/v2/history', method: 'post', params: { returnDays } }),
3
4
  getSpotMarket: () => ({ url: 'payment/spotmarket', method: 'get' }),
4
5
  getTransactionHistory: (payload) => ({
@@ -7,34 +8,14 @@ export default {
7
8
  params: { ...payload },
8
9
  }),
9
10
  getTransactionHistoryOptions: () => ({ url: 'payment/v2/category/options', method: 'get' }),
11
+ // getPaymentInfo: () => ({ url: `payment/paymentInfo`, method: 'get' }),
10
12
  getPaymentInfo: () => ({ url: `payment/v2/paymentInfo`, method: 'get' }),
11
- getBindingPaymentInfo: () => ({ url: `payment/getBindingPaymentInfo`, method: 'get' }),
12
- updatePaymentInfo: ({
13
- bankCode,
14
- branch,
15
- branchCode,
16
- holderName,
17
- bankAccount,
18
- firstNameTh,
19
- lastNameTh,
20
- firstNameEn,
21
- lastNameEn,
22
- bonus,
23
- paymentProvider,
24
- pixType,
25
- bindingType,
26
- cryptoCurrency,
27
- cryptoNetwork,
28
- cryptoAddress,
29
- walletCode,
30
- ifscCode,
31
- }) => ({
13
+ updatePaymentInfo: ({ bankCode, branch, holderName, bankAccount, firstNameTh, lastNameTh, firstNameEn, lastNameEn, bonus, paymentProvider }) => ({
32
14
  url: 'payment/v2/updatePaymentInfo',
33
15
  method: 'post',
34
16
  params: {
35
17
  bankCode,
36
18
  branch,
37
- branchCode,
38
19
  holderName,
39
20
  bankAccount,
40
21
  firstNameTh,
@@ -43,19 +24,9 @@ export default {
43
24
  lastNameEn,
44
25
  bonus,
45
26
  paymentProvider,
46
- pixType,
47
- bindingType,
48
- cryptoCurrency,
49
- cryptoNetwork,
50
- cryptoAddress,
51
- walletCode,
52
- ifscCode,
53
27
  },
54
28
  }),
55
29
  getBankList: (paymentMethod) => ({ url: `payment/v2/${paymentMethod}/getBankList`, method: 'get' }),
56
- getBindingBankList: ({ appSecret }) => ({ url: 'payment/v2/getBindingBankList', method: 'get', params: { appSecret }, isPublic: true }),
57
- getBindingPaymentList: ({ appSecret }) => ({ url: 'payment/getBindingPaymentList', method: 'get', params: { appSecret }, isPublic: true }),
58
- getWithdrawBankList: () => ({ url: 'payment/v2/getWithdrawBankList', method: 'get' }),
59
30
  makeTransaction: ({ type, payload, paymentMethod }) => ({
60
31
  url: `payment/v2/${paymentMethod}/transaction`,
61
32
  method: 'post',
@@ -88,39 +59,15 @@ export default {
88
59
  method: 'post',
89
60
  params: { transferType: 'DEPOSIT', amount, cryptoCurrency, promotionsNo },
90
61
  }),
91
- getCryptoDepositExpectedResult: ({ method, amount, cryptoCurrency, promotionsNo }) => ({
92
- url: `payment/v2/${method}/crypto/expected/result`,
93
- method: 'post',
94
- params: { transferType: 'DEPOSIT', amount, cryptoCurrency, promotionsNo },
95
- }),
96
- getCryptoWithdrawExpectedResult: ({ method, amount, cryptoCurrency, promotionsNo }) => ({
97
- url: `payment/v2/${method}/crypto/expected/result`,
98
- method: 'post',
99
- params: { transferType: 'WITHDRAW', amount, cryptoCurrency, promotionsNo },
100
- }),
101
62
  getWithdrawExpectedResult: ({ method, amount, cryptoNetwork }) => ({
102
63
  url: `payment/v2/${method}/expected/result`,
103
64
  method: 'post',
104
65
  params: { transferType: 'WITHDRAW', amount, cryptoNetwork },
105
66
  }),
106
- submitDepositTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo, receipt }) => ({
107
- url: `payment/v2/${method}/transaction`,
108
- method: 'post',
109
- params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo, receipt },
110
- }),
111
- submitDepositTransactionCryptoBank: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo, depositTime, receipt }) => ({
67
+ submitDepositTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo }) => ({
112
68
  url: `payment/v2/${method}/transaction`,
113
69
  method: 'post',
114
- params: {
115
- transferType: 'DEPOSIT',
116
- amount,
117
- cryptoCurrency,
118
- cryptoNetwork,
119
- sourceAddress,
120
- promotionsNo,
121
- depositTime,
122
- receipt,
123
- },
70
+ params: { transferType: 'DEPOSIT', amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo },
124
71
  }),
125
72
  submitDepositTransactionLoadcard: ({ method, amount, card_type, card_code, card_seri, promotionsNo }) => ({
126
73
  url: `payment/v2/${method}/transaction`,
@@ -132,15 +79,9 @@ export default {
132
79
  amount,
133
80
  applyerBankCode,
134
81
  applyerAccountNumber,
135
- applyerIfscCode,
136
82
  applyerHolderName,
137
- applyerBranch,
138
- applyerBranchCode,
139
83
  targetBankCode,
140
84
  targetAccountNumber,
141
- targetIfscCode,
142
- targetUpi,
143
- transactionId,
144
85
  depositTime,
145
86
  receipt,
146
87
  promotionsNo,
@@ -152,15 +93,9 @@ export default {
152
93
  amount,
153
94
  applyerBankCode,
154
95
  applyerAccountNumber,
155
- applyerIfscCode,
156
96
  applyerHolderName,
157
- applyerBranch,
158
- applyerBranchCode,
159
97
  targetBankCode,
160
98
  targetAccountNumber,
161
- targetIfscCode,
162
- targetUpi,
163
- transactionId,
164
99
  depositTime,
165
100
  receipt,
166
101
  promotionsNo,
@@ -171,36 +106,12 @@ export default {
171
106
  method: 'post',
172
107
  params: { transferType: 'DEPOSIT', amount, promotionsNo },
173
108
  }),
174
- submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress, applyerHolderName }) => ({
109
+ submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress }) => ({
175
110
  url: `payment/v2/${method}/transaction`,
176
111
  method: 'post',
177
- params: { transferType: 'WITHDRAW', amount, cryptoCurrency, cryptoNetwork, targetAddress, applyerHolderName },
112
+ params: { transferType: 'WITHDRAW', amount, cryptoCurrency, cryptoNetwork, targetAddress },
178
113
  }),
179
- submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber, applyerIfscCode, branch, applyerHolderName }) => ({
180
- url: `payment/v2/${method}/transaction`,
181
- method: 'post',
182
- params: {
183
- transferType: 'WITHDRAW',
184
- amount,
185
- applyerBankCode,
186
- applyerAccountNumber,
187
- applyerIfscCode,
188
- branch,
189
- applyerHolderName,
190
- },
191
- }),
192
- submitWithdrawTransactionManual: ({
193
- method,
194
- amount,
195
- applyerBankCode,
196
- applyerAccountNumber,
197
- applyerIfscCode,
198
- branch,
199
- holderName,
200
- cryptoCurrency,
201
- cryptoNetwork,
202
- targetAddress,
203
- }) => ({
114
+ submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber, branch, holderName }) => ({
204
115
  url: `payment/v2/${method}/transaction`,
205
116
  method: 'post',
206
117
  params: {
@@ -208,12 +119,8 @@ export default {
208
119
  amount,
209
120
  applyerBankCode,
210
121
  applyerAccountNumber,
211
- applyerIfscCode,
212
122
  branch,
213
123
  holderName,
214
- cryptoCurrency,
215
- cryptoNetwork,
216
- targetAddress,
217
124
  },
218
125
  }),
219
126
  submitWithdrawTransactionAmb: ({ method, amount }) => ({
@@ -240,6 +147,4 @@ export default {
240
147
  params: { promotionsNo },
241
148
  }),
242
149
  getPendingOrder: ({ transferType }) => ({ url: 'payment/v2/pendingOrder', method: 'post', params: { transferType } }),
243
- withdrawCheck: () => ({ url: `payment/v2/withdrawCheck`, method: 'post' }),
244
- updateUtr: ({ applyId, utr }) => ({ url: 'payment/v2/updateUtr', method: 'post', params: { applyId, utr } }),
245
150
  }
package/src/api/user.js CHANGED
@@ -57,6 +57,4 @@ export default {
57
57
  isPublic: true,
58
58
  }),
59
59
  otpReset: ({ requestId, target }) => ({ url: '/otpsso/reset', method: 'post', params: { requestId, target }, isPublic: true }),
60
- getUserPhotoList: () => ({ url: 'getAllAvatar', method: 'get' }),
61
- updateUserPhoto: (data) => ({ url: 'updateUserAvatar', method: 'post', params: data }),
62
60
  }
@@ -1,41 +1,30 @@
1
1
  import { createMachine, assign } from 'xstate'
2
- import activity from '../../api/activity.js'
3
- import payment from '../../api/payment.js'
2
+ import api from '../../api/activity.js'
3
+ import activity from './index.js'
4
4
 
5
5
  export default function (request) {
6
6
  const { appSecret } = request.config
7
7
  return createMachine(
8
8
  {
9
9
  id: 'activity',
10
- initial: 'init',
10
+ initial: 'fetchingActivityList',
11
11
  context: {
12
12
  tick: 2000,
13
- specifyActivities: [4, 29, 34],
13
+ specifyActivities: [29],
14
14
  activitiesDetailList: [],
15
15
  activityList: [],
16
- promotionList: [],
17
- jackpotList: [],
18
16
  activityMap: {},
19
17
  tournamentList: [],
20
18
  refs: {},
21
19
  uidSite: '',
22
- siteConfig: {},
23
20
  },
24
21
  states: {
25
- init: {
26
- on: {
27
- SET_CONFIG: {
28
- target: 'fetchingList',
29
- actions: 'setSiteConifg',
30
- },
31
- },
32
- },
33
- fetchingList: {
22
+ fetchingActivityList: {
34
23
  invoke: {
35
- src: 'fetchList',
24
+ src: 'fetchActivityList',
36
25
  onDone: {
37
26
  target: 'idle',
38
- actions: ['setActivityList', 'setTournamentList', 'setPromotionList', 'setJackpotList'],
27
+ actions: ['setActivityList', 'setTournamentList'],
39
28
  },
40
29
  onError: {
41
30
  target: 'idle',
@@ -69,7 +58,7 @@ export default function (request) {
69
58
  pending: {
70
59
  after: {
71
60
  TIMEOUT: {
72
- target: '#activity.fetchingList',
61
+ target: '#activity.fetchingActivityList',
73
62
  },
74
63
  },
75
64
  on: {
@@ -77,7 +66,7 @@ export default function (request) {
77
66
  actions: 'setUnread',
78
67
  },
79
68
  REFRESH: {
80
- target: '#activity.fetchingList',
69
+ target: '#activity.fetchingActivityList',
81
70
  },
82
71
  },
83
72
  },
@@ -87,14 +76,8 @@ export default function (request) {
87
76
  },
88
77
  {
89
78
  actions: {
90
- setSiteConifg: assign((context, event) => {
91
- return {
92
- siteConfig: event.data,
93
- }
94
- }),
95
79
  setTournamentList: assign((context, event) => {
96
- const { activityList } = event.data
97
- const tournamentList = activityList.filter((item) => item.tournament === 1)
80
+ const tournamentList = event.data.filter((item) => item.tournament === 1)
98
81
  return {
99
82
  tournamentList,
100
83
  }
@@ -102,8 +85,7 @@ export default function (request) {
102
85
  setActivityList: assign((context, event) => {
103
86
  const noRedActivity = [2, 4, 13, 20, 90, 91, 92]
104
87
  const { uidSite } = context
105
- const { activityList } = event.data
106
- let list = JSON.parse(JSON.stringify(activityList))
88
+ let list = JSON.parse(JSON.stringify(event.data))
107
89
  list.forEach((activity) => {
108
90
  const storageUnread = localStorage.getItem(`unread_${activity.activityNo}_${uidSite}`)
109
91
  if (noRedActivity.includes(activity.activityType)) {
@@ -118,18 +100,6 @@ export default function (request) {
118
100
  activityList: list,
119
101
  }
120
102
  }),
121
- setPromotionList: assign((context, event) => {
122
- const { promotionList } = event.data
123
- return {
124
- promotionList,
125
- }
126
- }),
127
- setJackpotList: assign((context, event) => {
128
- const { jackpotList } = event.data
129
- return {
130
- jackpotList,
131
- }
132
- }),
133
103
  setActivitiesDetailList: assign((context, event) => {
134
104
  return {
135
105
  activitiesDetailList: event.data.map((item) => item.data),
@@ -165,25 +135,15 @@ export default function (request) {
165
135
  },
166
136
  },
167
137
  services: {
168
- fetchList: async (context, event) => {
169
- const hasToken = request.getToken()
170
- const isDoubleWallet = context.siteConfig?.walletMode === '4'
171
- const apiCallable = hasToken && isDoubleWallet
172
- const [{ data }, promotionList, jackpotList] = await Promise.all([
173
- request.send(activity.getActivityList({ appSecret })),
174
- apiCallable ? request.send(payment.getPromotionsList()) : [],
175
- request.send(activity.getJackpotList({ appSecret })),
176
- ])
177
-
178
- return { activityList: data, promotionList, jackpotList: jackpotList.data }
138
+ fetchActivityList: async (context, event) => {
139
+ const { data } = await request.send(api.getActivityList({ appSecret }))
140
+ return data
179
141
  },
180
142
  fetchActivitiesDetail: async (context, event) => {
181
- await new Promise((resolve) => setTimeout(resolve, 1000)) // delay 1 second
182
-
183
143
  const { activityList = [], specifyActivities = [] } = context
184
144
  const filterActivityList = activityList.filter((activity) => specifyActivities.includes(activity.activityType))
185
- const promiseArray = filterActivityList.map((item) => {
186
- return request.send(activity.getActivityDetail({ activityNo: item.activityNo, appSecret }))
145
+ const promiseArray = filterActivityList.map((activity) => {
146
+ return request.send(api.getActivityDetail({ activityNo: activity.activityNo, appSecret }))
187
147
  })
188
148
  const activitiesDetail = await Promise.all(promiseArray)
189
149
  return activitiesDetail
@@ -1,45 +1,26 @@
1
1
  import { createMachine, assign } from 'xstate'
2
- import activity from '../../api/activity.js'
3
- import payment from '../../api/payment.js'
2
+ import api from '../../api/activity.js'
4
3
 
5
4
  export default function (request) {
6
5
  const { appSecret } = request.config
7
6
  return createMachine(
8
7
  {
9
8
  id: 'activity',
10
- initial: 'fetchingList',
9
+ initial: 'fetchingActivityList',
11
10
  context: {
12
11
  tick: 2000,
13
12
  activityList: [],
13
+ activityMap: {},
14
14
  tournamentList: [],
15
- promotionList: [],
16
- jackpotList: [],
17
- uidSite: '',
18
- detailNeededActivityTypes: [29, 34],
19
- activityDetailList: [],
15
+ refs: {},
20
16
  },
21
17
  states: {
22
- fetchingList: {
18
+ fetchingActivityList: {
23
19
  invoke: {
24
- src: 'fetchList',
25
- onDone: {
26
- target: 'checking',
27
- actions: ['setActivityList', 'setTournamentList', 'setPromotionList', 'setJackpotList'],
28
- },
29
- onError: {
30
- target: 'pending',
31
- },
32
- },
33
- },
34
- checking: {
35
- always: [{ target: 'fetchingDetailList', cond: 'needFetchingDetail' }, { target: 'pending' }],
36
- },
37
- fetchingDetailList: {
38
- invoke: {
39
- src: 'fetchActivityDetailList',
20
+ src: 'fetchActivityList',
40
21
  onDone: {
41
22
  target: 'pending',
42
- actions: 'setActivityDetailList',
23
+ actions: ['setActivityList', 'setTournamentList'],
43
24
  },
44
25
  onError: {
45
26
  target: 'pending',
@@ -49,7 +30,7 @@ export default function (request) {
49
30
  pending: {
50
31
  after: {
51
32
  TIMEOUT: {
52
- target: 'fetchingList',
33
+ target: 'fetchingActivityList',
53
34
  },
54
35
  },
55
36
  on: {
@@ -57,7 +38,7 @@ export default function (request) {
57
38
  actions: 'setUnread',
58
39
  },
59
40
  REFRESH: {
60
- target: '#activity.fetchingList',
41
+ target: '#activity.fetchingActivityList',
61
42
  },
62
43
  },
63
44
  },
@@ -66,8 +47,7 @@ export default function (request) {
66
47
  {
67
48
  actions: {
68
49
  setTournamentList: assign((context, event) => {
69
- const { activityList } = event.data
70
- const tournamentList = activityList.filter((item) => item.tournament === 1)
50
+ const tournamentList = event.data.filter((item) => item.tournament === 1)
71
51
  return {
72
52
  tournamentList,
73
53
  }
@@ -75,8 +55,7 @@ export default function (request) {
75
55
  setActivityList: assign((context, event) => {
76
56
  const noReadActivity = [2, 4, 13, 20, 90, 91, 92]
77
57
  const { uidSite } = context
78
- const { activityList } = event.data
79
- let list = JSON.parse(JSON.stringify(activityList))
58
+ let list = JSON.parse(JSON.stringify(event.data))
80
59
  list.forEach((activity) => {
81
60
  const storageUnread = localStorage.getItem(`unread_${activity.activityNo}_${uidSite}`)
82
61
  if (noReadActivity.includes(activity.activityType)) {
@@ -91,18 +70,6 @@ export default function (request) {
91
70
  activityList: list,
92
71
  }
93
72
  }),
94
- setPromotionList: assign((context, event) => {
95
- const { promotionList } = event.data
96
- return {
97
- promotionList,
98
- }
99
- }),
100
- setJackpotList: assign((context, event) => {
101
- const { jackpotList } = event.data
102
- return {
103
- jackpotList,
104
- }
105
- }),
106
73
  setUnread: assign((context, event) => {
107
74
  const { uidSite, activityNo, unread } = event.data
108
75
  const list = JSON.parse(JSON.stringify(context.activityList))
@@ -118,17 +85,6 @@ export default function (request) {
118
85
  uidSite,
119
86
  }
120
87
  }),
121
- setActivityDetailList: assign((context, event) => {
122
- return {
123
- activityDetailList: event.data.map((item) => item.data),
124
- }
125
- }),
126
- },
127
- guards: {
128
- needFetchingDetail: (context, event) => {
129
- const { activityList = [], detailNeededActivityTypes } = context
130
- return activityList.filter((activity) => detailNeededActivityTypes.includes(activity.activityType)).length > 0
131
- },
132
88
  },
133
89
  delays: {
134
90
  TIMEOUT: (context, event) => {
@@ -137,29 +93,9 @@ export default function (request) {
137
93
  },
138
94
  },
139
95
  services: {
140
- fetchList: async (context, event) => {
141
- const hasToken = request.getToken()
142
- const [{ data }, promotionList, jackpotList] = await Promise.all([
143
- request.send(activity.getActivityList({ appSecret })),
144
- hasToken ? request.send(payment.getPromotionsList()) : [],
145
- request.send(activity.getJackpotList({ appSecret })),
146
- ])
147
-
148
- return { activityList: data, promotionList, jackpotList: jackpotList.data }
149
- },
150
- fetchActivityDetailList: async (context, event) => {
151
- await new Promise((resolve) => setTimeout(resolve, 1000)) // delay 1 second
152
- const hasToken = request.getToken()
153
-
154
- const { activityList = [], detailNeededActivityTypes } = context
155
- const filteredActivityList = activityList.filter((activity) => detailNeededActivityTypes.includes(activity.activityType))
156
- return hasToken
157
- ? await Promise.all(
158
- filteredActivityList.map((item) => {
159
- return request.send(activity.getActivityDetail({ activityNo: item.activityNo, appSecret }))
160
- })
161
- )
162
- : []
96
+ fetchActivityList: async (context, event) => {
97
+ const { data } = await request.send(api.getActivityList({ appSecret }))
98
+ return data
163
99
  },
164
100
  },
165
101
  }