@jetthai/cuora 1.1.387-dev-1 → 1.1.387-dev-2
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 +2 -0
- package/package.json +1 -1
- package/src/api/common.js +6 -0
- package/src/machine/common.js +13 -1
- package/src/request/request.js +2 -0
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.387-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.387-dev-1...v1.1.387-dev-2) (2025-10-01)
|
|
6
|
+
|
|
5
7
|
### [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
8
|
|
|
7
9
|
### [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
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
|
}
|
package/src/machine/common.js
CHANGED
|
@@ -55,7 +55,7 @@ export default function (request) {
|
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
fetching: {
|
|
58
|
-
entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel'],
|
|
58
|
+
entry: ['setUA', 'setAgent', 'setPixel', 'setKPixel', 'setFbclid'],
|
|
59
59
|
invoke: {
|
|
60
60
|
src: 'fetchConfig',
|
|
61
61
|
onDone: [
|
|
@@ -224,6 +224,18 @@ export default function (request) {
|
|
|
224
224
|
isMobile: userAgent?.device?.type,
|
|
225
225
|
}
|
|
226
226
|
}),
|
|
227
|
+
setFbclid: assign(() => {
|
|
228
|
+
const urlParams = new URLSearchParams(window.location.search)
|
|
229
|
+
const fbclid = urlParams.get('fbclid') || ''
|
|
230
|
+
if (fbclid !== '') {
|
|
231
|
+
const timestamp = Date.now()
|
|
232
|
+
const cookieRecord = 'fb.1.' + timestamp + '.' + fbclid
|
|
233
|
+
document.cookie = `_fbc=${cookieRecord}; path=/; max-age=${60 * 60 * 24 * 7}`
|
|
234
|
+
}
|
|
235
|
+
return {
|
|
236
|
+
fbclid,
|
|
237
|
+
}
|
|
238
|
+
}),
|
|
227
239
|
setPixel: assign(() => {
|
|
228
240
|
let urlParams = new URLSearchParams(window.location.search)
|
|
229
241
|
const pix = urlParams.get('pix') || storage.get('pix') || ''
|