@yysports/tools 2.2.4 → 2.2.6
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/dist/Track/Beacon.js +4 -4
- package/dist/Track/Log.d.ts +1 -0
- package/dist/Track/Log.js +10 -3
- package/dist/Track/Replay.js +5 -1
- package/dist/Track/index.d.ts +1 -0
- package/dist/Track/index.js +7 -0
- package/lib/Track/Beacon.js +4 -4
- package/lib/Track/Log.d.ts +1 -0
- package/lib/Track/Log.js +4 -0
- package/lib/Track/Replay.js +3 -0
- package/lib/Track/index.d.ts +1 -0
- package/lib/Track/index.js +4 -0
- package/package.json +8 -8
package/dist/Track/Beacon.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
import
|
|
4
|
+
import packageJson from "../../package.json";
|
|
5
5
|
import Config from "./Config";
|
|
6
6
|
var Beacon = /*#__PURE__*/function () {
|
|
7
7
|
function Beacon() {
|
|
@@ -42,12 +42,12 @@ var Beacon = /*#__PURE__*/function () {
|
|
|
42
42
|
// 获取缓存中的版本信息
|
|
43
43
|
var storageKey = "__TrackVersion__";
|
|
44
44
|
var cachedVersion = localStorage.getItem(storageKey);
|
|
45
|
-
if (cachedVersion !== version) {
|
|
45
|
+
if (cachedVersion !== packageJson.version) {
|
|
46
46
|
this.send({
|
|
47
47
|
appId: Config.data.appId,
|
|
48
|
-
version: version
|
|
48
|
+
version: packageJson.version
|
|
49
49
|
}, '/pousheng-guard/api/apps/version/update');
|
|
50
|
-
localStorage.setItem(storageKey, version);
|
|
50
|
+
localStorage.setItem(storageKey, packageJson.version);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
}]);
|
package/dist/Track/Log.d.ts
CHANGED
package/dist/Track/Log.js
CHANGED
|
@@ -14,10 +14,17 @@ var Log = /*#__PURE__*/function () {
|
|
|
14
14
|
_classCallCheck(this, Log);
|
|
15
15
|
}
|
|
16
16
|
_createClass(Log, null, [{
|
|
17
|
-
key: "
|
|
18
|
-
|
|
17
|
+
key: "module",
|
|
18
|
+
get:
|
|
19
|
+
// 获取当前模块名称
|
|
20
|
+
function get() {
|
|
21
|
+
return this._module;
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
// 上报日志的公共属性
|
|
20
|
-
|
|
25
|
+
}, {
|
|
26
|
+
key: "_commonProps",
|
|
27
|
+
value: function _commonProps() {
|
|
21
28
|
return _objectSpread(_objectSpread(_objectSpread({}, User.profile), System.profile), {}, {
|
|
22
29
|
appId: Config.data.appId,
|
|
23
30
|
module: this._module
|
package/dist/Track/Replay.js
CHANGED
|
@@ -39,6 +39,7 @@ var Replay = /*#__PURE__*/function () {
|
|
|
39
39
|
key: "reportSnapshot",
|
|
40
40
|
value: function () {
|
|
41
41
|
var _reportSnapshot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(errorId) {
|
|
42
|
+
var _this$_stop;
|
|
42
43
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
43
44
|
while (1) switch (_context.prev = _context.next) {
|
|
44
45
|
case 0:
|
|
@@ -57,8 +58,11 @@ var Replay = /*#__PURE__*/function () {
|
|
|
57
58
|
body: JSON.stringify(this._events)
|
|
58
59
|
});
|
|
59
60
|
case 4:
|
|
61
|
+
// 上报完成后停止本次行为的录制,清空事件队列
|
|
62
|
+
(_this$_stop = this._stop) === null || _this$_stop === void 0 || _this$_stop.call(this);
|
|
63
|
+
this._stop = undefined;
|
|
60
64
|
this._events = [];
|
|
61
|
-
case
|
|
65
|
+
case 7:
|
|
62
66
|
case "end":
|
|
63
67
|
return _context.stop();
|
|
64
68
|
}
|
package/dist/Track/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export default class Track {
|
|
|
8
8
|
static get userProfile(): UserProfile | null;
|
|
9
9
|
static get systemProfile(): import("../interfaces/track.interface").SystemProfile;
|
|
10
10
|
static run(): void;
|
|
11
|
+
static get module(): string;
|
|
11
12
|
static visitLog: typeof Log.visitLog;
|
|
12
13
|
static eventLog: typeof Log.eventLog;
|
|
13
14
|
static errorLog: typeof Log.errorLog;
|
package/dist/Track/index.js
CHANGED
package/lib/Track/Beacon.js
CHANGED
|
@@ -32,7 +32,7 @@ __export(Beacon_exports, {
|
|
|
32
32
|
default: () => Beacon
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Beacon_exports);
|
|
35
|
-
var import_package = require("../../package.json");
|
|
35
|
+
var import_package = __toESM(require("../../package.json"));
|
|
36
36
|
var import_Config = __toESM(require("./Config"));
|
|
37
37
|
var Beacon = class {
|
|
38
38
|
// 加入Beacon消息队列,检测超过5条记录时自动发送
|
|
@@ -57,15 +57,15 @@ var Beacon = class {
|
|
|
57
57
|
static updateVersion() {
|
|
58
58
|
const storageKey = `__TrackVersion__`;
|
|
59
59
|
const cachedVersion = localStorage.getItem(storageKey);
|
|
60
|
-
if (cachedVersion !== import_package.version) {
|
|
60
|
+
if (cachedVersion !== import_package.default.version) {
|
|
61
61
|
this.send(
|
|
62
62
|
{
|
|
63
63
|
appId: import_Config.default.data.appId,
|
|
64
|
-
version: import_package.version
|
|
64
|
+
version: import_package.default.version
|
|
65
65
|
},
|
|
66
66
|
"/pousheng-guard/api/apps/version/update"
|
|
67
67
|
);
|
|
68
|
-
localStorage.setItem(storageKey, import_package.version);
|
|
68
|
+
localStorage.setItem(storageKey, import_package.default.version);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
};
|
package/lib/Track/Log.d.ts
CHANGED
package/lib/Track/Log.js
CHANGED
|
@@ -38,6 +38,10 @@ var import_Replay = __toESM(require("./Replay"));
|
|
|
38
38
|
var import_System = __toESM(require("./System"));
|
|
39
39
|
var import_User = __toESM(require("./User"));
|
|
40
40
|
var Log = class {
|
|
41
|
+
// 获取当前模块名称
|
|
42
|
+
static get module() {
|
|
43
|
+
return this._module;
|
|
44
|
+
}
|
|
41
45
|
// 上报日志的公共属性
|
|
42
46
|
static _commonProps() {
|
|
43
47
|
return {
|
package/lib/Track/Replay.js
CHANGED
|
@@ -60,6 +60,7 @@ var Replay = class {
|
|
|
60
60
|
}
|
|
61
61
|
// 快照
|
|
62
62
|
static async reportSnapshot(errorId) {
|
|
63
|
+
var _a;
|
|
63
64
|
if (!this._stop) {
|
|
64
65
|
return;
|
|
65
66
|
}
|
|
@@ -73,6 +74,8 @@ var Replay = class {
|
|
|
73
74
|
body: JSON.stringify(this._events)
|
|
74
75
|
}
|
|
75
76
|
);
|
|
77
|
+
(_a = this._stop) == null ? void 0 : _a.call(this);
|
|
78
|
+
this._stop = void 0;
|
|
76
79
|
this._events = [];
|
|
77
80
|
}
|
|
78
81
|
};
|
package/lib/Track/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export default class Track {
|
|
|
8
8
|
static get userProfile(): UserProfile | null;
|
|
9
9
|
static get systemProfile(): import("../interfaces/track.interface").SystemProfile;
|
|
10
10
|
static run(): void;
|
|
11
|
+
static get module(): string;
|
|
11
12
|
static visitLog: typeof Log.visitLog;
|
|
12
13
|
static eventLog: typeof Log.eventLog;
|
|
13
14
|
static errorLog: typeof Log.errorLog;
|
package/lib/Track/index.js
CHANGED
|
@@ -62,6 +62,10 @@ var Track = class {
|
|
|
62
62
|
import_Replay.default.run();
|
|
63
63
|
import_Beacon.default.updateVersion();
|
|
64
64
|
}
|
|
65
|
+
// 获取当前页面模块名称
|
|
66
|
+
static get module() {
|
|
67
|
+
return import_Log.default.module;
|
|
68
|
+
}
|
|
65
69
|
};
|
|
66
70
|
Track.visitLog = import_Log.default.visitLog.bind(import_Log.default);
|
|
67
71
|
Track.eventLog = import_Log.default.eventLog.bind(import_Log.default);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yysports/tools",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"description": "常用工具函数库",
|
|
5
5
|
"homepage": "https://git.pousheng.com/sport-service-department/pousheng-guard/yysports_tools#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -69,21 +69,21 @@
|
|
|
69
69
|
"@ant-design/pro-components": "^2.8.10",
|
|
70
70
|
"@commitlint/cli": "^20.1.0",
|
|
71
71
|
"@commitlint/config-conventional": "^20.0.0",
|
|
72
|
-
"@types/react": "^
|
|
73
|
-
"@types/react-dom": "^
|
|
72
|
+
"@types/react": "^19.2.6",
|
|
73
|
+
"@types/react-dom": "^19.2.3",
|
|
74
74
|
"@umijs/lint": "^4.5.3",
|
|
75
|
-
"antd": "^
|
|
75
|
+
"antd": "^6.0.0",
|
|
76
76
|
"dumi": "^2.4.21",
|
|
77
77
|
"eslint": "^8.57.1",
|
|
78
78
|
"father": "^4.6.7",
|
|
79
79
|
"husky": "^9.1.7",
|
|
80
|
-
"lint-staged": "^16.2.
|
|
80
|
+
"lint-staged": "^16.2.7",
|
|
81
81
|
"prettier": "^3.6.2",
|
|
82
82
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
83
83
|
"prettier-plugin-packagejson": "^2.5.19",
|
|
84
|
-
"react": "^
|
|
85
|
-
"react-dom": "^
|
|
86
|
-
"stylelint": "^16.
|
|
84
|
+
"react": "^19.2.0",
|
|
85
|
+
"react-dom": "^19.2.0",
|
|
86
|
+
"stylelint": "^16.26.0"
|
|
87
87
|
},
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|