@jetthai/cuora 1.1.471 → 1.1.472-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.
Files changed (84) hide show
  1. package/.claude/commands/sync-ai-prompts.md +88 -1
  2. package/.claude/settings.local.json +3 -1
  3. package/.github/copilot-instructions.md +64 -57
  4. package/.husky/post-checkout +3 -3
  5. package/.husky/pre-push +1 -1
  6. package/.prettierignore +2 -1
  7. package/AGENTS.md +64 -57
  8. package/AI_PROMPT_SOURCE.md +64 -57
  9. package/CHANGELOG.md +194 -6
  10. package/CLAUDE.md +64 -57
  11. package/GEMINI.md +64 -57
  12. package/README.md +11 -12
  13. package/package.json +1 -1
  14. package/scripts/auto-version.js +1 -0
  15. package/scripts/branch-auto-npm-publish.js +9 -2
  16. package/src/api/account.js +0 -1
  17. package/src/api/activity.js +2 -38
  18. package/src/api/auth.js +0 -31
  19. package/src/api/game.js +0 -10
  20. package/src/api/payment.js +1 -52
  21. package/src/api/user.js +0 -16
  22. package/src/index.js +2 -2
  23. package/src/machine/activity/activity_cash.js +50 -23
  24. package/src/machine/activity/diamond_shop_activity_cash.js +0 -1
  25. package/src/machine/activity/fafafa_activity.js +0 -10
  26. package/src/machine/activity/index.js +0 -12
  27. package/src/machine/auth.js +4 -60
  28. package/src/machine/auth_otp_v3.js +0 -3
  29. package/src/machine/common.js +0 -55
  30. package/src/machine/deposit/index.js +0 -28
  31. package/src/machine/deposit/manual_cash.js +0 -8
  32. package/src/machine/game_info.js +1 -12
  33. package/src/machine/game_v2_1.js +1 -89
  34. package/src/machine/honor_board_cash.js +15 -18
  35. package/src/machine/inbox.js +0 -12
  36. package/src/machine/index.js +0 -32
  37. package/src/machine/reward_cash.js +0 -39
  38. package/src/machine/user_reset_password.js +0 -13
  39. package/src/machine/user_sign_up.js +3 -0
  40. package/src/machine/websocket.js +0 -4
  41. package/src/machine/withdraw/index.js +0 -6
  42. package/src/request/request.js +1 -29
  43. package/src/util/constant.js +0 -1
  44. package/src/util/index.js +1 -4
  45. package/src/machine/activity/activity.js +0 -209
  46. package/src/machine/activity/diamond_shop_activity_fc.js +0 -196
  47. package/src/machine/activity/diamond_shop_activity_vn.js +0 -178
  48. package/src/machine/activity/invite_friends_activity.js +0 -114
  49. package/src/machine/activity/mini_game_activity.js +0 -68
  50. package/src/machine/activity/return_bonus_activity.js +0 -153
  51. package/src/machine/auth_otp_v2.js +0 -177
  52. package/src/machine/bank_binding_amb.js +0 -146
  53. package/src/machine/bonus.js +0 -76
  54. package/src/machine/deposit/amb.js +0 -93
  55. package/src/machine/deposit/crypto_bank.js +0 -330
  56. package/src/machine/deposit/crypto_qrcode.js +0 -148
  57. package/src/machine/deposit/crypto_way.js +0 -252
  58. package/src/machine/deposit/deposit_fc.js +0 -272
  59. package/src/machine/deposit/direct.js +0 -310
  60. package/src/machine/deposit/float.js +0 -375
  61. package/src/machine/deposit/krway.js +0 -151
  62. package/src/machine/deposit/loadcard_vn.js +0 -351
  63. package/src/machine/deposit/manual_vn.js +0 -458
  64. package/src/machine/deposit/qrcode_v2.js +0 -338
  65. package/src/machine/deposit/usdt.js +0 -144
  66. package/src/machine/deposit/virtual_bank_vn.js +0 -269
  67. package/src/machine/deposit/vpay.js +0 -368
  68. package/src/machine/game_hot_new.js +0 -79
  69. package/src/machine/game_replay.js +0 -46
  70. package/src/machine/game_search_v2.js +0 -401
  71. package/src/machine/honor_board.js +0 -132
  72. package/src/machine/merge.js +0 -57
  73. package/src/machine/payment_data.js +0 -86
  74. package/src/machine/promotions.js +0 -170
  75. package/src/machine/reward.js +0 -255
  76. package/src/machine/reward_fc.js +0 -98
  77. package/src/machine/side.js +0 -154
  78. package/src/machine/side_v2.js +0 -211
  79. package/src/machine/vip_table.js +0 -57
  80. package/src/machine/welcome.js +0 -110
  81. package/src/machine/withdraw/withdraw_crypto_cash.js +0 -327
  82. package/src/machine/withdraw/withdraw_krway.js +0 -223
  83. package/src/machine/withdraw/withdraw_manual.js +0 -536
  84. package/src/util/math.js +0 -4
