@jetthai/cuora 1.1.320-dev-9 → 1.1.320

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,48 +2,6 @@
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.320-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.320-dev-8...v1.1.320-dev-9) (2024-12-09)
6
-
7
- ### [1.1.320-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.320-dev-7...v1.1.320-dev-8) (2024-12-06)
8
-
9
- ### [1.1.320-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.320-dev-6...v1.1.320-dev-7) (2024-12-05)
10
-
11
- ### [1.1.320-dev-6](https://github.com/jetthai/cuora-module/compare/v1.1.325-dev-2...v1.1.320-dev-6) (2024-12-04)
12
-
13
- ### [1.1.325-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.325-dev-1...v1.1.325-dev-2) (2024-12-04)
14
-
15
- ### [1.1.325-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.325...v1.1.325-dev-1) (2024-12-04)
16
-
17
- ### [1.1.325](https://github.com/jetthai/cuora-module/compare/v1.1.324...v1.1.325) (2024-12-04)
18
-
19
- ### [1.1.320-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.320-dev-4...v1.1.320-dev-5) (2024-12-02)
20
-
21
- ### [1.1.320-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.320-dev-3...v1.1.320-dev-4) (2024-12-02)
22
-
23
- ### [1.1.320-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.320-dev-2...v1.1.320-dev-3) (2024-12-02)
24
-
25
- ### [1.1.320-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.320-dev-1...v1.1.320-dev-2) (2024-11-29)
26
-
27
- ### [1.1.320-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.320...v1.1.320-dev-1) (2024-11-29)
28
-
29
- ### [1.1.320-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.320-dev-4...v1.1.320-dev-5) (2024-12-02)
30
-
31
- ### [1.1.320-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.320-dev-3...v1.1.320-dev-4) (2024-12-02)
32
-
33
- ### [1.1.320-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.320-dev-2...v1.1.320-dev-3) (2024-12-02)
34
-
35
- ### [1.1.320-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.320-dev-1...v1.1.320-dev-2) (2024-11-29)
36
-
37
- ### [1.1.320-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.320...v1.1.320-dev-1) (2024-11-29)
38
-
39
- ### [1.1.324](https://github.com/jetthai/cuora-module/compare/v1.1.323...v1.1.324) (2024-12-04)
40
-
41
- ### [1.1.323](https://github.com/jetthai/cuora-module/compare/v1.1.322...v1.1.323) (2024-12-04)
42
-
43
- ### [1.1.322](https://github.com/jetthai/cuora-module/compare/v1.1.321...v1.1.322) (2024-12-03)
44
-
45
- ### [1.1.321](https://github.com/jetthai/cuora-module/compare/v1.1.320...v1.1.321) (2024-12-02)
46
-
47
5
  ### [1.1.320](https://github.com/jetthai/cuora-module/compare/v1.1.319...v1.1.320) (2024-11-26)
48
6
 
49
7
  ### [1.1.319](https://github.com/jetthai/cuora-module/compare/v1.1.318...v1.1.319) (2024-11-26)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.320-dev-9",
3
+ "version": "1.1.320",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -6,12 +6,6 @@ export default {
6
6
  params: { appSecret, include },
7
7
  isPublic: true,
8
8
  }),
