@jetthai/cuora 1.1.431-dev.0 → 1.1.431-dev.1

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,33 @@
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.431-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.431-dev.0...v1.1.431-dev.1) (2026-05-01)
6
+
7
+ ### [1.1.431-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.430...v1.1.431-dev.0) (2026-05-01)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **deposit:** 修正 crypto_way_cash inputAmount 清空時未重置狀態 ([2630a06](https://github.com/jetthai/cuora-module/commit/2630a060b0a43d27a0a727c0e0e5efe0306b2ca9))
13
+ * **deposit:** 修正 crypto_way_cash setAmount 清空時未重置狀態 ([2fc0c08](https://github.com/jetthai/cuora-module/commit/2fc0c08d3e49e321319bef27bcdb52b4491a98a0))
14
+ * **deposit:** 修正 crypto_way_cash 計算失敗狀態及提交金額驗證 ([726c449](https://github.com/jetthai/cuora-module/commit/726c4493267b6ca502fc241385b251f6caaf84b5))
15
+ * **deposit:** 強化 crypto_way_cash isSubmittable guard 的金額驗證 ([9361a5c](https://github.com/jetthai/cuora-module/commit/9361a5cc37bb0d7d65144b875baecced7f7e0f9f))
16
+ * **deposit:** 防止 crypto_way_cash 金額輸入 NaN 及負數 ([608da8a](https://github.com/jetthai/cuora-module/commit/608da8a35dc111ee3e7e9fccea94a366d1b99599))
17
+ * **error:** 讓新錯誤可覆寫舊狀態避免 SET_ERROR 鎖死 ([4113751](https://github.com/jetthai/cuora-module/commit/4113751ee6cb4ced8fe1dc2fda0ce9fbac21ec06))
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.430-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.430-dev.0...v1.1.430-dev.1) (2026-04-30)
23
+
24
+ ### [1.1.430-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.431-dev.0...v1.1.430-dev.0) (2026-04-28)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * **deposit:** 修正 crypto_way_cash inputAmount 清空時未重置狀態 ([2630a06](https://github.com/jetthai/cuora-module/commit/2630a060b0a43d27a0a727c0e0e5efe0306b2ca9))
30
+ * **deposit:** 修正 crypto_way_cash setAmount 清空時未重置狀態 ([2fc0c08](https://github.com/jetthai/cuora-module/commit/2fc0c08d3e49e321319bef27bcdb52b4491a98a0))
31
+
5
32
  ### [1.1.429-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.429-dev.0) (2026-04-14)
6
33
 
7
34
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.431-dev.0",
3
+ "version": "1.1.431-dev.1",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -169,21 +169,15 @@ export default function (request, context) {
169
169
  // 現金網可自由填額度,grandTotalEnable 欄位感覺不再需要?
170
170
  if (context.selectedCrypto?.grandTotalEnable === 1) {
171
171
  // 累加模式:用 Math.max 確保累加結果不低於 0
172
- const result = preciseAdd(`${parseFloat(context.selectedAmount || 0)}`, `${parseFloat(event.data)}`)
172
+ const result = preciseAdd(`${parseFloat(context.selectedAmount || 0)}`, `${parseFloat(event.data || '0')}`)
173
173
  return {
174
174
  selectedAmount: Math.max(result, 0),
175
175
  }
176
176
  } else {
177
- // 直接設定模式:拒絕 NaN 及負數,返回空物件使 context 不變
178
- const val = parseFloat(event.data)
179
- if (isNaN(val) || val < 0) return {}
180
177
  return { selectedAmount: event.data }
181
178
  }
182
179
  }),
183
180
  inputAmount: assign((context, event) => {
184
- // 驗證輸入值:NaN 或負數時忽略此次輸入
185
- const val = parseFloat(event.data)
186
- if (isNaN(val) || val < 0) return {}
187
181
  return { selectedAmount: event.data }
188
182
  }),
189
183
  setAddress: assign((context, event) => {
@@ -50,6 +50,13 @@ export default function (request) {
50
50
  freeGameSettle: {},
51
51
  freeGameGiveUp: {},
52
52
  },
53
+ // 讓新錯誤可以覆寫舊狀態,避免 error.* 子狀態鎖死後續所有 SET_ERROR
54
+ on: {
55
+ SET_ERROR: {
56
+ target: '.unknown',
57
+ actions: 'setError',
58
+ },
59
+ },
53
60
  },
54
61
  },
55
62
  on: {
@@ -53,6 +53,7 @@ export default function (request) {
53
53
  gameWalletType: null,
54
54
  switchGame: null,
55
55
  isPlaying: false,
56
+ entry: null,
56
57
  },
57
58
  states: {
58
59
  flow: {
@@ -85,15 +86,15 @@ export default function (request) {
85
86
  },
86
87
  ENTER_GAME: {
87
88
  target: 'connecting',
88
- actions: ['setGameInfo', 'setLang', 'setWalletType'],
89
+ actions: ['setGameInfo', 'setLang', 'setEntry', 'setWalletType'],
89
90
  },
90
91
  DEMO_GAME: {
91
92
  target: 'demoGame',
92
- actions: ['setGameInfo', 'setLang', 'setSite'],
93
+ actions: ['setGameInfo', 'setLang', 'setEntry', 'setSite'],
93
94
  },
94
95
  MENU_ENTER_GAME: {
95
96
  target: 'connecting',
96
- actions: ['setGameInfo', 'setLang', 'setWalletType'],
97
+ actions: ['setGameInfo', 'setLang', 'setEntry', 'setWalletType'],
97
98
  },
98
99
  UPDATE: {
99
100
  target: 'updating',
@@ -226,14 +227,14 @@ export default function (request) {
226
227
  },
227
228
  MENU_ENTER_GAME: {
228
229
  target: 'connectSwitching',
229
- actions: ['setSwitch', 'setLang', 'setWalletType'],
230
+ actions: ['setSwitch', 'setLang', 'setEntry', 'setWalletType'],
230
231
  },
231
232
  ENTER_GAME_PAUSE: {
232
233
  actions: ['setIsPlaying', 'resetContent', 'resetSHA'],
233
234
  },
234
235
  ENTER_GAME: {
235
236
  target: 'connecting',
236
- actions: ['setGameInfo', 'setLang', 'setWalletType'],
237
+ actions: ['setGameInfo', 'setLang', 'setEntry', 'setWalletType'],
237
238
  },
238
239
  },
239
240
  },
@@ -247,7 +248,7 @@ export default function (request) {
247
248
  },
248
249
  ENTER_GAME: {
249
250
  target: 'connecting',
250
- actions: ['setGameInfo', 'setLang', 'setWalletType'],
251
+ actions: ['setGameInfo', 'setLang', 'setEntry', 'setWalletType'],
251
252
  },
252
253
  },
253
254
  },
@@ -474,6 +475,9 @@ export default function (request) {
474
475
  const lang = event.data.locale.replace('-', '_')
475
476
  return { lang }
476
477
  }),
478
+ setEntry: assign((context, event) => {
479
+ return { entry: event?.data?.entrySource }
480
+ }),
477
481
  setSite: assign((context, event) => {
478
482
  const site = event.data.site
479
483
  return { site }
@@ -646,7 +650,7 @@ export default function (request) {
646
650
  return
647
651
  }
648
652
  const returnProviders = ['RSG', 'KP', 'EPICWIN', 'AMBSLOT', 'SEXY_VENUS', 'SEXY_SEXYBCRT', 'PG', 'NPG']
649
- const { lang, isMobile, walletType } = context
653
+ const { lang, entry, isMobile, walletType } = context
650
654
  const { gameTypeId, mappingId } = context.game
651
655
  const params = {
652
656
  provider_id: providerId,
@@ -656,6 +660,7 @@ export default function (request) {
656
660
  is_demo: false,
657
661
  is_mobile: isMobile === 'mobile' ? 'y' : null,
658
662
  lang,
663
+ entry_source: entry || 'Other',
659
664
  selected_wallet_type: walletType || null, // 統一 undefined → null,確保後端收到一致的值
660
665
  return_url: returnProviders.includes(providerId)
661
666
  ? `${window.location.origin}${context.base}return`
@@ -665,7 +670,7 @@ export default function (request) {
665
670
  return { type, gameToken, gameHtml, gameURL: redirect_url, gameWalletType: wallet_type }
666
671
  },
667
672
  demoGame: async (context, event) => {
668
- const { lang, site, isMobile, game } = context
673
+ const { lang, entry, site, isMobile, game } = context
669
674
  const { providerId, gameId, gameTypeId, mappingId } = context.game
670
675
  const params = {
671
676
  site,
@@ -675,6 +680,7 @@ export default function (request) {
675
680
  mapping_id: mappingId,
676
681
  is_mobile: isMobile === 'mobile' ? 'y' : null,
677
682
  lang,
683
+ entry_source: entry || 'Other',
678
684
  appSecret,
679
685
  }
680
686
  const { type, redirect_url, gameToken, gameHtml, is_demo } = await request.send(api.demoGame(params))
@@ -1,82 +0,0 @@
1
- # JT-1776243420: Third-Party Register Carry Phone / Email Payload
2
-
3
- ## Key Changes
4
-
5
- 1. Extended third-party redirect payload assembly to read `tp_phone`, `tp_countryCode`, and `tp_email` from storage.
6
- 2. Preserved existing affiliate code / nickname behavior and appended new fields only when values are valid.
7
- 3. Cleans the temporary third-party storage keys after composing the redirect query.
8
-
9
- ---
10
-
11
- ## Key Findings
12
-
13
- ### Strengths
14
- 1. The change is tightly scoped to the third-party auth redirect builder in `src/machine/auth.js:477-520`.
15
- 2. Existing affiliate code and nickname logic remains unchanged while phone / email are additive only.
16
- 3. Temporary keys are removed after payload composition, reducing leakage into later unrelated auth flows.
17
-
18
- ---
19
-
20
- ### Behavior Observed
21
- 1. Static review confirms `phone`, `countryCode`, and `email` are appended only when storage values are not `undefined` / `null`.
22
- 2. Channel and subchannel fallback logic stays intact after the new fields are added.
23
- 3. No unrelated file changes were present in this repo for the review scope.
24
-
25
- ---
26
-
27
- ## 🔧 Change Type
28
-
29
- - [ ] 🐛 Bug fix
30
- - [x] ✨ New feature
31
- - [ ] 💄 Style
32
- - [ ] ♻️ Refactor
33
- - [ ] ⚡ Performance
34
- - [ ] 🔧 Chore
35
-
36
- ---
37
-
38
- ## 📱 Impact Scope
39
-
40
- - Third-party register / login redirect query assembly in cuora shared auth machine.
41
- - Downstream PWA clients that store `tp_phone`, `tp_countryCode`, and `tp_email` before `LOGIN_3PARTY`.
42
-
43
- ---
44
-
45
- ## Test Completion Status
46
-
47
- | Item | Validation Tested | Status |
48
- |------|-------------------|--------|
49
- | Diff hygiene | `git diff --check` in `cuora-module` | PASS |
50
- | Shared auth payload review | Reviewed `src/machine/auth.js:477-520` against ticket intent | PASS |
51
- | Runtime redirect execution | Not run in this repo directly; validated through client repos instead | NOT RUN |
52
-
53
- ---
54
-
55
- ## 📋 Spec Validation (Aligned with review-playbook)
56
-
57
- | Spec Item | Evidence (File/Line/Result) | Status |
58
- |---------|---------------------------|------|
59
- | Third-party flow can carry phone when client stored it | `src/machine/auth.js:479-520` reads `tp_phone` / `tp_countryCode` and appends them to `referralObj` | PASS |
60
- | Third-party flow can carry email when client stored it | `src/machine/auth.js:481-520` reads `tp_email` and appends it to `referralObj` | PASS |
61
- | Affiliate code and nickname keep original logic | `src/machine/auth.js:477-500` keeps `ac` / `nick_name` handling unchanged | PASS |
62
- | Temporary third-party data does not leak into later unrelated flows | `src/machine/auth.js:518-520` removes the temporary storage keys after composing the redirect URL | PASS |
63
-
64
- ---
65
-
66
- ## 📋 Standards Checklist (Summary)
67
- | Category | Result | Notes |
68
- |---|---|---|
69
- | Memory Safety | PASS | Simple storage reads and object assembly only. |
70
- | Rendering Performance | PASS | No rendering code touched. |
71
- | Network Requests | PASS | Existing redirect flow only; no extra requests added. |
72
- | Bundle Optimization | PASS | No new imports or heavy logic added. |
73
- | Code Quality | PASS | Scope is narrow and branch contains only the required file change. |
74
- | Vue / Nuxt Standards | NOT RUN | Shared module; not a Vue / Nuxt surface. |
75
- | SSR Security Standards | PASS | Query parameters are assembled from existing client-side storage path only. |
76
- | Project Conventions | PASS | Matches existing storage-guard pattern used for affiliate / nickname. |
77
-
78
- ## Conclusion
79
-
80
- This repo’s shared auth-machine change matches the ticket intent and is internally consistent. Runtime behavior was not executed in `cuora-module` directly, but both client repos now pass the new storage keys into this shared payload path.
81
-
82
- **Overall Result:** PASS (PARTIAL)