@jetthai/cuora 1.1.361-dev-2 → 1.1.361-dev-3

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,8 @@
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.361-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.361-dev-2...v1.1.361-dev-3) (2025-06-16)
6
+
5
7
  ### [1.1.361-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.361-dev-1...v1.1.361-dev-2) (2025-06-11)
6
8
 
7
9
  ### [1.1.361-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.361...v1.1.361-dev-1) (2025-06-09)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.361-dev-2",
3
+ "version": "1.1.361-dev-3",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -69,10 +69,10 @@ export default {
69
69
  method: 'get',
70
70
  params: { rewardType },
71
71
  }),
72
- getRewardList: ({ rewardType, count, appSecret, orderColumn }) => ({
72
+ getRewardList: ({ rewardType, count, appSecret, orderColum, lang }) => ({
73
73
  url: 'activities/rewards',
74
74
  method: 'get',
75
- params: { rewardType, count, appSecret, orderColumn },
75
+ params: { rewardType, count, appSecret, orderColum, lang },
76
76
  }),
77
77
  getCashRainReward: ({ activityNo, appSecret }) => ({
78
78
  url: `activities/cashRain`,
@@ -2,7 +2,7 @@ import { createMachine, assign, send } from 'xstate'
2
2
  import activity from '../api/activity.js'
3
3
  import payment from '../api/payment.js'
4
4
 
5
- export default function (request) {
5
+ export default function (request, context) {
6
6
  const { appSecret } = request.config
7
7
  return createMachine(
8
8
  {
@@ -18,6 +18,7 @@ export default function (request) {
18
18
  withdrawRule: {},
19
19
  callback: () => {},
20
20
  orderColumn: 'createTime',
21
+ lang: context.locale || 'en-US',
21
22
  },
22
23
  states: {
23
24
  timer: {
@@ -78,6 +79,9 @@ export default function (request) {
78
79
  target: 'allPointsReceiving',
79
80
  actions: 'setCallback',
80
81
  },
82
+ SET_LANG: {
83
+ actions: 'setLang',
84
+ },
81
85
  },
82
86
  },
83
87
  fetching: {
@@ -201,16 +205,22 @@ export default function (request) {
201
205
  withdrawRule: event.data,
202
206
  }
203
207
  }),
208
+ setLang: assign((context, event) => {
209
+ const lang = event.data.locale || context.lang || 'en-US'
210
+ return { lang }
211
+ }),
204
212
  },
205
213
  services: {
206
214
  fetchRewardList: async (context, event) => {
207
- const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret }))
215
+ const lang = context.lang
216
+ const getRewardAPI = request.send(activity.getRewardList({ count: 30, appSecret, lang }))
208
217
  const orderColumn = context.orderColumn
209
218
  const getPointsRewardAPI = request.send(
210
219
  activity.getRewardList({
211
220
  rewardType: 'POINTS',
212
221
  count: 30,
213
222
  appSecret,
223
+ lang,
214
224
  })
215
225
  )
216
226
  const getOtherRewardAPI = request.send(
@@ -219,6 +229,7 @@ export default function (request) {
219
229
  count: 30,
220
230
  appSecret,
221
231
  orderColumn,
232
+ lang,
222
233
  })
223
234
  )
224
235
  const [otherRewardList, pointsRewardList, rewardList] = await Promise.all([getOtherRewardAPI, getPointsRewardAPI, getRewardAPI])
@@ -233,6 +244,7 @@ export default function (request) {
233
244
  count: 30,
234
245
  appSecret,
235
246
  orderColumn,
247
+ lang,
236
248
  })
237
249
  )
238
250
  const [otherRewardList] = await Promise.all([getOtherRewardAPI])