@@ -1,177 +0,0 @@
1
- import { assign, createMachine } from 'xstate'
2
- import user from '../api/user.js'
3
-
4
- export default function (request) {
5
- return createMachine(
6
- {
7
- id: 'auth_otp_v2',
8
- initial: 'idle',
9
- context: {
10
- strategy: null,
11
- requestId: null,
12
- ttl: null,
13
- target: {},
14
- acknowledgeTtl: null,
15
- newPassword: null,
16
- },
17
- states: {
18
- idle: {
19
- on: {
20
- SET_OTP_INITIALIZATION: {
21
- target: 'otp',
22
- actions: 'setOtpResult',
23
- },
24
- SEND_OTP_EMAIL: {
25
- target: 'otpFetching',
26
- actions: 'setStrategyEmail',
27
- },
28
- SEND_OTP_PHONE: {
29
- target: 'otpFetching',
30
- actions: 'setStrategyPhone',
31
- },
32
- },
33
- },
34
- otpFetching: {
35
- invoke: {
36
- src: 'sendOtp',
37
- onDone: [
38
- {
39
- target: 'acknowledged',
40
- cond: (context, event) => event.data.status === 'success-verified',
41
- },
42
- {
43
- target: 'otp',
44
- actions: 'setOtpResult',
45
- },
46
- ],
47
- onError: {
48
- target: 'idle',
49
- },
50
- },
51
- },
52
- otp: {
53
- after: {
54
- 1000: [
55
- {
56
- target: 'otp',
57
- actions: 'decreaseTtl',
58
- cond: (context) => context.ttl > 0,
59
- },
60
- {
61
- target: 'idle',
62
- },
63
- ],
64
- },
65
- on: {
66
- ACKNOWLEDGE: {
67
- target: 'acknowledging',
68
- },
69
- BACK: {
70
- target: 'idle',
71
- },
72
- RESET_OTP: {
73
- target: 'otpResetting',
74
- },
75
- },
76
- },
77
- otpResetting: {
78
- invoke: {
79
- src: 'resetOtp',
80
- onDone: {
81
- target: 'otp',
82
- actions: 'setOtpResult',
83
- },
84
- onError: {
85
- target: 'otp',
86
- },
87
- },
88
- },
89
- acknowledging: {
90
- invoke: {
91
- src: 'acknowledge',
92
- onDone: {
93
- target: 'acknowledged',
94
- actions: 'setAcknowledgeResult',
95
- },
96
- onError: [
97
- {
98
- target: 'idle',
99
- cond: (context, event) => event.data.code === 'ERR_A108',
100
- },
101
- {
102
- target: 'otp',
103
- },
104
- ],
105
- },
106
- },
107
- acknowledged: {
108
- // after: {
109
- // 1000: [
110
- // {
111
- // target: 'acknowledged',
112
- // actions: 'decreaseAcknowledgeTtl',
113
- // cond: (context) => context.acknowledgeTtl > 0,
114
- // },
115
- // {
116
- // target: 'idle',
117
- // },
118
- // ],
119
- // },
120
- },
121
- },
122
- },
123
- {
124
- actions: {
125
- setStrategyPhone: assign((context, event) => {
126
- return {
127
- strategy: 'phone',
128
- }
129
- }),
130
- setStrategyEmail: assign((context, event) => {
131
- return {
132
- strategy: 'email',
133
- }
134
- }),
135
- setOtpResult: assign((context, event) => {
136
- const { requestId, ttl, target } = event.data
137
- return {
138
- requestId,
139
- ttl,
140
- target,
141
- }
142
- }),
143
- decreaseTtl: assign((context, event) => {
144
- return {
145
- ttl: Math.max(context.ttl - 1, 0),
146
- }
147
- }),
148
- setAcknowledgeResult: assign((context, event) => {
149
- const { requestId, ttl, target } = event.data
150
- return {
151
- acknowledgeTtl: ttl,
152
- }
153
- }),
154
- decreaseAcknowledgeTtl: assign((context, event) => {
155
- return {
156
- acknowledgeTtl: Math.max(context.acknowledgeTtl - 1, 0),
157
- }
158
- }),
159
- },
160
- services: {
161
- sendOtp: async (context, event) => {
162
- const { strategy } = context
163
- return await request.send(user.verifyV2Initiate({ strategy }))
164
- },
165
- resetOtp: async (context, event) => {
166
- const { requestId, target } = context
167
- return await request.send(user.otpReset({ requestId, target }))
168
- },
169
- acknowledge: async (context, event) => {
170
- const { requestId, target } = context
171
- const code = event.data
172
- return await request.send(user.otpAcknowledge({ requestId, target, code }))
173
- },
174
- },
175
- }
176
- )
177
- }
@@ -1,146 +0,0 @@
1
- // 棄用
2
- import { assign, createMachine } from 'xstate'
3
- import payment from '../api/payment.js'
4
-
5
- export default function (request) {
6
- const { appSecret } = request.config
7
-
8
- return createMachine(
9
- {
10
- id: 'bank_binding_amb',
11
- initial: 'fetching',
12
- context: {
13
- hasAnyAccount: false,
14
- bankList: [],
15
- bank: null,
16
- // bonus: 0,
17
- bankAccount: null,
18
- firstNameTh: null,
19
- lastNameTh: null,
20
- firstNameEn: null,
21
- lastNameEn: null,
22
- },
23
- states: {
24
- fetching: {
25
- invoke: {
26
- src: 'fetchInitData',
27
- onDone: {
28
- target: 'idle',
29
- actions: 'setBanks',
30
- },
31
- onError: {
32
- target: 'idle',
33
- },
34
- },
35
- },
36
- idle: {
37
- on: {
38
- SET_BANK_CODE: {
39
- actions: assign((context, event) => {
40
- return {
41
- bank: event.data,
42
- }
43
- }),
44
- },
45
- SET_BANK_ACCOUNT: {
46
- actions: assign((context, event) => {
47
- return {
48
- bankAccount: event.data,
49
- }
50
- }),
51
- },
52
- SET_FIRST_NAME_TH: {
53
- actions: assign((context, event) => {
54
- return {
55
- firstNameTh: event.data,
56
- }
57
- }),
58
- },
59
- SET_LAST_NAME_TH: {
60
- actions: assign((context, event) => {
61
- return {
62
- lastNameTh: event.data,
63
- }
64
- }),
65
- },
66
- SET_FIRST_NAME_EN: {
67
- actions: assign((context, event) => {
68
- return {
69
- firstNameEn: event.data,
70
- }
71
- }),
72
- },
73
- SET_LAST_NAME_EN: {
74
- actions: assign((context, event) => {
75
- return {
76
- lastNameEn: event.data,
77
- }
78
- }),
79
- },
80
- BIND_BANK: {
81
- target: 'binding',
82
- cond: 'isBindable',
83
- },
84
- },
85
- },
86
- binding: {
87
- invoke: {
88
- src: 'updatePaymentInfo',
89
- onDone: {
90
- target: 'bound',
91
- },
92
- onError: {
93
- target: 'idle',
94
- },
95
- },
96
- },
97
- bound: {},
98
- },
99
- },
100
- {
101
- actions: {
102
- setBanks: assign((context, event) => {
103
- const { bankList = [], paymentInfo = {} } = event.data
104
- const { bankInfo = [] } = paymentInfo
105
- return {
106
- hasAnyAccount: bankInfo.length > 0,
107
- holderName: bankInfo[0]?.holderName,
108
- bankList,
109
- bank: bankList[0],
110
- }
111
- }),
112
- },
113
- guards: {
114
- isBindable: (context, event) => {
115
- const { bank, bankAccount, firstNameTh, lastNameTh, firstNameEn, lastNameEn } = context
116
-
117
- return bank.bankCode && bankAccount && firstNameTh && lastNameTh && firstNameEn && lastNameEn
118
- },
119
- },
120
- services: {
121
- fetchInitData: async (context, event) => {
122
- const [bankList, paymentInfo] = await Promise.all([
123
- request.send(payment.getBindingBankList({ appSecret })),
124
- request.send(payment.getPaymentInfo()),
125
- ])
126
- return { bankList, paymentInfo }
127
- },
128
- updatePaymentInfo: async (context, event) => {
129
- const { bonus, bank, bankAccount, firstNameTh, lastNameTh, firstNameEn, lastNameEn } = context
130
- return await request.send(
131
- payment.updatePaymentInfo({
132
- paymentProvider: 'amb',
133
- // bonus,
134
- bankCode: bank.bankCode,
135
- bankAccount,
136
- firstNameTh,
137
- lastNameTh,
138
- firstNameEn,
139
- lastNameEn,
140
- })
141
- )
142
- },
143
- },
144
- }
145
- )
146
- }
@@ -1,76 +0,0 @@
1
- // 棄用
2
- import { assign, createMachine, send } from 'xstate'
3
- import payment from '../api/payment.js'
4
-
5
- export default function (request) {
6
- return createMachine(
7
- {
8
- id: 'bonus',
9
- initial: 'loading',
10
- context: {
11
- bonus: null,
12
- },
13
- states: {
14
- loading: {
15
- invoke: {
16
- src: 'fetchInitData',
17
- onDone: {
18
- target: 'idle',
19
- actions: 'setBonus',
20
- },
21
- onError: {
22
- target: 'idle',
23
- },
24
- },
25
- },
26
- idle: {
27
- on: {
28
- TOGGLE: {
29
- target: 'updating',
30
- },
31
- SWITCH_ON: {
32
- actions: send((context, event) => ({ type: 'TOGGLE', data: 1 })),
33
- cond: (context, event) => context.bonus !== 1,
34
- },
35
- SWITCH_OFF: {
36
- actions: send((context, event) => ({ type: 'TOGGLE', data: 0 })),
37
- cond: (context, event) => context.bonus !== 0,
38
- },
39
- },
40
- },
41
- updating: {
42
- invoke: {
43
- src: 'toggleBonus',
44
- onDone: {
45
- target: 'idle',
46
- actions: 'setBonus',
47
- },
48
- onError: {
49
- target: 'idle',
50
- },
51
- },
52
- },
53
- },
54
- },
55
- {
56
- actions: {
57
- setBonus: assign((context, event) => {
58
- return {
59
- bonus: event.data,
60
- }
61
- }),
62
- },
63
- services: {
64
- fetchInitData: async (context, event) => {
65
- const { bonus } = await request.send(payment.getPaymentInfo())
66
- return bonus
67
- },
68
- toggleBonus: async (context, event) => {
69
- const bonus = context.bonus ? 0 : 1
70
- await request.send(payment.setBonusSetting({ bonus }))
71
- return bonus
72
- },
73
- },
74
- }
75
- )
76
- }
@@ -1,93 +0,0 @@
1
- // 棄用
2
- import { assign, createMachine } from 'xstate'
3
- import payment from '../../api/payment.js'
4
-
5
- export default function (request) {
6
- return createMachine(
7
- {
8
- id: 'amb',
9
- initial: 'loading',
10
- context: {
11
- bankList: [],
12
- userAccount: {},
13
- houseAccountName: null,
14
- houseAccountNumber: null,
15
- houseBankName: null,
16
- method: 'amb',
17
- },
18
- states: {
19
- loading: {
20
- initial: 'checkingUserAccount',
21
- states: {
22
- checkingUserAccount: {
23
- invoke: {
24
- src: 'fetchPaymentInfo',
25
- onDone: [
26
- {
27
- target: 'initializing',
28
- actions: 'setUserAccount',
29
- cond: 'hasUserAccount',
30
- },
31
- { target: '#amb.accountUnbound' },
32
- ],
33
- onError: {
34
- target: '#amb.unavailable',
35
- },
36
- },
37
- },
38
- initializing: {
39
- invoke: {
40
- src: 'initialize',
41
- onDone: { target: '#amb.finish', actions: 'setInitialization' },
42
- onError: {
43
- target: '#amb.unavailable',
44
- },
45
- },
46
- },
47
- },
48
- },
49
- finish: {},
50
- accountUnbound: {},
51
- unavailable: {},
52
- },
53
- },
54
- {
55
- actions: {
56
- setUserAccount: assign((context, event) => {
57
- return {
58
- userAccount: event.data?.[0],
59
- }
60
- }),
61
- setInitialization: assign((context, event) => {
62
- const { houseAccount, bankList } = event.data
63
- return {
64
- houseAccountName: houseAccount.accountName,
65
- houseAccountNumber: houseAccount.accountNumber,
66
- houseBankName: houseAccount.bankName,
67
- bankList: bankList?.data ? bankList.data : bankList,
68
- }
69
- }),
70
- },
71
- guards: {
72
- hasUserAccount: (context, event) => {
73
- return event.data?.[0]
74
- },
75
- },
76
- services: {
77
- fetchPaymentInfo: async (context, event) => {
78
- const { bankInfo } = await request.send(payment.getPaymentInfo())
79
- const filterArray = bankInfo?.filter((item) => item.bindingType !== 'CRYPTO' && item.bindingType !== 'EWALLET')
80
- return filterArray || []
81
- },
82
- initialize: async (context, event) => {
83
- const { method } = context
84
- const [houseAccount, bankList] = await Promise.all([
85
- request.send(payment.submitDepositTransaction({ method })),
86
- request.send(payment.getBankList(method)),
87
- ])
88
- return { houseAccount, bankList }
89
- },
90
- },
91
- }
92
- )
93
- }