@jetthai/cuora 1.1.384 → 1.1.386

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,10 @@
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.386](https://github.com/jetthai/cuora-module/compare/v1.1.385...v1.1.386) (2025-09-19)
6
+
7
+ ### [1.1.385](https://github.com/jetthai/cuora-module/compare/v1.1.384...v1.1.385) (2025-09-17)
8
+
5
9
  ### [1.1.384](https://github.com/jetthai/cuora-module/compare/v1.1.383...v1.1.384) (2025-09-16)
6
10
 
7
11
  ### [1.1.383](https://github.com/jetthai/cuora-module/compare/v1.1.382...v1.1.383) (2025-09-16)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.384",
3
+ "version": "1.1.386",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/src/api/user.js CHANGED
@@ -44,7 +44,7 @@ export default {
44
44
  params: { requestId, target, appSecret },
45
45
  isPublic: true,
46
46
  }),
47
- passwordV2Change: ({ requestId, target, newPassword }) => ({
47
+ passwordV2Change: ({ requestId, target, newPassword, appSecret }) => ({
48
48
  url: 'recovery/v2/changePassword',
49
49
  method: 'post',
50
50
  params: { requestId, target, newPassword, appSecret },
@@ -5,7 +5,7 @@ import { GAME_SEARCH } from '../util/constant.js'
5
5
 
6
6
  // 對應 intersectionObserver 版本
7
7
  export default function (request) {
8
- const { appSecret } = request.config
8
+ const { appSecret, sentry } = request.config
9
9
  return createMachine(
10
10
  {
11
11
  id: 'game',
@@ -518,6 +518,17 @@ export default function (request) {
518
518
  } else if (additionEnable) {
519
519
  const param = { categoryId: room.categoryId, index, appSecret }
520
520
  requestChain = event.data.list.map((category, b) => {
521
+ // 參數必填檢查
522
+ if (!category?.id) {
523
+ sentry?.captureMessage('PARAMETER_ERROR', {
524
+ level: 'warning',
525
+ tags: {
526
+ caller: 'batchFetch',
527
+ action: 'getListCategory',
528
+ param: JSON.stringify(category?.id),
529
+ },
530
+ })
531
+ }
521
532
  return request
522
533
  .send(
523
534
  api.getListCategory({
@@ -528,10 +539,32 @@ export default function (request) {
528
539
  )
529
540
  .then((res) => Object.assign({ downLine: res.data.filter((item) => item.isGame).slice(0, 20) }, category))
530
541
  })
542
+ // 參數必填檢查
543
+ if (!param?.categoryId) {
544
+ sentry?.captureMessage('PARAMETER_ERROR', {
545
+ level: 'warning',
546
+ tags: {
547
+ caller: 'batchFetch',
548
+ action: 'getListAddition',
549
+ param: JSON.stringify(param),
550
+ },
551
+ })
552
+ }
531
553
  const result = await Promise.all([...requestChain, request.send(api.getListAddition(param))])
532
554
  return result.filter((item) => item.downLine.length > 0).slice(0, 6)
533
555
  } else {
534
556
  requestChain = event.data.list.map((category, b) => {
557
+ // 參數必填檢查
558
+ if (!category?.id) {
559
+ sentry?.captureMessage('PARAMETER_ERROR', {
560
+ level: 'warning',
561
+ tags: {
562
+ caller: 'batchFetch/else',
563
+ action: 'getListCategory',
564
+ param: JSON.stringify(category?.id),
565
+ },
566
+ })
567
+ }
535
568
  return request
536
569
  .send(
537
570
  api.getListCategory({
@@ -562,9 +595,31 @@ export default function (request) {
562
595
  ]
563
596
  } else if (additionEnable) {
564
597
  const param = { categoryId: room.categoryId, index, appSecret }
598
+ // 參數必填檢查
599
+ if (!param?.categoryId) {
600
+ sentry?.captureMessage('PARAMETER_ERROR', {
601
+ level: 'warning',
602
+ tags: {
603
+ caller: 'getPageContent',
604
+ action: 'getListCategory/getListAddition',
605
+ param: JSON.stringify(param),
606
+ },
607
+ })
608
+ }
565
609
  return await Promise.all([request.send(api.getListCategory(param)), request.send(api.getListAddition(param))])
566
610
  } else {
567
611
  const param = { categoryId: room.categoryId, index, appSecret }
612
+ // 參數必填檢查
613
+ if (!param?.categoryId) {
614
+ sentry?.captureMessage('PARAMETER_ERROR', {
615
+ level: 'warning',
616
+ tags: {
617
+ caller: 'getPageContent/else',
618
+ action: 'getListCategory',
619
+ param: JSON.stringify(param),
620
+ },
621
+ })
622
+ }
568
623
  return await Promise.all([request.send(api.getListCategory(param))])
569
624
  }
570
625
  },