9
- getAllActivityList: ({ appSecret, include = 'cl' }) => ({
10
- url: 'all-activities/list',
11
- method: 'get',
12
- params: { appSecret },
13
- isPublic: true,
14
- }),
15
9
  getJackpotList: ({ appSecret }) => ({
16
10
  url: 'activities/jackpot/list',
17
11
  method: 'get',
@@ -102,9 +96,4 @@ export default {
102
96
  getInstantRebateCollectTime: () => ({ url: 'activities/rebate/collectTime', method: 'get' }),
103
97
  instantRebateEstimate: () => ({ url: 'activities/rebate/estimate', method: 'get' }),
104
98
  instantRebateCollect: () => ({ url: 'activities/rebate/collect', method: 'get' }),
105
- instantRebateHistory: ({ startDate, endDate, appSecret }) => ({
106
- url: 'activities/rebate/history',
107
- method: 'post',
108
- params: { startDate, endDate, appSecret },
109
- }),
110
99
  }
package/src/api/common.js CHANGED
@@ -5,5 +5,4 @@ export default {
5
5
  broadcast: () => ({ url: 'broadcast', method: 'get', isPublic: true }),
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
- getDefaultAffiliateCode: ({ appSecret }) => ({ url: 'getAffiliateCode', params: { appSecret }, method: 'get', isPublic: true }),
9
8
  }
package/src/api/game.js CHANGED
@@ -92,10 +92,4 @@ export default {
92
92
  addListFavorite: (code) => ({ method: 'post', url: 'game/list/v3/addMyFavorite', params: { games: [code] } }),
93
93
  removeListFavorite: (code) => ({ method: 'post', url: 'game/list/v3/removeMyFavorite', params: { games: [code] } }),
94
94
  getGameInfo: ({ appSecret, gameCode }) => ({ method: 'get', url: 'game/info', params: { appSecret, gameCode } }),
95
- getGameReplayInfo: ({ providerId, seqNo, lang }) => ({
96
- method: 'get',
97
- url: 'game/gameReplay',
98
- params: { providerId, seqNo, lang },
99
- isPublic: true,
100
- }),
101
95
  }
package/src/api/user.js CHANGED
@@ -18,7 +18,6 @@ export default {
18
18
  getFriendsHome: () => ({ url: 'friends/home', method: 'get' }),
19
19
  getFriendsDashboard: () => ({ url: 'friends/dashboard', method: 'get' }),
20
20
  getFriendsDashboardList: ({ level, page, row }) => ({ url: 'friends/dashboard/list', method: 'post', params: { level, page, row } }),
21
- getFriendsList: ({ type, page, row }) => ({ url: 'friends/reward-list', method: 'post', params: { type, page, row } }),
22
21
  postFriends: ({ friendCode }) => ({ url: 'friends', method: 'post', params: { friendCode } }),
23
22
  passwordRecovery: (recoveryData) => ({ url: 'recovery', method: 'post', params: recoveryData, isPublic: true }),
24
23
  passwordAbandon: ({ number }) => ({ url: 'recovery/abandon', method: 'post', params: { number }, isPublic: true }),
@@ -163,7 +163,7 @@ export default function (request) {
163
163
  const isDoubleWallet = context.siteConfig?.walletMode === '4'
164
164
  const apiCallable = hasToken && isDoubleWallet
165
165
  const [{ data }, promotionList] = await Promise.all([
166
- hasToken ? request.send(activity.getActivityList({ appSecret })) : request.send(activity.getAllActivityList({ appSecret })),
166
+ request.send(activity.getActivityList({ appSecret })),
167
167
  apiCallable ? request.send(payment.getPromotionsList()) : [],
168
168
  ])
169
169
 
@@ -133,7 +133,7 @@ export default function (request) {
133
133
  fetchList: async (context, event) => {
134
134
  const hasToken = request.getToken()
135
135
  const [{ data }, promotionList] = await Promise.all([
136
- hasToken ? request.send(activity.getActivityList({ appSecret })) : request.send(activity.getAllActivityList({ appSecret })),
136
+ request.send(activity.getActivityList({ appSecret })),
137
137
  hasToken ? request.send(payment.getPromotionsList()) : [],
138
138
  ])
139
139
 
@@ -18,16 +18,11 @@ export default function (request) {
18
18
  commission: 0,
19
19
  downLine: 0,
20
20
  activeDownLine: 0,
21
- allDownLineCounts: 0,
22
- receivedCounts: 0,
23
21
  levelTable: [],
24
22
  pastTable: [],
25
23
  levelDownLine: {},
26
- friendsList: {},
27
24
  currentLevel: 1,
28
- currentType: 'ALL',
29
25
  page: 1,
30
- listPage: 1,
31
26
  },
32
27
  initial: 'fetching1',
33
28
  states: {
@@ -68,20 +63,11 @@ export default function (request) {
68
63
  target: 'fetchingList',
69
64
  actions: ['setLevelSearch', 'reset'],
70
65
  },
71
- SELECT_TYPE: {
72
- target: 'fetchingFriendsList',
73
- actions: ['setTypeSearch', 'resetList'],
74
- },
75
66
  LOAD_DATA: {
76
67
  target: 'fetchingList',
77
68
  actions: 'setPage',
78
69
  cond: 'isNotEnd',
79
70
  },
80
- LOAD_LIST_DATA: {
81
- target: 'fetchingFriendsList',
82
- actions: 'setListPage',
83
- cond: 'isListNotEnd',
84
- },
85
71
  },
86
72
  },
87
73
  binding: {
@@ -125,18 +111,6 @@ export default function (request) {
125
111
  },
126
112
  },
127
113
  },
128
- fetchingFriendsList: {
129
- invoke: {
130
- src: 'fetchFriendsList',
131
- onDone: {
132
- target: 'idle',
133
- actions: 'setFriendsList',
134
- },
135
- onError: {
136
- target: 'idle',
137
- },
138
- },
139
- },
140
114
  fail: {},
141
115
  },
142
116
  },
@@ -181,56 +155,28 @@ export default function (request) {
181
155
  currentLevel: level,
182
156
  }
183
157
  }),
