@jetthai/cuora 2.0.0-beta.0 → 2.0.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.
Files changed (201) hide show
  1. package/.claude/commands/sync-ai-prompts.md +93 -0
  2. package/.claude/settings.local.json +23 -0
  3. package/.github/copilot-instructions.md +405 -0
  4. package/.husky/post-checkout +32 -0
  5. package/.husky/pre-commit +1 -3
  6. package/.husky/pre-push +36 -0
  7. package/AGENTS.md +405 -0
  8. package/AI_PROMPT_SOURCE.md +403 -0
  9. package/CHANGELOG.md +274 -3
  10. package/CLAUDE.md +405 -0
  11. package/GEMINI.md +405 -0
  12. package/README.md +299 -15
  13. package/docs/kibana/crypto-way-deposit-amount-bug-analysis.md +1003 -0
  14. package/docs/kibana/play-providerId-error.md +202 -0
  15. package/docs/kibana/play-selectedWalletType.md +1 -0
  16. package/docs/kibana/play-selectedWalletType_2.md +1 -0
  17. package/docs/kibana/play-selectedWalletType_analysis.md +565 -0
  18. package/package.json +3 -3
  19. package/scripts/auto-version.js +68 -0
  20. package/scripts/auto-version.sh +33 -0
  21. package/scripts/branch-auto-npm-publish.js +29 -0
  22. package/scripts/check-version.sh +36 -0
  23. package/scripts/clean-tags.sh +84 -0
  24. package/src/api/account.js +0 -1
  25. package/src/api/activity.js +22 -37
  26. package/src/api/auth.js +5 -36
  27. package/src/api/common.js +5 -3
  28. package/src/api/game.js +0 -10
  29. package/src/api/payment.js +17 -55
  30. package/src/api/user.js +10 -16
  31. package/src/index.js +2 -2
  32. package/src/machine/activity/activity_cash.js +84 -36
  33. package/src/machine/activity/cash_rain_activity.js +0 -1
  34. package/src/machine/activity/continue_deposit_activity.js +0 -1
  35. package/src/machine/activity/deposit_activity.js +0 -1
  36. package/src/machine/activity/diamond_shop_activity_cash.js +0 -8
  37. package/src/machine/activity/fafafa_activity.js +0 -11
  38. package/src/machine/activity/friend_invite_friends_activity.js +8 -7
  39. package/src/machine/activity/index.js +0 -12
  40. package/src/machine/activity/instant_rebate_activity.js +0 -1
  41. package/src/machine/activity/jackpot.js +0 -1
  42. package/src/machine/activity/otp_verified_activity.js +0 -1
  43. package/src/machine/activity/ranking_activity.js +0 -1
  44. package/src/machine/activity/roulette_activity_v2.js +0 -1
  45. package/src/machine/activity/sign_in_activity.js +0 -1
  46. package/src/machine/activity/sign_in_monthly_activity.js +1 -2
  47. package/src/machine/activity/specify_bets_activity.js +0 -1
  48. package/src/machine/activity/specify_turnover_activity.js +0 -1
  49. package/src/machine/activity/time_bomb_activity.js +0 -1
  50. package/src/machine/activity/vip_card_activity.js +0 -1
  51. package/src/machine/auth.js +112 -112
  52. package/src/machine/auth_otp_v3.js +11 -8
  53. package/src/machine/bank_binding.js +2 -3
  54. package/src/machine/common.js +14 -98
  55. package/src/machine/deposit/crypto_bank_cash.js +20 -35
  56. package/src/machine/deposit/crypto_qrcode_cash.js +26 -64
  57. package/src/machine/deposit/crypto_way_cash.js +48 -37
  58. package/src/machine/deposit/direct_cash.js +8 -10
  59. package/src/machine/deposit/index.js +0 -28
  60. package/src/machine/deposit/loadcard_cash.js +14 -32
  61. package/src/machine/deposit/manual_cash.js +8 -11
  62. package/src/machine/deposit/qrcode_cash.js +15 -32
  63. package/src/machine/deposit/usdt_cash.js +1 -15
  64. package/src/machine/deposit/virtual_bank_cash.js +13 -12
  65. package/src/machine/error.js +7 -1
  66. package/src/machine/game_betslip.js +0 -1
  67. package/src/machine/game_favorite_v2.js +0 -1
  68. package/src/machine/game_info.js +1 -13
  69. package/src/machine/game_search_cash.js +0 -1
  70. package/src/machine/game_v2_1.js +39 -126
  71. package/src/machine/honor_board_cash.js +8 -11
  72. package/src/machine/inbox.js +43 -105
  73. package/src/machine/index.js +0 -32
  74. package/src/machine/leaderboard.js +8 -12
  75. package/src/machine/navbar.js +1 -3
  76. package/src/machine/ranking.js +45 -30
  77. package/src/machine/reward_cash.js +0 -40
  78. package/src/machine/roulette_v2.js +14 -11
  79. package/src/machine/setting.js +0 -1
  80. package/src/machine/side_cash.js +3 -3
  81. package/src/machine/user_info.js +0 -1
  82. package/src/machine/user_photo.js +0 -1
  83. package/src/machine/user_reset_password.js +0 -14
  84. package/src/machine/user_sign_up.js +46 -61
  85. package/src/machine/websocket.js +18 -62
  86. package/src/machine/withdraw/index.js +0 -6
  87. package/src/machine/withdraw/withdraw_manual_cash.js +59 -39
  88. package/src/request/config.js +2 -0
  89. package/src/request/request.js +49 -60
  90. package/src/util/amount.js +8 -0
  91. package/src/util/constant.js +0 -1
  92. package/src/util/err998SentryExtra.js +26 -0
  93. package/src/util/index.js +2 -4
  94. package/src/util/paramStore.js +139 -0
  95. package/src/util/storage.js +3 -4
  96. package/BREAKING_CHANGES.md +0 -9
  97. package/resetGitBranch.sh +0 -101
  98. package/src/lib/fingerprint_v3_11_12.js +0 -11433
  99. package/src/machine/activity/activity.js +0 -213
  100. package/src/machine/activity/diamond_shop_activity_fc.js +0 -197
  101. package/src/machine/activity/diamond_shop_activity_vn.js +0 -179
  102. package/src/machine/activity/invite_friends_activity.js +0 -115
  103. package/src/machine/activity/mini_game_activity.js +0 -69
  104. package/src/machine/activity/return_bonus_activity.js +0 -155
  105. package/src/machine/auth_otp_v2.js +0 -178
  106. package/src/machine/bank_binding_amb.js +0 -146
  107. package/src/machine/bonus.js +0 -76
  108. package/src/machine/deposit/amb.js +0 -93
  109. package/src/machine/deposit/crypto_bank.js +0 -340
  110. package/src/machine/deposit/crypto_qrcode.js +0 -158
  111. package/src/machine/deposit/crypto_way.js +0 -253
  112. package/src/machine/deposit/deposit_fc.js +0 -272
  113. package/src/machine/deposit/direct.js +0 -311
  114. package/src/machine/deposit/float.js +0 -375
  115. package/src/machine/deposit/krway.js +0 -152
  116. package/src/machine/deposit/loadcard_vn.js +0 -352
  117. package/src/machine/deposit/manual_vn.js +0 -459
  118. package/src/machine/deposit/qrcode_v2.js +0 -339
  119. package/src/machine/deposit/usdt.js +0 -163
  120. package/src/machine/deposit/virtual_bank_vn.js +0 -270
  121. package/src/machine/deposit/vpay.js +0 -374
  122. package/src/machine/game_hot_new.js +0 -80
  123. package/src/machine/game_replay.js +0 -47
  124. package/src/machine/game_search_v2.js +0 -402
  125. package/src/machine/honor_board.js +0 -133
  126. package/src/machine/merge.js +0 -58
  127. package/src/machine/payment_data.js +0 -87
  128. package/src/machine/promotions.js +0 -163
  129. package/src/machine/reward.js +0 -256
  130. package/src/machine/reward_fc.js +0 -99
  131. package/src/machine/side.js +0 -160
  132. package/src/machine/side_v2.js +0 -223
  133. package/src/machine/vip_table.js +0 -58
  134. package/src/machine/welcome.js +0 -111
  135. package/src/machine/withdraw/withdraw_crypto_cash.js +0 -328
  136. package/src/machine/withdraw/withdraw_krway.js +0 -223
  137. package/src/machine/withdraw/withdraw_manual.js +0 -541
  138. package/src/util/deviceToken.js +0 -60
  139. package/src/util/math.js +0 -4
  140. package/test/api.behavior.test.js +0 -69
  141. package/test/api.contract.test.js +0 -18
  142. package/test/config.test.js +0 -27
  143. package/test/deviceToken.test.js +0 -139
  144. package/test/helpers.coverage.test.js +0 -11
  145. package/test/helpers.js +0 -91
  146. package/test/index.exports.test.js +0 -14
  147. package/test/machine.activity.core.coverage.test.js +0 -337
  148. package/test/machine.activity.gap.coverage.test.js +0 -252
  149. package/test/machine.activity.more.coverage.test.js +0 -180
  150. package/test/machine.activity_plus_and_binding_amb.coverage.test.js +0 -201
  151. package/test/machine.activity_timer_bonus.coverage.test.js +0 -136
  152. package/test/machine.activity_welcome.low.coverage.test.js +0 -211
  153. package/test/machine.amb_rewardfc_websocket.more.coverage.test.js +0 -201
  154. package/test/machine.auth.coverage.test.js +0 -215
  155. package/test/machine.bank_binding.test.js +0 -143
  156. package/test/machine.binding_otp_krway.coverage.test.js +0 -223
  157. package/test/machine.contract.test.js +0 -50
  158. package/test/machine.crypto_bank.coverage.test.js +0 -270
  159. package/test/machine.crypto_way.coverage.test.js +0 -108
  160. package/test/machine.crypto_way_cash.coverage.test.js +0 -114
  161. package/test/machine.definition.test.js +0 -137
  162. package/test/machine.deposit.manual.coverage.test.js +0 -365
  163. package/test/machine.deposit_fc.coverage.test.js +0 -126
  164. package/test/machine.direct.coverage.test.js +0 -96
  165. package/test/machine.direct_cash.coverage.test.js +0 -108
  166. package/test/machine.error.coverage.test.js +0 -37
  167. package/test/machine.events.test.js +0 -126
  168. package/test/machine.favorite_jackpot.coverage.test.js +0 -82
  169. package/test/machine.float.coverage.test.js +0 -136
  170. package/test/machine.flow.test.js +0 -226
  171. package/test/machine.game_hot_new_vip_table.coverage.test.js +0 -105
  172. package/test/machine.game_search_cash.coverage.test.js +0 -155
  173. package/test/machine.game_search_v2.test.js +0 -199
  174. package/test/machine.game_user_profile.coverage.test.js +0 -100
  175. package/test/machine.honor_board.test.js +0 -133
  176. package/test/machine.inbox.common.coverage.test.js +0 -304
  177. package/test/machine.loadcard_cash.coverage.test.js +0 -101
  178. package/test/machine.loadcard_vn.coverage.test.js +0 -122
  179. package/test/machine.misc.coverage.test.js +0 -361
  180. package/test/machine.more2.coverage.test.js +0 -261
  181. package/test/machine.options.execution.test.js +0 -272
  182. package/test/machine.priority.coverage.test.js +0 -603
  183. package/test/machine.qrcode_cash.coverage.test.js +0 -107
  184. package/test/machine.qrcode_v2.coverage.test.js +0 -121
  185. package/test/machine.regression.test.js +0 -82
  186. package/test/machine.roulette_v2.test.js +0 -142
  187. package/test/machine.side_reward_reset.coverage.test.js +0 -220
  188. package/test/machine.targeted.coverage.test.js +0 -313
  189. package/test/machine.usdt.coverage.test.js +0 -95
  190. package/test/machine.usdt_cash.coverage.test.js +0 -73
  191. package/test/machine.vip_card_activity.test.js +0 -114
  192. package/test/machine.virtual_bank_cash.coverage.test.js +0 -105
  193. package/test/machine.virtual_bank_vn.coverage.test.js +0 -105
  194. package/test/machine.vpay.coverage.test.js +0 -142
  195. package/test/machine.withdraw_crypto_cash.coverage.test.js +0 -166
  196. package/test/machine.withdraw_krway.coverage.test.js +0 -123
  197. package/test/machine.withdraw_manual.coverage.test.js +0 -185
  198. package/test/machine.withdraw_manual_cash.coverage.test.js +0 -123
  199. package/test/request.test.js +0 -325
  200. package/test/util.storage.errors.test.js +0 -47
  201. package/test/util.test.js +0 -41
