@jetthai/cuora 1.1.406-dev-3 → 1.1.406-dev-4

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.406-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.406-dev-3...v1.1.406-dev-4) (2026-01-09)
6
+
5
7
  ### [1.1.406-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.407...v1.1.406-dev-3) (2026-01-08)
6
8
 
7
9
  ### [1.1.406-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.406-dev-1...v1.1.406-dev-2) (2025-12-22)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.406-dev-3",
3
+ "version": "1.1.406-dev-4",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -87,6 +87,12 @@ export default {
87
87
  getVipTable: ({ appSecret }) => ({ url: 'activities/viptable', method: 'get', params: { appSecret } }),
88
88
  getLevelBonusInfo: () => ({ url: 'activities/level-bonus/info', method: 'get' }),
89
89
  getRankingList: () => ({ url: 'activities/ranking', method: 'get' }),
90
+ getPublicRankingList: ({ appSecret }) => ({
91
+ url: 'activities/ranking/public/promotion-ranking',
92
+ method: 'get',
93
+ isPublic: true,
94
+ params: { appSecret },
95
+ }),
90
96
  exchangeDiamond: ({ activityNo, exchangeAward = [] }) => ({
91
97
  url: 'activities/exchange/diamond',
92
98
  method: 'post',
@@ -37,12 +37,13 @@ export default function (request) {
37
37
  checking: {
38
38
  always: [
39
39
  { target: 'idle', actions: 'setActivityDetail', cond: 'isExist' },
40
- { target: 'loading', cond: 'hasActivityNo' },
40
+ { target: 'loading', cond: 'hasActivityNoAndToken' },
41
+ { target: 'idle' },
41
42
  ],
42
43
  },
43
44
  loading: {
44
45
  invoke: {
45
- src: 'fetchPublicActivityDetail',
46
+ src: 'fetchActivityDetail',
46
47
  onDone: {
47
48
  target: 'idle',
48
49
  actions: ['setActivityMap', 'setActivityDetail'],
@@ -100,8 +101,9 @@ export default function (request) {
100
101
  const { activityMap, activityNo } = context
101
102
  return activityMap[activityNo]
102
103
  },
103
- hasActivityNo: (context, event) => {
104
- return !!context.activityNo
104
+ hasActivityNoAndToken: (context, event) => {
105
+ const hasToken = request.getToken()
106
+ return !!context.activityNo && hasToken
105
107
  },
106
108
  },
107
109
  services: {
@@ -116,15 +118,10 @@ export default function (request) {
116
118
  const { data } = await request.send(hasToken ? api.getActivityList({ appSecret }) : api.getAllActivityList({ appSecret }))
117
119
  return data
118
120
  },
119
- fetchPublicActivityDetail: async (context, event) => {
120
- const hasToken = request.getToken()
121
+ fetchActivityDetail: async (context, event) => {
121
122
  const { activityNo } = context
122
123
  let result = {}
123
- if (hasToken) {
124
- result = await request.send(api.getActivityDetail({ activityNo, appSecret }))
125
- } else {
126
- result = await request.send(api.getTournamentDetail({ activityNo, appSecret }))
127
- }
124
+ result = await request.send(api.getActivityDetail({ activityNo, appSecret }))
128
125
  return result.data
129
126
  },
130
127
  },