@jetthai/cuora 1.1.387-dev-1 → 1.1.387-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,10 @@
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.387-dev-3](https://github.com/jetthai/cuora-module/compare/v1.1.387-dev-2...v1.1.387-dev-3) (2025-10-01)
6
+
7
+ ### [1.1.387-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.387-dev-1...v1.1.387-dev-2) (2025-10-01)
8
+
5
9
  ### [1.1.387-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.387-dev...v1.1.387-dev-1) (2025-09-26)
6
10
 
7
11
  ### [1.1.387-dev](https://github.com/jetthai/cuora-module/compare/v1.1.387...v1.1.387-dev) (2025-09-26)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.387-dev-1",
3
+ "version": "1.1.387-dev-3",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
package/src/api/common.js CHANGED
@@ -7,4 +7,10 @@ export default {
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 }) => ({
11
+ url: 'pixel',
12
+ method: 'post',
13
+ params: { appSecret, eventId, fbc, fbp, event },
14
+ isPublic: true,
15
+ }),
10
16
  }
@@ -42,6 +42,7 @@ export default function (request) {
42
42
  defaultAffiliateCode: null,
43
43
  friendCode: null,
44
44
  isPlaying: false,
45
+ isLogin: false,
45
46
  },
46
47
  states: {
47
48
  config: {
@@ -55,7 +56,7 @@ export default function (request) {
55
56
  },
56
57
  },
57
58
  fetching: {
58
- entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel'],
59
+ entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel', 'setFbclid'],
59
60
  invoke: {
60
61
  src: 'fetchConfig',
61
62
  onDone: [
@@ -89,8 +90,20 @@ export default function (request) {
89
90
  },
90
91
  },
91
92
  feed: {
92
- initial: 'updating',
93
+ initial: 'idle',
93
94
  states: {
95
+ idle: {
96
+ on: {
97
+ LOGIN_REFRESH: {
98
+ target: 'updating',
99
+ actions: 'login',
100
+ },
101
+ LEAVE_GAME_REFRESH: {
102
+ target: 'updating',
103
+ actions: 'leaveGame',
104
+ },
105
+ },
106
+ },
94
107
  updating: {
95
108
  invoke: {
96
109
  src: 'fetchFeeds',
@@ -111,11 +124,12 @@ export default function (request) {
111
124
  },
112
125
  on: {
113
126
  ENTER_GAME_PAUSE: {
127
+ target: '.idle',
114
128
  actions: 'resetByEnterGame',
115
129
  },
116
- LEAVE_GAME_REFRESH: {
117
- target: '.updating',
118
- actions: 'leaveGame',
130
+ LOGOUT_PAUSE: {
131
+ target: '.idle',
132
+ actions: 'resetByLogout',
119
133
  },
120
134
  },
121
135
  },
@@ -224,6 +238,18 @@ export default function (request) {
224
238
  isMobile: userAgent?.device?.type,
225
239
  }
226
240
  }),
241
+ setFbclid: assign(() => {
242
+ const urlParams = new URLSearchParams(window.location.search)
243
+ const fbclid = urlParams.get('fbclid') || ''
244
+ if (fbclid !== '') {
245
+ const timestamp = Date.now()
246
+ const cookieRecord = 'fb.1.' + timestamp + '.' + fbclid
247
+ document.cookie = `_fbc=${cookieRecord}; path=/; max-age=${60 * 60 * 24 * 7}`
248
+ }
249
+ return {
250
+ fbclid,
251
+ }
252
+ }),
227
253
  setPixel: assign(() => {
228
254
  let urlParams = new URLSearchParams(window.location.search)
229
255
  const pix = urlParams.get('pix') || storage.get('pix') || ''
@@ -335,6 +361,19 @@ export default function (request) {
335
361
  isPlaying: false,
336
362
  }
337
363
  }),
364
+ resetByLogout: assign((context, event) => {
365
+ return {
366
+ isLogin: false,
367
+ broadcastList: null,
368
+ mailBoxInfo: null,
369
+ promotions: null,
370
+ }
371
+ }),
372
+ login: assign((context, event) => {
373
+ return {
374
+ isLogin: true,
375
+ }
376
+ }),
338
377
  },
339
378
  guards: {
340
379
  isAffiliateCodeInstructionsEnable: (context, event) => {
@@ -140,6 +140,8 @@ const supportVersion2List = [
140
140
  'game/list/v3/gameInfo',
141
141
  'payment/v2/uploadCommonSlip',
142
142
  'game/history/options',
143
+ // 09/30
144
+ 'pixel',
143
145
  ]
144
146
 
145
147
  function isValid(value) {