@@ -0,0 +1,29 @@
1
+ // 自動推送 commit + tag 並發布到 npm
2
+ // 由 auto-version.sh 呼叫,接收參數:remote(遠端名稱)、branch(分支名稱)
3
+
4
+ import { execSync } from 'node:child_process'
5
+ import { readFileSync } from 'node:fs'
6
+
7
+ // 取得遠端名稱與分支名稱(預設為 origin 和當前分支)
8
+ const remote = process.argv[2] || 'origin'
9
+ const branch = process.argv[3] || execSync('git rev-parse --abbrev-ref HEAD', { encoding: 'utf8' }).trim()
10
+
11
+ // 讀取 package.json 中的版號(此時已被 standard-version 更新過)
12
+ const { version } = JSON.parse(readFileSync('package.json', 'utf8'))
13
+
14
+ console.log(`Branch: ${branch}`)
15
+ console.log(`Version: ${version}`)
16
+
17
+ // 推送 commit 與 tag 到遠端(--no-verify 避免觸發 pre-push hook 造成無限迴圈)
18
+ execSync(`git push --no-verify --follow-tags ${remote} ${branch}`, { stdio: 'inherit' })
19
+
20
+ // 發布到 npm,使用分支名稱作為 dist-tag(例如 npm install @jetthai/cuora@dev)
21
+ try {
22
+ execSync(`npm publish --tag ${branch}`, { stdio: 'inherit' })
23
+ console.log(`✅ npm publish succeeded: ${version} (tag: ${branch})`)
24
+ } catch {
25
+ console.error(`❌ npm publish failed for ${version}. Please run "npm publish --tag ${branch}" manually.`)
26
+ process.exit(1)
27
+ }
28
+
29
+ console.log(`Released ${version} on ${branch}`)
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env sh
2
+
3
+ # 檢查 package.json 的 version 是否符合 X.Y.Z 規範
4
+ # 不符合則回退到 master 上最近一個符合規範的 tag (vX.Y.Z) 對應版號,並自動 commit
5
+ # 找不到合規 tag 則 exit 1 中止流程
6
+
7
+ PATTERN="^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"
8
+ TAG_PATTERN="^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"
9
+
10
+ CURRENT_VERSION=$(node -p "require('./package.json').version")
11
+
12
+ if echo "$CURRENT_VERSION" | grep -Eq "$PATTERN"; then
13
+ echo "Version $CURRENT_VERSION is valid, skipping."
14
+ exit 0
15
+ fi
16
+
17
+ echo "Invalid version detected: $CURRENT_VERSION"
18
+
19
+ # 從 HEAD 可達的 tag 中,依 commit 時間找最近一個符合 vX.Y.Z 的 tag
20
+ LATEST_TAG=$(git tag -l 'v*' --merged HEAD --sort=-committerdate | grep -E "$TAG_PATTERN" | head -1)
21
+
22
+ if [ -z "$LATEST_TAG" ]; then
23
+ echo "ERROR: No valid vX.Y.Z tag found on current history. Aborting." >&2
24
+ exit 1
25
+ fi
26
+
27
+ FALLBACK_VERSION=${LATEST_TAG#v}
28
+ echo "Reverting version to latest valid tag: $LATEST_TAG ($FALLBACK_VERSION)"
29
+
30
+ npm pkg set version="$FALLBACK_VERSION"
31
+
32
+ git add package.json
33
+ git commit --no-verify -m "chore: revert invalid version to $FALLBACK_VERSION"
34
+
35
+ echo "Version reverted and committed. Re-run your push."
36
+ exit 1
@@ -0,0 +1,84 @@
1
+ #!/usr/bin/env sh
2
+
3
+ # 刪除不符合規範格式的本地與遠端 tag
4
+ # 規範格式:v1.2.3(例如 v0.1.0、v1.12.123)
5
+ #
6
+ # 不符合規範 tag 的刪除規則:
7
+ # 1. commit 不屬於任何分支 → 刪除(remote + local)
8
+ # 2. commit 存在於 origin/master → 刪除(remote + local)
9
+ # 3. commit 在 dev 或 qa 分支上 → 僅保留版本最新的一個,其餘刪除
10
+ # 4. commit 在其他分支上 → 跳過保留
11
+ PATTERN="^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"
12
+
13
+ # 確保遠端 ref 為最新,避免本地 master 落後造成誤判
14
+ git fetch origin --prune --tags
15
+
16
+ # 刪除遠端 tag;若遠端本來就不存在則視為成功,其他失敗回傳非零並輸出錯誤訊息
17
+ delete_remote_tag() {
18
+ TAG=$1
19
+ ERR=$(git push origin --no-verify --delete "$TAG" 2>&1)
20
+ STATUS=$?
21
+ if [ $STATUS -eq 0 ]; then
22
+ return 0
23
+ fi
24
+ # 遠端本來就沒有此 tag → 視為成功
25
+ case "$ERR" in
26
+ *"remote ref does not exist"*|*"unable to delete"*"remote ref does not exist"*)
27
+ return 0
28
+ ;;
29
+ esac
30
+ echo " ⚠ 遠端 tag $TAG 刪除失敗,跳過本地刪除:$ERR" >&2
31
+ return 1
32
+ }
33
+
34
+ # 安全刪除:先刪遠端,遠端成功才刪本地
35
+ safe_delete_tag() {
36
+ TAG=$1
37
+ REASON=$2
38
+ echo "刪除 tag $TAG($REASON)"
39
+ if delete_remote_tag "$TAG"; then
40
+ git tag -d "$TAG"
41
+ fi
42
+ }
43
+
44
+ # 判斷 commit 是否位於 dev 或 qa 分支(含對應遠端分支)
45
+ is_on_dev_or_qa() {
46
+ git branch -a --contains "$1" 2>/dev/null \
47
+ | sed 's/^[* ]*//' \
48
+ | grep -qE '^(remotes/origin/)?(dev|qa)$'
49
+ }
50
+
51
+ TAGS=$(git tag -l | grep -vE "$PATTERN")
52
+ if [ -n "$TAGS" ]; then
53
+ echo "檢查不符合規範的 tag"
54
+
55
+ # 先找出所有 commit 在 dev/qa 且未進 master 的 tag,版本最新的一個予以保留
56
+ KEEP_DEVQA_TAG=$(
57
+ for TAG in $TAGS; do
58
+ TAG_COMMIT=$(git rev-list -n 1 "$TAG" 2>/dev/null)
59
+ [ -z "$TAG_COMMIT" ] && continue
60
+ git merge-base --is-ancestor "$TAG_COMMIT" origin/master 2>/dev/null && continue
61
+ is_on_dev_or_qa "$TAG_COMMIT" && echo "$TAG"
62
+ done | sort -V | tail -n 1
63
+ )
64
+
65
+ for TAG in $TAGS; do
66
+ TAG_COMMIT=$(git rev-list -n 1 "$TAG" 2>/dev/null)
67
+ BRANCHES=$(git branch -a --contains "$TAG_COMMIT" 2>/dev/null)
68
+ if [ -z "$BRANCHES" ]; then
69
+ safe_delete_tag "$TAG" "commit 不屬於任何分支"
70
+ elif git merge-base --is-ancestor "$TAG_COMMIT" origin/master 2>/dev/null; then
71
+ safe_delete_tag "$TAG" "commit 存在於 origin/master"
72
+ elif is_on_dev_or_qa "$TAG_COMMIT"; then
73
+ if [ "$TAG" = "$KEEP_DEVQA_TAG" ]; then
74
+ echo "保留 tag $TAG(dev/qa 最新的一個)"
75
+ else
76
+ safe_delete_tag "$TAG" "dev/qa 僅保留最新的一個 tag"
77
+ fi
78
+ else
79
+ echo "跳過 tag $TAG(commit 在其他分支上)"
80
+ fi
81
+ done
82
+ else
83
+ echo "未發現不符合規範的 tag"
84
+ fi
@@ -2,7 +2,6 @@ export default {
2
2
  bindingStatus: () => ({ url: 'account-binding/status', method: 'GET' }),
3
3
  applyBinding: (data) => ({ url: 'account-binding/bind', method: 'POST', params: data }),
4
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
5
  bindPassword: (data) => ({ url: 'account-binding/bind-password', method: 'POST', params: data }),
7
6
  resetOtp: (data) => ({ url: 'account-binding/reset-otp', method: 'POST', params: data }),
8
7
  }