184
- setTypeSearch: assign((context, event) => {
185
- const { type } = event.data
186
- return {
187
- currentType: type,
188
- }
189
- }),
190
158
  reset: assign((context, event) => {
191
159
  return {
192
160
  page: 1,
193
161
  levelDownLine: {},
194
162
  }
195
163
  }),
196
- resetList: assign((context, event) => {
197
- return {
198
- listPage: 1,
199
- friendsList: {},
200
- }
201
- }),
202
164
  setPage: assign((context, event) => {
203
165
  return {
204
166
  page: context.page + 1,
205
167
  }
206
168
  }),
207
- setListPage: assign((context, event) => {
208
- return {
209
- listPage: context.listPage + 1,
210
- }
211
- }),
212
169
  setLevelDownLineList: assign((context, event) => {
213
170
  return {
214
171
  levelDownLine: event.data,
215
172
  }
216
173
  }),
217
- setFriendsList: assign((context, event) => {
218
- return {
219
- friendsList: event.data,
220
- receivedCounts: event.data?.rewardsDetail?.receivedCounts || 0,
221
- allDownLineCounts: event.data?.rewardsDetail?.allDownLineCounts || 0,
222
- }
223
- }),
224
174
  },
225
175
  guards: {
226
176
  isNotEnd: (context, event) => {
227
177
  const { page } = context.levelDownLine
228
178
  return page.current < page.total
229
179
  },
230
- isListNotEnd: (context, event) => {
231
- const { page } = context.friendsList
232
- return page.current < page.total
233
- },
234
180
  isFriendsEnable: (context, event) => context.friendsEnable,
235
181
  },
236
182
  services: {
@@ -266,21 +212,6 @@ export default function (request) {
266
212
  return resopnseData
267
213
  }
268
214
  },
269
- fetchFriendsList: async (context, event) => {
270
- const { currentType, listPage, friendsList } = context
271
- const copiedObj = JSON.parse(JSON.stringify(friendsList))
272
- const copiedList = copiedObj.list
273
- const resopnseData = await request.send(user.getFriendsList({ type: currentType, page: listPage, row: 15 }))
274
- if (!!copiedList && !!resopnseData?.data?.list) {
275
- const combindData = {
276
- ...resopnseData.data,
277
- list: [...copiedList, ...resopnseData?.data?.list],
278
- }
279
- return combindData
280
- } else {
281
- return resopnseData?.data
282
- }
283
- },
284
215
  },
