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

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,16 +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.430-dev.1](https://github.com/jetthai/cuora-module/compare/v1.1.430-dev.0...v1.1.430-dev.1) (2026-04-30)
6
-
7
- ### [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)
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
-
15
5
  ### [1.1.429-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.429-dev.0) (2026-04-14)
16
6
 
17
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.430-dev.1",
3
+ "version": "1.1.431-dev.0",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -0,0 +1,82 @@
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)
@@ -169,15 +169,21 @@ 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 || '0')}`)
172
+ const result = preciseAdd(`${parseFloat(context.selectedAmount || 0)}`, `${parseFloat(event.data)}`)
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 {}
177
180
  return { selectedAmount: event.data }
178
181
  }
179
182
  }),
180
183
  inputAmount: assign((context, event) => {
184
+ // 驗證輸入值:NaN 或負數時忽略此次輸入
185
+ const val = parseFloat(event.data)
186
+ if (isNaN(val) || val < 0) return {}
181
187
  return { selectedAmount: event.data }
182
188
  }),
183
189
  setAddress: assign((context, event) => {
@@ -53,7 +53,6 @@ export default function (request) {
53
53
  gameWalletType: null,
54
54
  switchGame: null,
55
55
  isPlaying: false,
56
- entry: null,
57
56
  },
58
57
  states: {
59
58
  flow: {
@@ -86,15 +85,15 @@ export default function (request) {
86
85
  },
87
86
  ENTER_GAME: {
88
87
  target: 'connecting',
89
- actions: ['setGameInfo', 'setLang', 'setEntry', 'setWalletType'],
88
+ actions: ['setGameInfo', 'setLang', 'setWalletType'],
90
89
  },
91
90
  DEMO_GAME: {
92
91
  target: 'demoGame',
93
- actions: ['setGameInfo', 'setLang', 'setEntry', 'setSite'],
92
+ actions: ['setGameInfo', 'setLang', 'setSite'],
94
93
  },
95
94
  MENU_ENTER_GAME: {
96
95
  target: 'connecting',
97
- actions: ['setGameInfo', 'setLang', 'setEntry', 'setWalletType'],
96
+ actions: ['setGameInfo', 'setLang', 'setWalletType'],
98
97
  },
99
98
  UPDATE: {
100
99
  target: 'updating',
@@ -227,14 +226,14 @@ export default function (request) {
227
226
  },
228
227
  MENU_ENTER_GAME: {
229
228
  target: 'connectSwitching',
230
- actions: ['setSwitch', 'setLang', 'setEntry', 'setWalletType'],
229
+ actions: ['setSwitch', 'setLang', 'setWalletType'],
231
230
  },
232
231
  ENTER_GAME_PAUSE: {
233
232
  actions: ['setIsPlaying', 'resetContent', 'resetSHA'],
234
233
  },
235
234
  ENTER_GAME: {
236
235
  target: 'connecting',
237
- actions: ['setGameInfo', 'setLang', 'setEntry', 'setWalletType'],
236
+ actions: ['setGameInfo', 'setLang', 'setWalletType'],
238
237
  },
239
238
  },
240
239
  },
@@ -248,7 +247,7 @@ export default function (request) {
248
247
  },
249
248
  ENTER_GAME: {
250
249
  target: 'connecting',
251
- actions: ['setGameInfo', 'setLang', 'setEntry', 'setWalletType'],
250
+ actions: ['setGameInfo', 'setLang', 'setWalletType'],
252
251
  },
253
252
  },
254
253
  },
@@ -475,9 +474,6 @@ export default function (request) {
475
474
  const lang = event.data.locale.replace('-', '_')
476
475
  return { lang }
477
476
  }),
478
- setEntry: assign((context, event) => {
479
- return { entry: event?.data?.entrySource }
480
- }),
481
477
  setSite: assign((context, event) => {
482
478
  const site = event.data.site
483
479
  return { site }
@@ -650,7 +646,7 @@ export default function (request) {
650
646
  return
651
647
  }
652
648
  const returnProviders = ['RSG', 'KP', 'EPICWIN', 'AMBSLOT', 'SEXY_VENUS', 'SEXY_SEXYBCRT', 'PG', 'NPG']
653
- const { lang, entry, isMobile, walletType } = context
649
+ const { lang, isMobile, walletType } = context
654
650
  const { gameTypeId, mappingId } = context.game
655
651
  const params = {
656
652
  provider_id: providerId,
@@ -660,7 +656,6 @@ export default function (request) {
660
656
  is_demo: false,
661
657
  is_mobile: isMobile === 'mobile' ? 'y' : null,
662
658
  lang,
663
- entry_source: entry || 'Other',
664
659
  selected_wallet_type: walletType || null, // 統一 undefined → null,確保後端收到一致的值
665
660
  return_url: returnProviders.includes(providerId)
666
661
  ? `${window.location.origin}${context.base}return`
@@ -670,7 +665,7 @@ export default function (request) {
670
665
  return { type, gameToken, gameHtml, gameURL: redirect_url, gameWalletType: wallet_type }
671
666
  },
672
667
  demoGame: async (context, event) => {
673
- const { lang, entry, site, isMobile, game } = context
668
+ const { lang, site, isMobile, game } = context
674
669
  const { providerId, gameId, gameTypeId, mappingId } = context.game
675
670
  const params = {
676
671
  site,
@@ -680,7 +675,6 @@ export default function (request) {
680
675
  mapping_id: mappingId,
681
676
  is_mobile: isMobile === 'mobile' ? 'y' : null,
682
677
  lang,
683
- entry_source: entry || 'Other',
684
678
  appSecret,
685
679
  }
686
680
  const { type, redirect_url, gameToken, gameHtml, is_demo } = await request.send(api.demoGame(params))