@@ -18,38 +18,12 @@ export default {
18
18
  params: { appSecret },
19
19
  isPublic: true,
20
20
  }),
21
- getTournamentDetail: ({ activityNo, appSecret }) => ({
22
- url: 'tournament/detail',
23
- method: 'get',
24
- params: { activityNo, appSecret },
25
- isPublic: true,
26
- }),
27
- getActivityDetail: ({ activityNo, appSecret }) => ({
21
+ getActivityDetail: ({ activityNo, appSecret, silent = false }) => ({
28
22
  url: 'activities',
29
23
  method: 'get',
30
24
  params: { activityNo, appSecret },
25
+ silent,
31
26
  }),
32
- getActivityRanking: ({ appSecret }) => ({
33
- url: 'activities/activity/ranking',
34
- method: 'get',
35
- params: { appSecret },
36
- isPublic: true,
37
- }),
38
- getAchievements: ({ limit, page, appSecret }) => ({
39
- url: 'activities/achievements',
40
- method: 'get',
41
- params: {
42
- limit,
43
- page,
44
- appSecret,
45
- },
46
- }),
47
- getAchievementsProgress: ({ achievementNo, appSecret }) => ({
48
- url: 'activities/achievements/progress',
49
- method: 'get',
50
- params: { achievementNo, appSecret },
51
- }),
52
- getAchievementsIssued: () => ({ url: 'activities/achievements/issue', method: 'get' }),
53
27
  postPromoCode: (promoCode) => ({
54
28
  url: 'activities/promo',
55
29
  method: 'post',
@@ -84,16 +58,13 @@ export default {
84
58
  settleAmount: (data) => ({ url: 'activities/exchange/diamond/settle', method: 'post', params: data }),
85
59
  exchange: (data) => ({ url: 'activities/exchange', method: 'post', params: data }),
86
60
  collect: (data) => ({ url: 'activities/collect', method: 'post', params: data }),
87
- getVipTable: ({ appSecret }) => ({ url: 'activities/viptable', method: 'get', params: { appSecret } }),
88
61
  getLevelBonusInfo: () => ({ url: 'activities/level-bonus/info', method: 'get' }),
89
62
  getRankingList: () => ({ url: 'activities/ranking', method: 'get' }),
90
- exchangeDiamond: ({ activityNo, exchangeAward = [] }) => ({
91
- url: 'activities/exchange/diamond',
92
- method: 'post',
93
- params: {
94
- activityNo,
95
- exchangeAward,
96
- },
63
+ getPublicRankingList: ({ appSecret }) => ({
64
+ url: 'activities/ranking/public/promotion-ranking',
65
+ method: 'get',
66
+ isPublic: true,
67
+ params: { appSecret },
97
68
  }),
98
69
  getHonorBroadcast: ({ isPwa = false, appSecret }) => ({
99
70
  url: 'activities/honorBroadcast',
@@ -101,7 +72,6 @@ export default {
101
72
  params: { isPwa, appSecret },
102
73
  isPublic: true,
103
74
  }),
104
- getInstantRebateCollectTime: () => ({ url: 'activities/rebate/collectTime', method: 'get' }),
105
75
  instantRebateEstimate: () => ({ url: 'activities/rebate/estimate', method: 'get' }),
106
76
  instantRebateCollect: () => ({ url: 'activities/rebate/collect', method: 'get' }),
107
77
  instantRebateHistory: ({ startDate, endDate, appSecret }) => ({
@@ -114,4 +84,19 @@ export default {
114
84
  method: 'post',
115
85
  params: { startDate, endDate, appSecret },
116
86
  }),
87
+ getMissionHistory: ({ activityNo, appSecret }) => ({
88
+ url: 'activities/mission-history',
89
+ method: 'get',
90
+ params: { activityNo, appSecret },
91
+ }),
92
+ getProgressSummary: ({ appSecret }) => ({
93
+ url: 'activities/progress-summary',
94
+ method: 'get',
95
+ params: { appSecret },
96
+ }),
97
+ getProgressDetail: ({ appSecret, locale }) => ({
98
+ url: 'activities/progress-details',
99
+ method: 'get',
100
+ params: { appSecret, locale },
101
+ }),
117
102
  }
package/src/api/auth.js CHANGED
@@ -1,38 +1,14 @@
1
- import pickBy from 'lodash/pickBy.js'
1
+ import pickBy from 'lodash/pickBy'
2
2
  export default {
3
- guestLogin: () => ({
4
- url: 'guestLogin',
5
- method: 'post',
6
- isPublic: true,
7
- }),
8
- login: ({ username, password, provider, countryCode, phone, email, dt, reCaptchaToken, additionalUserInfo, loginType, isSignature }) => ({
3
+ login: ({ username, password, provider, countryCode, phone, email, dt, reCaptchaToken, additionalUserInfo, loginType, isSignature, idToken }) => ({
9
4
  url: 'login',
10
5
  method: 'post',
11
- params: { username, password, provider, countryCode, phone, email, dt, additionalUserInfo, loginType, isSignature },
6
+ params: { username, password, provider, countryCode, phone, email, dt, additionalUserInfo, loginType, isSignature, idToken },
12
7
  isPublic: true,
13
8
  headers: { 'x-access-captcha': reCaptchaToken },
14
9
  }),
15
- loginApp: ({ provider, accessToken, channel, subchannel, dt, from, id, name, picture }) => ({
16
- url: 'appLogin',
17
- method: 'post',
18
- params: {
19
- provider,
20
- data: {
21
- accessToken,
22
- channel,
23
- subchannel,
24
- dt,
25
- from,
26
- id,
27
- name,
28
- picture,
29
- provider,
30
- },
31
- },
32
- isPublic: true,
33
- }),
34
- register: ({ channel, subchannel, ac, fc = null, reCaptchaToken, dt, ...rest }) => {
35
- const params = pickBy({ channel, subchannel, ac, fc }, (value) => {
10
+ register: ({ ac, fc = null, reCaptchaToken, dt, ...rest }) => {
11
+ const params = pickBy({ ac, fc }, (value) => {
36
12
  return value !== undefined && value !== null
37
13
  })
38
14
  const qs = Object.keys(params)
@@ -47,13 +23,6 @@ export default {
47
23
  }
48
24
  },
49
25
  logout: () => ({ url: 'logout', method: 'post' }),
50
- // bindGet for 'google' | 'zalo' | 'facebook'
51
- bindGet: ({ x, provider, redirectURI }) => ({ url: 'bind', method: 'get', params: { x, provider, redirectURI } }),
52
- bindPost: ({ provider, countryCode, phone, email }) => ({
53
- url: 'bind',
54
- method: 'post',
55
- params: { provider, countryCode, phone, email },
56
- }),
57
26
  checkAccount: ({ account, nick_name, strategy, appSecret }) => ({
58
27
  url: 'checkAccount',
59
28
  method: 'post',
package/src/api/common.js CHANGED
@@ -2,14 +2,16 @@ export default {
2
2
  getConfig: ({ appSecret }) => ({ url: 'getConfig', method: 'get', params: { appSecret }, isPublic: true }),
3
3
  getLayoutConfig: ({ appSecret }) => ({ url: 'getQuickLayout', method: 'get', params: { appSecret }, isPublic: true }),
4
4
  feeds: ({ appSecret }) => ({ url: 'feeds', method: 'get', params: { appSecret }, isPublic: true }),
5
- broadcast: ({ appSecret } = {}) => ({ url: 'broadcast', method: 'get', params: { appSecret }, isPublic: true }),
5
+ broadcast: ({ appSecret }) => ({ url: 'broadcast', method: 'get', params: { appSecret }, isPublic: true }),
6
6
  getAnnouncements: ({ appSecret }) => ({ url: 'getAnnouncements', params: { appSecret }, method: 'get', isPublic: true }),
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, eventSourceUrl }) => ({
10
+ // pixelClickId / pixelId / geemeeEid / geemeeData 為 GeeMee 歸因與前台事件選填欄位;
11
+ // 未帶時為 undefined,request 層 pickBy(isValid) 會自動剔除,舊呼叫端行為不變。
12
+ sendPixel: ({ appSecret, eventId, fbc, fbp, event, eventSourceUrl, pixelClickId, pixelId, geemeeEid, geemeeData }) => ({
11
13
  url: 'pixel',
12
14
  method: 'post',
13
- params: { appSecret, eventId, fbc, fbp, event, eventSourceUrl },
15
+ params: { appSecret, eventId, fbc, fbp, event, eventSourceUrl, pixelClickId, pixelId, geemeeEid, geemeeData },
14
16
  }),
15
17
  }
package/src/api/game.js CHANGED
@@ -1,8 +1,4 @@
1
1
  export default {
2
- getGameCategory: ({ id, first } = {}) => ({ method: 'get', url: 'game/list/v2/category', params: { id, first } }),
3
- addFavoriteGame: (code) => ({ method: 'post', url: 'game/myfavorite/add', params: { games: [code] } }),
4
- removeFavoriteGame: (code) => ({ method: 'post', url: 'game/myfavorite/remove', params: { games: [code] } }),
5
- getStatements: () => ({ url: 'game/statements', method: 'get' }),
6
2
  playGame: (params) => ({ url: 'game/play', method: 'get', params }),
7
3
  demoGame: (params) => ({ url: 'game/demo', method: 'get', params, isPublic: true }),
8
4
  logoutGame: ({ uid_site, provider_id }) => ({ url: 'game/logout', method: 'get', params: { uid_site, provider_id } }),
@@ -90,12 +86,6 @@ export default {
90
86
  addListFavorite: (code) => ({ method: 'post', url: 'game/list/v3/addMyFavorite', params: { games: [code] } }),
91
87
  removeListFavorite: (code) => ({ method: 'post', url: 'game/list/v3/removeMyFavorite', params: { games: [code] } }),
92
88
  getGameInfo: ({ appSecret, gameCode }) => ({ method: 'get', url: 'game/info', params: { appSecret, gameCode } }),
93
- getGameReplayInfo: ({ providerId, seqNo, lang, appSecret }) => ({
94
- method: 'get',
95
- url: 'game/gameReplay',
96
- params: { providerId, seqNo, lang, appSecret },
97
- isPublic: true,
98
- }),
99
89
  getFreeGameList: () => ({ method: 'get', url: 'activities/getFreeGameRewardList' }),
100
90
  getFreeGameReward: ({ activityNo, receiveNo }) => ({ method: 'post', url: 'activities/getFreeGameReward', params: { activityNo, receiveNo } }),
101
91
  getV3GameInfo: ({ appSecret, gameCodes }) => ({ method: 'post', url: 'game/list/v3/gameInfo', params: { appSecret, gameCodes } }),
@@ -1,13 +1,11 @@
1
1
  export default {
2
- getPaymentHistory: (returnDays) => ({ url: 'payment/v2/history', method: 'post', params: { returnDays } }),
3
- getSpotMarket: () => ({ url: 'payment/v2/spotmarket', method: 'get' }),
4
2
  getTransactionHistory: (payload) => ({
5
3
  url: 'payment/v2/transactionHistory',
6
4
  method: 'post',
7
5
  params: { ...payload },
8
6
  }),
9
7
  getTransactionHistoryOptions: () => ({ url: 'payment/v2/category/options', method: 'get' }),
10
- getPaymentInfo: () => ({ url: `payment/v2/paymentInfo`, method: 'get' }),
8
+ getPaymentInfo: () => ({ url: `payment/v2/paymentInfo`, method: 'get' }), // 棄用
11
9
  getBindingPaymentInfo: () => ({ url: `payment/v2/getBindingPaymentInfo`, method: 'get' }),
12
10
  updatePaymentInfo: ({
13
11
  bankCode,
@@ -58,19 +56,8 @@ export default {
58
56
  }),
59
57
  getBankList: (paymentMethod) => ({ url: `payment/v2/${paymentMethod}/getBankList`, method: 'get' }),
60
58
  getBindingBankList: ({ appSecret }) => ({ url: 'payment/v2/getBindingBankList', method: 'get', params: { appSecret }, isPublic: true }),
61
- getBindingPaymentList: ({ appSecret }) => ({ url: 'payment/v2/getBindingPaymentList', method: 'get', params: { appSecret }, isPublic: true }),
62
- getWithdrawBankList: () => ({ url: 'payment/v2/getWithdrawBankList', method: 'get' }),
63
- makeTransaction: ({ type, payload, paymentMethod }) => ({
64
- url: `payment/v2/${paymentMethod}/transaction`,
65
- method: 'post',
66
- params: {
67
- transferType: type,
68
- ...payload,
69
- },
70
- }),
71
- checkTransaction: (paymentMethod) => ({ url: `payment/v2/${paymentMethod}/checkTransaction`, method: 'post' }),
59
+ getBindingPaymentList: ({ appSecret }) => ({ url: 'payment/v2/getBindingPaymentList', method: 'get', params: { appSecret } }),
72
60
  setBonusSetting: ({ bonus }) => ({ url: 'payment/v2/setting', method: 'post', params: { bonus } }),
73
- getCurrentWithdrawRule: () => ({ url: 'payment/v2/getCurrentWithdrawRule', method: 'get' }),
74
61
  getDoubleWalletWithdrawRule: ({ walletType }) => ({
75
62
  url: 'payment/v2/withdrawRule',
76
63
  method: 'post',
@@ -81,7 +68,6 @@ export default {
81
68
  method: 'post',
82
69
  params: { exchangeType, cryptoNetwork, targetAddress },
83
70
  }),
84
- mergeWallet: () => ({ url: 'payment/v2/mergeWallet', method: 'post' }),
85
71
  getPaymentDetail: ({ transferType } = {}) => ({
86
72
  url: 'payment/v2/paymentDetail',
87
73
  method: 'post',
@@ -102,11 +88,6 @@ export default {
102
88
  method: 'post',
103
89
  params: { transferType: 'WITHDRAW', amount, cryptoCurrency, promotionsNo },
104
90
  }),
105
- getWithdrawExpectedResult: ({ method, amount, cryptoNetwork }) => ({
106
- url: `payment/v2/${method}/expected/result`,
107
- method: 'post',
108
- params: { transferType: 'WITHDRAW', amount, cryptoNetwork },
109
- }),
110
91
  submitDepositTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, sourceAddress, promotionsNo, receipt }) => ({
111
92
  url: `payment/v2/${method}/transaction`,
112
93
  method: 'post',
@@ -176,12 +157,12 @@ export default {
176
157
  params: { transferType: 'DEPOSIT', amount, promotionsNo },
177
158
  }),
178
159
  submitWithdrawTransactionCrypto: ({ method, amount, cryptoCurrency, cryptoNetwork, targetAddress, applyerHolderName }) => ({
179
- url: `payment/v2/${method}/transaction`,
160
+ url: `/payment/v2/${method}/withdraw-otp/verify`,
180
161
  method: 'post',
181
162
  params: { transferType: 'WITHDRAW', amount, cryptoCurrency, cryptoNetwork, targetAddress, applyerHolderName },
182
163
  }),
183
164
  submitWithdrawTransactionVN: ({ method, amount, applyerBankCode, applyerAccountNumber, applyerIfscCode, branch, applyerHolderName }) => ({
184
- url: `payment/v2/${method}/transaction`,
165
+ url: `/payment/v2/${method}/withdraw-otp/verify`,
185
166
  method: 'post',
186
167
  params: {
187
168
  transferType: 'WITHDRAW',
@@ -193,38 +174,6 @@ export default {
193
174
  applyerHolderName,
194
175
  },
195
176
  }),
196
- submitWithdrawTransactionManual: ({
197
- method,
198
- amount,
199
- applyerBankCode,
200
- applyerAccountNumber,
201
- applyerIfscCode,
202
- branch,
203
- holderName,
204
- cryptoCurrency,
205
- cryptoNetwork,
206
- targetAddress,
207
- }) => ({
208
- url: `payment/v2/${method}/transaction`,
209
- method: 'post',
210
- params: {
211
- transferType: 'WITHDRAW',
212
- amount,
213
- applyerBankCode,
214
- applyerAccountNumber,
215
- applyerIfscCode,
216
- branch,
217
- holderName,
218
- cryptoCurrency,
219
- cryptoNetwork,
220
- targetAddress,
221
- },
222
- }),
223
- submitWithdrawTransactionAmb: ({ method, amount }) => ({
224
- url: `payment/v2/${method}/transaction`,
225
- method: 'post',
226
- params: { transferType: 'WITHDRAW', amount },
227
- }),
228
177
  getPromotionsList: () => ({ url: `payment/v2/bankWallet/promotions`, method: 'get' }),
229
178
  getWithdrawRulePreview: ({ applyType, applyNo, amount, isFreeGame }) => ({
230
179
  url: `payment/v2/bankWallet/promotion/preview`,
@@ -247,4 +196,17 @@ export default {
247
196
  withdrawCheck: () => ({ url: `payment/v2/withdrawCheck`, method: 'post' }),
248
197
  updateUtr: ({ applyId, utr }) => ({ url: 'payment/v2/updateUtr', method: 'post', params: { applyId, utr } }),
249
198
  uploadCommonSlip: ({ applyId, slip }) => ({ url: 'payment/v2/uploadCommonSlip', method: 'post', params: { applyId, slip } }),
199
+ otpAcknowledge: ({ method, requestId, code }) => ({
200
+ url: `/payment/v2/${method}/withdraw-otp/acknowledge`,
201
+ method: 'post',
202
+ params: { requestId, code },
203
+ isPublic: true,
204
+ }),
205
+ otpReset: ({ method, requestId }) => ({
206
+ url: `/payment/v2/${method}/withdraw-otp/reset-otp`,
207
+ method: 'post',
208
+ params: { requestId },
209
+ isPublic: true,
210
+ }),
211
+ getPaymentPromotions: () => ({ url: 'payment/v2/promotions', method: 'get' }),
250
212
  }
package/src/api/user.js CHANGED
@@ -1,26 +1,16 @@
1
- export const PASSWORD_RESET_INIT = 'otp-verifying'
2
- export const PASSWORD_RESET_ALLOW = 'allow-change-password'
3
-
4
1
  export default {
5
2
  checkDt: () => ({ url: 'checkDt', method: 'get' }),
6
3
  updateDt: (data) => ({ url: 'updateDt', method: 'post', params: data }),
7
4
  getUserInfo: () => ({ url: 'self', method: 'get' }),
8
5
  updateUserInfo: (data) => ({ url: 'self', method: 'post', params: data }),
9
6
  changePassword: (data) => ({ url: 'settings/password', method: 'post', params: data }),
10
- setPreference: ({ defaultCategory }) => ({ url: 'settings/preference', method: 'post', params: { defaultCategory } }),
11
7
  resetOtp: ({ requestId, number }) => ({ url: 'reset', method: 'post', params: { requestId, number } }),
12
- getAffiliate: () => ({ url: 'affiliate', method: 'get' }),
13
- getAffiliateHome: () => ({ url: 'affiliate/home', method: 'get' }),
14
- getAffiliateDashboard: () => ({ url: 'affiliate/dashboard', method: 'get' }),
15
- getAffiliateDashboardList: ({ level, page, row }) => ({ url: 'affiliate/dashboard/list', method: 'post', params: { level, page, row } }),
16
- postAffiliate: ({ affiliateCode }) => ({ url: 'affiliate', method: 'post', params: { affiliateCode } }),
17
8
  getFriends: () => ({ url: 'friends', method: 'get' }),
18
9
  getFriendsHome: () => ({ url: 'friends/home', method: 'get' }),
19
10
  getFriendsDashboard: () => ({ url: 'friends/dashboard', method: 'get' }),
20
11
  getFriendsDashboardList: ({ level, page, row }) => ({ url: 'friends/dashboard/list', method: 'post', params: { level, page, row } }),
21
12
  getFriendsList: ({ type, page, row }) => ({ url: 'friends/reward-list', method: 'post', params: { type, page, row } }),
22
13
  postFriends: ({ friendCode }) => ({ url: 'friends', method: 'post', params: { friendCode } }),
23
- passwordRecovery: (recoveryData) => ({ url: 'recovery', method: 'post', params: recoveryData, isPublic: true }),
24
14
  // passwordAbandon: ({ number }) => ({ url: 'recovery/abandon', method: 'post', params: { number }, isPublic: true }), 平台版和現金網未使用
25
15
  // passwordAcknowledge: (acknowledgeData) => ({ url: 'recovery/acknowledge', method: 'post', params: acknowledgeData, isPublic: true }), 平台版和現金網未使用
26
16
  verify: () => ({ url: 'verify', method: 'post' }),
@@ -50,12 +40,6 @@ export default {
50
40
  params: { requestId, target, newPassword, appSecret },
51
41
  isPublic: true,
52
42
  }),
53
- verifyV2Initiate: ({ strategy }) => ({
54
- // strategy: 'phone' | 'email'
55
- url: '/verify/v2/initiate',
56
- method: 'post',
57
- params: { strategy },
58
- }),
59
43
  otpAcknowledge: ({ requestId, target, code }) => ({
60
44
  url: '/otpsso/acknowledge',
61
45
  method: 'post',
@@ -66,4 +50,14 @@ export default {
66
50
  getUserPhotoList: () => ({ url: 'getAllAvatar', method: 'get' }),
67
51
  updateUserPhoto: (data) => ({ url: 'updateUserAvatar', method: 'post', params: data }),
68
52
  getUserProfile: () => ({ url: 'user-info/get-profile', method: 'get' }),
53
+ subscribeStatus: ({ deviceTokenId, domain }) => ({
54
+ url: 'notification-subscription/status',
55
+ method: 'post',
56
+ params: { deviceTokenId, domain },
57
+ }),
58
+ subscribeUpdate: ({ deviceTokenId, domain, action = 'subscribe' }) => ({
59
+ url: 'notification-subscription/update',
60
+ method: 'post',
61
+ params: { deviceTokenId, domain, action },
62
+ }),
69
63
  }
package/src/index.js CHANGED
@@ -2,6 +2,6 @@ import api from './api/index.js'
2
2
  import machine from './machine/index.js'
3
3
  import Request from './request/request.js'
4
4
  import Config from './request/config.js'
5
- import util, { constant, storage } from './util/index.js'
5
+ import { constant, storage, paramStore } from './util/index.js'
6
6
 
7
- export { api, machine, Request, Config, util, constant, storage }
7
+ export { api, machine, Request, Config, constant, storage, paramStore }