@jetthai/cuora 1.1.394-dev-7 → 1.1.394

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,40 +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.394-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.399...v1.1.394-dev-7) (2025-11-20)
6
-
7
- ### [1.1.394-dev-6](https://github.com/jetthai/cuora-module/compare/v1.1.396...v1.1.394-dev-6) (2025-11-13)
8
-
9
- ### [1.1.394-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.394-dev-4...v1.1.394-dev-5) (2025-11-11)
10
-
11
- ### [1.1.394-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.394-dev-3...v1.1.394-dev-4) (2025-11-11)
12
-
13
- ### [1.1.394-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.394-dev-2...v1.1.394-dev-3) (2025-11-10)
14
-
15
- ### [1.1.394-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.394-dev-1...v1.1.394-dev-2) (2025-11-10)
16
-
17
- ### Features
18
-
19
- - 新增活動週期自動更新檢查機制 ([d80ff18](https://github.com/jetthai/cuora-module/commit/d80ff188b25fb1576fd25edc8ed985ae1f1b6af6))
20
-
21
- ### [1.1.394-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.394...v1.1.394-dev-1) (2025-11-10)
22
-
23
- ### [1.1.394-dev-6](https://github.com/jetthai/cuora-module/compare/v1.1.394-dev-5...v1.1.394-dev-6) (2025-11-13)
24
-
25
- ### [1.1.394-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.394-dev-4...v1.1.394-dev-5) (2025-11-11)
26
-
27
- ### [1.1.394-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.394-dev-3...v1.1.394-dev-4) (2025-11-11)
28
-
29
- ### [1.1.394-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.394-dev-2...v1.1.394-dev-3) (2025-11-10)
30
-
31
- ### [1.1.394-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.394-dev-1...v1.1.394-dev-2) (2025-11-10)
32
-
33
- ### Features
34
-
35
- - 新增活動週期自動更新檢查機制 ([d80ff18](https://github.com/jetthai/cuora-module/commit/d80ff188b25fb1576fd25edc8ed985ae1f1b6af6))
36
-
37
- ### [1.1.394-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.394...v1.1.394-dev-1) (2025-11-10)
38
-
39
5
  ### [1.1.394](https://github.com/jetthai/cuora-module/compare/v1.1.393...v1.1.394) (2025-11-04)
40
6
 
41
7
  ### [1.1.393](https://github.com/jetthai/cuora-module/compare/v1.1.392...v1.1.393) (2025-10-17)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.394-dev-7",
3
+ "version": "1.1.394",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/src/api/common.js CHANGED
@@ -7,9 +7,4 @@ 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
- }),
15
10
  }
package/src/api/index.js CHANGED
@@ -7,7 +7,5 @@ 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'
12
10
 
13
- export default { activity, auth, common, game, mailbox, payment, user, form, ranking, account, otp }
11
+ export default { activity, auth, common, game, mailbox, payment, user, form, ranking }
@@ -13,7 +13,6 @@ export default function (request, context) {
13
13
  activityNo,
14
14
  activityDetail: null,
15
15
  duration: 0,
16
- lastCheckedPeriodEndTime: null, // 追蹤已檢查過的週期結束時間
17
16
 
18
17
  // 領獎後得到的資訊
19
18
  awards: [],
@@ -55,19 +54,17 @@ export default function (request, context) {
55
54
  },
56
55
  },
57
56
  after: {
58
- 1000: [{ target: 'loading', cond: 'shouldCheckNewPeriod' }, { target: 'awardable' }],
57
+ 1000: {
58
+ target: 'awardable',
59
+ },
59
60
  },
60
61
  },
61
62
  awarded: {
62
- entry: 'setDuration',
63
63
  on: {
64
64
  REFRESH_ACTIVITY: {
65
65
  target: 'loading',
66
66
  },
67
67
  },
68
- after: {
69
- 1000: [{ target: 'loading', cond: 'shouldCheckNewPeriod' }, { target: 'awarded' }],
70
- },
71
68
  },
72
69
  awarding: {
73
70
  invoke: {
@@ -100,17 +97,7 @@ export default function (request, context) {
100
97
  },
101
98
  },
102
99
  },
