@jetthai/cuora 1.1.429-dev.0 → 1.1.429

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.
@@ -17,9 +17,7 @@
17
17
  "mcp__sentry__get_issue_details",
18
18
  "mcp__sentry__search_issues",
19
19
  "Bash(git add:*)",
20
- "Bash(git commit:*)",
21
- "Bash(git branch:*)",
22
- "Bash(git merge:*)"
20
+ "Bash(git commit:*)"
23
21
  ]
24
22
  }
25
23
  }
package/.prettierignore CHANGED
@@ -1,2 +1 @@
1
- dist/
2
- CHANGELOG.md
1
+ dist/
package/CHANGELOG.md CHANGED
@@ -2,56 +2,17 @@
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.429-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.429-dev.0) (2026-04-14)
6
-
7
-
8
- ### Features
9
-
10
- * **husky:** skip pre-push hooks on force push to dev/qa ([79e9df9](https://github.com/jetthai/cuora-module/commit/79e9df9bfd9335dca7d5aec590fa25d7580586ac))
11
-
12
-
13
- ### Bug Fixes
14
-
15
- * **deposit:** 修正 crypto_way_cash 計算失敗狀態及提交金額驗證 ([726c449](https://github.com/jetthai/cuora-module/commit/726c4493267b6ca502fc241385b251f6caaf84b5))
16
- * **deposit:** 強化 crypto_way_cash isSubmittable guard 的金額驗證 ([9361a5c](https://github.com/jetthai/cuora-module/commit/9361a5cc37bb0d7d65144b875baecced7f7e0f9f))
17
- * **deposit:** 防止 crypto_way_cash 金額輸入 NaN 及負數 ([608da8a](https://github.com/jetthai/cuora-module/commit/608da8a35dc111ee3e7e9fccea94a366d1b99599))
18
- * **game:** 防止 connectGame 將字串 "null" 的 providerId 送至後端 ([6bd8b60](https://github.com/jetthai/cuora-module/commit/6bd8b6017f351bd53295abb494835c66c65561fe))
19
- * **game:** 防止 selectedWalletType 為 null 送至後端 ([e62d195](https://github.com/jetthai/cuora-module/commit/e62d195cc12a0ec1021480e4c76b62005925da54))
20
- * **withdraw:** 修正法幣提款計算錯誤時的狀態轉移 ([a951ba8](https://github.com/jetthai/cuora-module/commit/a951ba803cccd1564a7dbe2645ea7c8d50f7da31))
21
-
22
- ### [1.1.428-dev.2](https://github.com/jetthai/cuora-module/compare/v1.1.428-dev.1...v1.1.428-dev.2) (2026-04-13)
23
-
24
-
25
- ### Bug Fixes
26
-
27
- * **game:** 防止 connectGame 將字串 "null" 的 providerId 送至後端 ([6bd8b60](https://github.com/jetthai/cuora-module/commit/6bd8b6017f351bd53295abb494835c66c65561fe))
28
-
29
- ### [1.1.428-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.428-dev.0...v1.1.428-dev.1) (2026-04-13)
30
-
5
+ ### [1.1.429](https://github.com/jetthai/cuora-module/compare/v1.1.428...v1.1.429) (2026-04-14)
31
6
 
32
7
  ### Bug Fixes
33
8
 
34
- * **game:** 防止 selectedWalletType 為 null 送至後端 ([e62d195](https://github.com/jetthai/cuora-module/commit/e62d195cc12a0ec1021480e4c76b62005925da54))
35
-
36
- ### [1.1.428-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.428-dev.0) (2026-04-13)
9
+ - **withdraw:** 修正加密貨幣提款計算錯誤時的狀態轉移 ([5fe9d9e](https://github.com/jetthai/cuora-module/commit/5fe9d9e32ec101c8054dd3c006d76f52616b436b))
37
10
 
11
+ ### [1.1.428](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.428) (2026-04-13)
38
12
 
39
13
  ### Features
40
14
 
41
- * **husky:** skip pre-push hooks on force push to dev/qa ([79e9df9](https://github.com/jetthai/cuora-module/commit/79e9df9bfd9335dca7d5aec590fa25d7580586ac))
42
-
43
-
44
- ### Bug Fixes
45
-
46
- * **deposit:** 修正 crypto_way_cash 計算失敗狀態及提交金額驗證 ([726c449](https://github.com/jetthai/cuora-module/commit/726c4493267b6ca502fc241385b251f6caaf84b5))
47
- * **deposit:** 強化 crypto_way_cash isSubmittable guard 的金額驗證 ([9361a5c](https://github.com/jetthai/cuora-module/commit/9361a5cc37bb0d7d65144b875baecced7f7e0f9f))
48
- * **deposit:** 防止 crypto_way_cash 金額輸入 NaN 及負數 ([608da8a](https://github.com/jetthai/cuora-module/commit/608da8a35dc111ee3e7e9fccea94a366d1b99599))
49
-
50
- ### [1.1.427-dev.5](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.427-dev.5) (2026-04-12)
51
-
52
- ### [1.1.427-dev.4](https://github.com/jetthai/cuora-module/compare/v1.1.427-dev.0...v1.1.427-dev.4) (2026-04-12)
53
-
54
- ### [1.1.427-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.427-dev.0) (2026-04-12)
15
+ - **husky:** skip pre-push hooks on force push to dev/qa ([79e9df9](https://github.com/jetthai/cuora-module/commit/79e9df9bfd9335dca7d5aec590fa25d7580586ac))
55
16
 
56
17
  ### [1.1.427](https://github.com/jetthai/cuora-module/compare/v1.1.426...v1.1.427) (2026-04-07)
57
18
 
@@ -71,77 +32,7 @@ All notable changes to this project will be documented in this file. See [standa
71
32
 
72
33
  ### [1.1.424](https://github.com/jetthai/cuora-module/compare/v1.1.423...v1.1.424) (2026-03-17)
73
34
 
74
- ### [1.1.422-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.422-dev-1...v1.1.422-dev-2) (2026-03-17)
75
-
76
- ### [1.1.422-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.422...v1.1.422-dev-1) (2026-03-16)
77
-
78
- ### [1.1.413-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-10...v1.1.413-dev-11) (2026-03-12)
79
-
80
- ### [1.1.413-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-9...v1.1.413-dev-10) (2026-03-11)
81
-
82
- ### [1.1.413-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.421...v1.1.413-dev-9) (2026-03-11)
83
-
84
- ### [1.1.413-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.420...v1.1.413-dev-8) (2026-03-10)
85
-
86
- ### [1.1.413-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.413-6...v1.1.413-dev-7) (2026-03-06)
87
-
88
- ### [1.1.413-6](https://github.com/jetthai/cuora-module/compare/v1.1.416...v1.1.413-6) (2026-03-06)
89
-
90
- ### [1.1.413-5](https://github.com/jetthai/cuora-module/compare/v1.1.413...v1.1.413-5) (2026-03-05)
91
-
92
- ### [1.1.422-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.422-dev-1...v1.1.422-dev-2) (2026-03-17)
93
-
94
- ### [1.1.422-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.422...v1.1.422-dev-1) (2026-03-16)
95
-
96
- ### [1.1.413-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-10...v1.1.413-dev-11) (2026-03-12)
97
-
98
- ### [1.1.413-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-9...v1.1.413-dev-10) (2026-03-11)
99
-
100
- ### [1.1.413-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.421...v1.1.413-dev-9) (2026-03-11)
101
-
102
- ### [1.1.413-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.420...v1.1.413-dev-8) (2026-03-10)
103
-
104
- ### [1.1.413-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.413-6...v1.1.413-dev-7) (2026-03-06)
105
-
106
- ### [1.1.413-6](https://github.com/jetthai/cuora-module/compare/v1.1.416...v1.1.413-6) (2026-03-06)
107
-
108
- ### [1.1.413-5](https://github.com/jetthai/cuora-module/compare/v1.1.413...v1.1.413-5) (2026-03-05)
109
-
110
- ### [1.1.422-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.422-dev-1...v1.1.422-dev-2) (2026-03-17)
111
-
112
- ### [1.1.422-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.422...v1.1.422-dev-1) (2026-03-16)
113
-
114
- ### [1.1.413-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-10...v1.1.413-dev-11) (2026-03-12)
115
-
116
- ### [1.1.413-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-9...v1.1.413-dev-10) (2026-03-11)
117
-
118
- ### [1.1.413-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.421...v1.1.413-dev-9) (2026-03-11)
119
-
120
- ### [1.1.413-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.420...v1.1.413-dev-8) (2026-03-10)
121
-
122
- ### [1.1.413-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.413-6...v1.1.413-dev-7) (2026-03-06)
123
-
124
- ### [1.1.413-6](https://github.com/jetthai/cuora-module/compare/v1.1.416...v1.1.413-6) (2026-03-06)
125
-
126
- ### [1.1.413-5](https://github.com/jetthai/cuora-module/compare/v1.1.413...v1.1.413-5) (2026-03-05)
127
-
128
- ### [1.1.422-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.422-dev-1...v1.1.422-dev-2) (2026-03-17)
129
-
130
- ### [1.1.422-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.422...v1.1.422-dev-1) (2026-03-16)
131
-
132
- ### [1.1.413-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-10...v1.1.413-dev-11) (2026-03-12)
133
-
134
- ### [1.1.413-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-9...v1.1.413-dev-10) (2026-03-11)
135
-
136
- ### [1.1.413-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.421...v1.1.413-dev-9) (2026-03-11)
137
-
138
- ### [1.1.413-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.420...v1.1.413-dev-8) (2026-03-10)
139
-
140
- ### [1.1.413-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.413-6...v1.1.413-dev-7) (2026-03-06)
141
-
142
- ### [1.1.413-6](https://github.com/jetthai/cuora-module/compare/v1.1.416...v1.1.413-6) (2026-03-06)
143
-
144
- ### [1.1.413-5](https://github.com/jetthai/cuora-module/compare/v1.1.413...v1.1.413-5) (2026-03-05)
35
+ ### [1.1.423](https://github.com/jetthai/cuora-module/compare/v1.1.422...v1.1.423) (2026-03-17)
145
36
 
146
37
  ### [1.1.422](https://github.com/jetthai/cuora-module/compare/v1.1.421...v1.1.422) (2026-03-16)
147
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.429-dev.0",
3
+ "version": "1.1.429",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
- // Copyright 2024 The Terasology Foundation
3
2
 
4
3
  // dev/qa 分支自動計算下一個 prerelease 版號
5
4
  // 版號格式:{master 版號}-{分支名}.{遞增編號}
@@ -120,9 +120,4 @@ export default {
120
120
  method: 'post',
121
121
  params: { startDate, endDate, appSecret },
122
122
  }),
123
- getMissionHistory: ({ activityNo, appSecret }) => ({
124
- url: 'activities/mission-history',
125
- method: 'get',
126
- params: { activityNo, appSecret },
127
- }),
128
123
  }
@@ -56,9 +56,8 @@ export default function (request, context) {
56
56
  target: 'calculated',
57
57
  actions: 'setCalculation',
58
58
  },
59
- // 計算失敗回到 loaded,避免進入 calculated 造成 UI 與 state 不一致
60
59
  onError: {
61
- target: 'loaded',
60
+ target: 'calculated',
62
61
  },
63
62
  },
64
63
  },
@@ -168,22 +167,14 @@ export default function (request, context) {
168
167
  setAmount: assign((context, event) => {
169
168
  // 現金網可自由填額度,grandTotalEnable 欄位感覺不再需要?
170
169
  if (context.selectedCrypto?.grandTotalEnable === 1) {
171
- // 累加模式:用 Math.max 確保累加結果不低於 0
172
- const result = preciseAdd(`${parseFloat(context.selectedAmount || 0)}`, `${parseFloat(event.data)}`)
173
170
  return {
174
- selectedAmount: Math.max(result, 0),
171
+ selectedAmount: preciseAdd(`${parseFloat(context.selectedAmount || 0)}`, `${parseFloat(event.data)}`),
175
172
  }
176
173
  } else {
177
- // 直接設定模式:拒絕 NaN 及負數,返回空物件使 context 不變
178
- const val = parseFloat(event.data)
179
- if (isNaN(val) || val < 0) return {}
180
174
  return { selectedAmount: event.data }
181
175
  }
182
176
  }),
183
177
  inputAmount: assign((context, event) => {
184
- // 驗證輸入值:NaN 或負數時忽略此次輸入
185
- const val = parseFloat(event.data)
186
- if (isNaN(val) || val < 0) return {}
187
178
  return { selectedAmount: event.data }
188
179
  }),
189
180
  setAddress: assign((context, event) => {
@@ -240,17 +231,9 @@ export default function (request, context) {
240
231
  const { selectedCrypto, selectedAmount } = context
241
232
  return selectedCrypto && selectedAmount && selectedCrypto.minimum <= +selectedAmount && +selectedAmount <= selectedCrypto.maximum
242
233
  },
243
- // 提交前最後一道 guard:重新驗證 amount 的合法性(與 isCalculable 同等嚴格)
244
234
  isSubmittable: (context, event) => {
245
235
  const { selectedCrypto, selectedAmount, calculation } = context
246
- return (
247
- selectedCrypto &&
248
- selectedAmount &&
249
- +selectedAmount > 0 &&
250
- selectedCrypto.minimum <= +selectedAmount &&
251
- +selectedAmount <= selectedCrypto.maximum &&
252
- calculation
253
- )
236
+ return selectedCrypto && selectedAmount && calculation
254
237
  },
255
238
  },
256
239
  services: {
@@ -267,15 +250,10 @@ export default function (request, context) {
267
250
  },
268
251
  submitDeposit: async (context, event) => {
269
252
  const { selectedCrypto, selectedAmount, sourceAddress, promotion } = context
270
- // 防禦性檢查:將 amount 轉為數字型別,並驗證範圍合法性,避免非法金額送出 API
271
- const amount = +selectedAmount
272
- if (!amount || amount <= 0 || amount < selectedCrypto.minimum || amount > selectedCrypto.maximum) {
273
- throw new Error('INVALID_AMOUNT')
274
- }
275
253
  return await request.send(
276
254
  payment.submitDepositTransactionCrypto({
277
255
  method: selectedCrypto.method,
278
- amount: amount,
256
+ amount: selectedAmount,
279
257
  cryptoCurrency: selectedCrypto.channel,
280
258
  cryptoNetwork: selectedCrypto.networkCode,
281
259
  sourceAddress: sourceAddress,
@@ -465,10 +465,8 @@ export default function (request) {
465
465
  const { providerId, gameId, gameTypeId, mappingId, portrait, gameCode, name, gameName } = context.switchGame
466
466
  return { game: { providerId, gameId, gameTypeId, mappingId, portrait: portrait ? 1 : 0, gameCode, name, gameName } }
467
467
  }),
468
- // 頁面刷新或深層連結時,event.data.walletType 可能為 undefined/null
469
- // 使用 ?? 確保不會覆蓋 context 中已有的 walletType,避免後端收到 selectedWalletType=null
470
468
  setWalletType: assign((context, event) => {
471
- return { walletType: event.data.walletType ?? context.walletType }
469
+ return { walletType: event.data.walletType }
472
470
  }),
473
471
  setLang: assign((context, event) => {
474
472
  const lang = event.data.locale.replace('-', '_')
@@ -640,9 +638,9 @@ export default function (request) {
640
638
  }
641
639
  },
642
640
  connectGame: async (context, event) => {
643
- // [防呆] 確保有 providerId 和 gameId(含字串 "null"/"undefined" 檢查)
641
+ // [防呆] 確保有 providerId 和 gameId
644
642
  const { providerId, gameId } = context.game || {}
645
- if (!providerId || !gameId || providerId === 'null' || providerId === 'undefined' || gameId === 'null' || gameId === 'undefined') {
643
+ if (!providerId || !gameId) {
646
644
  return
647
645
  }
648
646
  const returnProviders = ['RSG', 'KP', 'EPICWIN', 'AMBSLOT', 'SEXY_VENUS', 'SEXY_SEXYBCRT', 'PG', 'NPG']
@@ -656,7 +654,7 @@ export default function (request) {
656
654
  is_demo: false,
657
655
  is_mobile: isMobile === 'mobile' ? 'y' : null,
658
656
  lang,
659
- selected_wallet_type: walletType || null, // 統一 undefined → null,確保後端收到一致的值
657
+ selected_wallet_type: walletType,
660
658
  return_url: returnProviders.includes(providerId)
661
659
  ? `${window.location.origin}${context.base}return`
662
660
  : window.location.href?.split('?')?.[0], // For providers to return.
@@ -130,7 +130,7 @@ export default function (request, context) {
130
130
  },
131
131
  ],
132
132
  onError: {
133
- target: 'idle',
133
+ target: '#withdraw_crypto_cash.calculated',
134
134
  },
135
135
  },
136
136
  },
@@ -132,7 +132,7 @@ export default function (request, context) {
132
132
  actions: 'setProcessing',
133
133
  },
134
134
  onError: {
135
- target: '#withdraw_manual_cash.calculated',
135
+ target: 'idle',
136
136
  },
137
137
  },
138
138
  },