pb-sxp-ui 1.15.12-alpha.7 → 1.15.12-alpha.8

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.
@@ -289,7 +289,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
289
289
  bffDataSource
290
290
  ]);
291
291
  const bffFbReport = useCallback(({ eventName, product }) => {
292
- var _a, _b, _c, _d, _e, _f;
292
+ var _a, _b, _c, _d, _e, _f, _g;
293
293
  if (!enableReportEvent ||
294
294
  !enabledMetaConversionApi ||
295
295
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
@@ -353,7 +353,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
353
353
  }
354
354
  };
355
355
  getEventParams(jsonParams);
356
- return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/event/report/FB/${(_f = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _f === void 0 ? void 0 : _f['x-app-id']}/${eventName}`, {
356
+ const params = {};
357
+ const queryString = location.search.slice(1);
358
+ (_f = splitUrlParams(queryString)) === null || _f === void 0 ? void 0 : _f.map((val) => {
359
+ const key = val.split('=')[0];
360
+ const value = val.split('=')[1];
361
+ params[key] = value;
362
+ });
363
+ const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
364
+ return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_g = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _g === void 0 ? void 0 : _g['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
357
365
  method: 'POST',
358
366
  body: jsonParams,
359
367
  type: 'beacon'
@@ -292,7 +292,7 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
292
292
  bffDataSource
293
293
  ]);
294
294
  const bffFbReport = (0, react_1.useCallback)(({ eventName, product }) => {
295
- var _a, _b, _c, _d, _e, _f;
295
+ var _a, _b, _c, _d, _e, _f, _g;
296
296
  if (!enableReportEvent ||
297
297
  !enabledMetaConversionApi ||
298
298
  (globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.enablePreview) ||
@@ -356,7 +356,15 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
356
356
  }
357
357
  };
358
358
  getEventParams(jsonParams);
359
- return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/event/report/FB/${(_f = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _f === void 0 ? void 0 : _f['x-app-id']}/${eventName}`, {
359
+ const params = {};
360
+ const queryString = location.search.slice(1);
361
+ (_f = (0, tool_1.splitUrlParams)(queryString)) === null || _f === void 0 ? void 0 : _f.map((val) => {
362
+ const key = val.split('=')[0];
363
+ const value = val.split('=')[1];
364
+ params[key] = value;
365
+ });
366
+ const cl_source = params === null || params === void 0 ? void 0 : params.cl_source;
367
+ return bffFetch === null || bffFetch === void 0 ? void 0 : bffFetch(`v2/fb/${(_g = bffDataSource === null || bffDataSource === void 0 ? void 0 : bffDataSource.headers) === null || _g === void 0 ? void 0 : _g['x-app-id']}/${eventName}${cl_source ? `/${decodeURIComponent(cl_source)}` : ''}`, {
360
368
  method: 'POST',
361
369
  body: jsonParams,
362
370
  type: 'beacon'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.15.12-alpha.7",
3
+ "version": "1.15.12-alpha.8",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -37,7 +37,6 @@
37
37
  "license": "MIT",
38
38
  "dependencies": {
39
39
  "@emotion/css": "^11.11.2",
40
- "crypto-js": "^4.2.0",
41
40
  "eslint": "^8.48.0",
42
41
  "eventemitter3": "^5.0.1",
43
42
  "less": "^4.2.0",
@@ -1,3 +0,0 @@
1
- declare function encrypt(text: string, key: string): string;
2
- declare function decrypt(encryptedBase64: string, key: string): string;
3
- export { encrypt, decrypt };
@@ -1,18 +0,0 @@
1
- import CryptoJS from 'crypto-js';
2
- function encrypt(text, key) {
3
- const encrypted = CryptoJS.AES.encrypt(text, CryptoJS.enc.Utf8.parse(key), {
4
- iv: CryptoJS.enc.Utf8.parse(key),
5
- mode: CryptoJS.mode.CBC,
6
- padding: CryptoJS.pad.Pkcs7
7
- });
8
- return encrypted.ciphertext.toString(CryptoJS.enc.Base64);
9
- }
10
- function decrypt(encryptedBase64, key) {
11
- const bytes = CryptoJS.AES.decrypt(encryptedBase64, CryptoJS.enc.Utf8.parse(key), {
12
- iv: CryptoJS.enc.Utf8.parse(key),
13
- mode: CryptoJS.mode.CBC,
14
- padding: CryptoJS.pad.Pkcs7
15
- });
16
- return bytes.toString(CryptoJS.enc.Utf8);
17
- }
18
- export { encrypt, decrypt };
@@ -1,3 +0,0 @@
1
- declare function encrypt(text: string, key: string): string;
2
- declare function decrypt(encryptedBase64: string, key: string): string;
3
- export { encrypt, decrypt };
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decrypt = exports.encrypt = void 0;
4
- const tslib_1 = require("tslib");
5
- const crypto_js_1 = tslib_1.__importDefault(require("crypto-js"));
6
- function encrypt(text, key) {
7
- const encrypted = crypto_js_1.default.AES.encrypt(text, crypto_js_1.default.enc.Utf8.parse(key), {
8
- iv: crypto_js_1.default.enc.Utf8.parse(key),
9
- mode: crypto_js_1.default.mode.CBC,
10
- padding: crypto_js_1.default.pad.Pkcs7
11
- });
12
- return encrypted.ciphertext.toString(crypto_js_1.default.enc.Base64);
13
- }
14
- exports.encrypt = encrypt;
15
- function decrypt(encryptedBase64, key) {
16
- const bytes = crypto_js_1.default.AES.decrypt(encryptedBase64, crypto_js_1.default.enc.Utf8.parse(key), {
17
- iv: crypto_js_1.default.enc.Utf8.parse(key),
18
- mode: crypto_js_1.default.mode.CBC,
19
- padding: crypto_js_1.default.pad.Pkcs7
20
- });
21
- return bytes.toString(crypto_js_1.default.enc.Utf8);
22
- }
23
- exports.decrypt = decrypt;