103
- result: {
104
- entry: 'setDuration',
105
- on: {
106
- REFRESH_ACTIVITY: {
107
- target: 'loading',
108
- },
109
- },
110
- after: {
111
- 1000: [{ target: 'loading', cond: 'shouldCheckNewPeriod' }, { target: 'result' }],
112
- },
113
- },
100
+ result: {},
114
101
  },
115
102
  on: {
116
103
  START: {
@@ -131,8 +118,6 @@ export default function (request, context) {
131
118
  setActivityDetail: assign((context, event) => {
132
119
  return {
133
120
  activityDetail: event.data,
134
- // 重置 lastCheckedPeriodEndTime,允許新週期結束時再次檢查
135
- lastCheckedPeriodEndTime: null,
136
121
  }
137
122
  }),
138
123
  setAward: assign((context, event) => {
@@ -166,24 +151,6 @@ export default function (request, context) {
166
151
  isAutoReceiving: (context, event) => {
167
152
  return context.isAutoReceiving
168
153
  },
169
- shouldCheckNewPeriod: (context, event) => {
170
- // 當倒數計時結束時,重新檢查活動狀態
171
- // 使用 lastCheckedPeriodEndTime 避免同一週期重複呼叫 API
172
- const periodEndTime = context?.activityDetail?.periodEndTime
173
-
174
- // 如果 duration 為 0,且這個週期還沒檢查過,則觸發更新
175
- if (context.duration === 0 && periodEndTime) {
176
- // 如果是新的週期結束時間,或者還沒檢查過,則允許觸發
177
- if (context.lastCheckedPeriodEndTime !== periodEndTime) {
178
- // 更新 lastCheckedPeriodEndTime(在 guard 中直接修改 context 是不好的做法,
179
- // 但這裡是為了避免重複觸發,是可接受的權衡)
180
- context.lastCheckedPeriodEndTime = periodEndTime
181
- return true
182
- }
183
- }
184
-
185
- return false
186
- },
187
154
  },
188
155
  services: {
189
156
  fetchActivityDetail: async (context, event) => {
@@ -465,11 +465,8 @@ export default function (request) {
465
465
  referralObj.channel = storage.get('channel') || defaultChannel || channel
466
466
  referralObj.subchannel = storage.get('subchannel') || defaultSubchannel || subchannel
467
467
 
468
- // OZE、ZAZA 先使用 v2 測試 ,等待確認沒問題後再統一用 v2
469
- const fullURL = ['OZE', 'ZAZA'].includes(clientId) ? request.config.fullURL.replace('/v1/', '/v2/') : request.config.fullURL
470
-
471
468
  const redirectURL = urljoin(
472
- fullURL,
469
+ request.config.fullURL,
473
470
  'login?' +
474
471
  new URLSearchParams({
475
472
  provider,
@@ -1,6 +1,6 @@
1
1
  import { assign, createMachine } from 'xstate'
2
2
  import user from '../api/user.js'
3
- import otp from '../api/otp.js'
3
+ import auth from '../api/auth.js'
4
4
 
5
5
  export default function (request) {
6
6
  return createMachine(
@@ -178,16 +178,12 @@ export default function (request) {
178
178
  }
179
179
  }),
180
180
  setVerificationData: assign((context, event) => {
181
- const { request_id, ttl, email, countryCode, phone } = event.data
181
+ const { requestId, ttl, target, status } = event.data
182
182
  return {
183
- requestId: request_id,
184
- ttl: ttl, // 後端傳過來的是毫秒
185
- target: {
186
- provider: context.strategy,
187
- email: email,
188
- countryCode: countryCode,
189
- phone: phone,
190
- },
183
+ requestId,
184
+ ttl: ttl * 1000,
185
+ target,
186
+ status,
191
187
  }
192
188
  }),
193
189
  decreaseTtl: assign((context, evnet) => {
@@ -243,51 +239,24 @@ export default function (request) {
243
239
  return await request.send(user.getUserInfo())
244
240
  },
245
241
  verify: async (context, event) => {
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
- )
242
+ return await request.send(user.verifyV2Initiate({ strategy: context.strategy }))
254
243
  },
255
244
  sendPhone: async (context, event) => {
256
245
  const { countryCode, phone } = context
257
- return await request.send(
258
- otp.verification({
259
- strategy: 'phone',
260
- countryCode,
261
- phone,
262
- })
263
- )
246
+ return await request.send(auth.bindPost({ provider: 'phone', countryCode, phone }))
264
247
  },
265
248
  sendEmail: async (context, event) => {
266
249
  const { email } = context
267
- return await request.send(
268
- otp.verification({
269
- strategy: 'email',
270
- email,
271
- })
272
- )
250
+ return await request.send(auth.bindPost({ provider: 'email', email }))
273
251
  },
274
252
  resetOtp: async (context, event) => {
275
253
  const { requestId, target } = context
276
- return await request.send(
277
- otp.reset({
278
- request_id: requestId,
279
- })
280
- )
254
+ return await request.send(user.otpReset({ requestId, target }))
281
255
  },
282
256
  acknowledge: async (context, event) => {
283
257
  const { requestId, target } = context
284
258
  const code = event.data
285
- return await request.send(
286
- otp.acknowledge({
287
- request_id: requestId,
288
- code,
289
- })
290
- )
259
+ return await request.send(user.otpAcknowledge({ requestId, target, code }))
291
260
  },
292
261
  },
293
262
  }
@@ -153,6 +153,7 @@ export default function (request) {
153
153
  actions: assign((context, event) => {
154
154
  return {
155
155
  bank: null,
156
+ ifscCode: null,
156
157
  crypto: null,
157
158
  network: null,
158
159
  cryptoAddress: null,
@@ -55,7 +55,7 @@ export default function (request) {
55
55
  },
56
56
  },
57
57
  fetching: {
58
- entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel', 'setFbclid'],
58
+ entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel'],
59
59
  invoke: {
60
60
  src: 'fetchConfig',
61
61
  onDone: [
@@ -237,18 +237,6 @@ 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
- }),
252
240
  setPixel: assign(() => {
253
241
  let urlParams = new URLSearchParams(window.location.search)
254
242
  const pix = urlParams.get('pix') || storage.get('pix') || ''
@@ -40,7 +40,6 @@ export default function (request) {
40
40
  portrait: null,
41
41
  gameCode: null,
42
42
  name: null,
43
- gameName: null,
44
43
  isDemo: false,
45
44
  },
46
45
  walletType: null,
@@ -451,15 +450,15 @@ export default function (request) {
451
450
  },
452
451
  }),
453
452
  setGameInfo: assign((context, event) => {
454
- const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name, gameName } = event.data.game
455
- return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name, gameName } }
453
+ const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name } = event.data.game
454
+ return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name } }
456
455
  }),
457
456
  setSwitch: assign((context, event) => {
458
457
  return { switchGame: event.data.game }
459
458
  }),
460
459
  setSwitchGameInfo: assign((context, event) => {
461
- const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name, gameName } = context.switchGame
462
- return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name, gameName } }
460
+ const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name } = context.switchGame
461
+ return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name } }
463
462
  }),
464
463
  setWalletType: assign((context, event) => {
465
464
  return { walletType: event.data.walletType }
@@ -258,10 +258,6 @@ export default function (request) {
258
258
  services: {
259
259
  fetchActivityDetail: async (context, event) => {
260
260
  const { activityNo, activityDetail = {} } = context
261
- // 當活動資料已存在時避免重複呼叫 api
262
- if (Object.keys(activityDetail).length > 0) {
263
- return activityDetail
264
- }
265
261
  const { data } = await request.send(api.getActivityDetail({ activityNo, appSecret }))
266
262
  return data.activityNo ? data : activityDetail
267
263
  },
@@ -140,19 +140,6 @@ 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',
156
143
  ]
157
144
 
158
145
  function isValid(value) {
@@ -1,8 +0,0 @@
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/otp.js DELETED
@@ -1,5 +0,0 @@
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
- }