285
216
  }
286
217
  )
@@ -6,7 +6,6 @@ export default function (request) {
6
6
  {
7
7
  id: 'instant_rebate_activity',
8
8
  context: {
9
- rebateCycle: null,
10
9
  showColletButton: false,
11
10
  estimateStartTime: null,
12
11
  estimateEndTime: null,
@@ -14,9 +13,7 @@ export default function (request) {
14
13
  lastEstimateTime: null,
15
14
  collectAvailable: false,
16
15
  cumulativeValidTurnover: null,
17
- weekCumulativeValidTurnover: null,
18
16
  cumulativeRebateAmount: null,
19
- weekCumulativeRebateAmount: null,
20
17
  actualRebateAmount: null,
21
18
  rewardType: null,
22
19
  singleMinimumAmountReceive: null,
@@ -114,40 +111,32 @@ export default function (request) {
114
111
  }),
115
112
  setEstimateResult: assign((context, event) => {
116
113
  const {
117
- rebateCycle = null,
118
114
  showColletButton = false,
119
115
  estimateStartTime = 0,
120
116
  estimateEndTime = 0,
121
117
  lastCollectTime = 0,
122
118
  collectAvailable = false,
123
119
  cumulativeValidTurnover = '0',
124
- weekCumulativeValidTurnover = '0',
125
120
  cumulativeRebateAmount = '0',
126
- weekCumulativeRebateAmount = '0',
127
121
  actualRebateAmount = '0',
128
122
  rewardType = null,
129
123
  singleMinimumAmountReceive = 0,
130
- dailyMaximumAmountReceive = 0,
131
124
  remainingCount = 0,
132
125
  dailyRedemptionLimit = 0,
133
126
  reachedAmountLimit = false,
134
127
  } = event.data
135
128
 
136
129
  return {
137
- rebateCycle,
138
130
  showColletButton,
139
131
  estimateStartTime,
140
132
  estimateEndTime,
141
133
  lastCollectTime,
142
134
  collectAvailable,
143
135
  cumulativeValidTurnover,
144
- weekCumulativeValidTurnover,
145
136
  cumulativeRebateAmount,
146
- weekCumulativeRebateAmount,
147
137
  actualRebateAmount,
148
138
  rewardType,
149
139
  singleMinimumAmountReceive,
150
- dailyMaximumAmountReceive,
151
140
  remainingCount,
152
141
  dailyRedemptionLimit,
153
142
  reachedAmountLimit,
@@ -4,6 +4,9 @@ import pickBy from 'lodash/pickBy.js'
4
4
  import api from '../api/common.js'
5
5
  import storage from '../util/storage.js'
6
6
 
7
+ // const pickBy = require('lodash/pickBy')
8
+ // const UAParser = require('ua-parser-js')
9
+
7
10
  export default function (request) {
8
11
  const { appSecret, defaultChannel, defaultSubchannel } = request.config
9
12
  return createMachine(
@@ -38,7 +41,6 @@ export default function (request) {
38
41
  channel: null,
39
42
  subchannel: null,
40
43
  affiliateCode: null,
41
- defaultAffiliateCode: null,
42
44
  friendCode: null,
43
45
  },
44
46
  states: {
@@ -56,28 +58,9 @@ export default function (request) {
56
58
  entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel'],
57
59
  invoke: {
58
60
  src: 'fetchConfig',
59
- onDone: [
60
- {
61
- target: 'getDefaultAffiliateCode',
62
- actions: 'setConfig',
63
- cond: 'isAffiliateCodeInstructionsEnable',
64
- },
65
- {
66
- target: 'idle',
67
- actions: 'setConfig',
68
- },
69
- ],
70
- onError: {
71
- target: 'idle',
72
- },
73
- },
74
- },
75
- getDefaultAffiliateCode: {
76
- invoke: {
77
- src: 'fetchDefaultAffiliateCode',
78
61
  onDone: {
79
62
  target: 'idle',
80
- actions: 'setDefaultAffiliateCode',
63
+ actions: 'setConfig',
81
64
  },
82
65
  onError: {
83
66
  target: 'idle',
@@ -200,12 +183,6 @@ export default function (request) {
200
183
  layoutConfig: layoutConfigDecoded,
201
184
  }
202
185
  }),
203
- setDefaultAffiliateCode: assign((context, event) => {
204
- const { affiliateCode } = event.data
205
- return {
206
- defaultAffiliateCode: affiliateCode,
207
- }
208
- }),
209
186
  setUA: assign((context, event) => {
210
187
  const parser = new UAParser()
211
188
  const userAgent = parser.getResult()
@@ -306,13 +283,6 @@ export default function (request) {
306
283
  }
307
284
  }),
308
285
  },
309
- guards: {
310
- isAffiliateCodeInstructionsEnable: (context, event) => {
311
- const { siteConfig } = event.data
312
- const { registerBindingAffiliateCodeInstructionsEnable } = siteConfig || {}
313
- return registerBindingAffiliateCodeInstructionsEnable ? JSON.parse(registerBindingAffiliateCodeInstructionsEnable) : false
314
- },
315
- },
316
286
  services: {
317
287
  fetchConfig: async (context, event) => {
318
288
  const [site, layout] = await Promise.all([request.send(api.getConfig({ appSecret })), request.send(api.getLayoutConfig({ appSecret }))])
@@ -329,9 +299,6 @@ export default function (request) {
329
299
  )
330
300
  return { siteConfig: JSON.parse(decodeResult), layoutConfig: layout.config }
331
301
  },
332
- fetchDefaultAffiliateCode: async (context, event) => {
333
- return await request.send(api.getDefaultAffiliateCode({ appSecret }))
334
- },
335
302
  fetchFeeds: async (context, event) => {
336
303
  return await request.send(api.feeds({ appSecret }))
337
304
  },
@@ -9,7 +9,6 @@ import game_search_cash from './game_search_cash.js'
9
9
  import game_search_v2 from './game_search_v2.js'
10
10
  import game_hot_new from './game_hot_new.js'
11
11
  import game_info from './game_info.js'
12
- import game_replay from './game_replay.js'
13
12
  import inbox from './inbox.js'
14
13
  import merge from './merge.js'
15
14
  import payment_data from './payment_data.js'
@@ -50,7 +49,6 @@ export default {
50
49
  game_search_v2,
51
50
  game_hot_new,
52
51
  game_info,
53
- game_replay,
54
52
  inbox,
55
53
  merge,
56
54
  payment_data,
@@ -1,46 +0,0 @@
1
- import { assign, createMachine } from 'xstate'
2
- import game from '../api/game.js'
3
-
4
- export default function (request, context) {
5
- // const { appSecret } = request.config
6
- const { providerId, seqNo, lang } = context
7
- return createMachine(
8
- {
9
- id: 'game_replay',
10
- initial: 'fetching',
11
- context: {
12
- gameReplayInfo: {},
13
- },
14
- states: {
15
- fetching: {
16
- invoke: {
17
- src: 'fetchGameReplayInfo',
18
- onDone: {
19
- target: 'idle',
20
- actions: 'setGameReplayInfo',
21
- },
22
- onError: {
23
- target: 'idle',
24
- },
25
- },
26
- },
27
- idle: {},
28
- },
29
- },
30
- {
31
- actions: {
32
- setGameReplayInfo: assign((context, event) => {
33
- return {
34
- gameReplayInfo: event.data.data,
35
- }
36
- }),
37
- },
38
- services: {
39
- // 取得遊戲重播資訊
40
- fetchGameReplayInfo: async (context, event) => {
41
- return await request.send(game.getGameReplayInfo({ providerId, seqNo, lang }))
42
- },
43
- },
44
- }
45
- )
46
- }