visang-tracker 0.9.11 → 0.9.12
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/index.js +6 -1
- package/package.json +44 -45
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import api, { setBaseUrl } from './api';
|
|
2
|
+
const MAX_QUEUE_SIZE = 500;
|
|
2
3
|
let LOG_BATCH_MAX = 20;
|
|
3
4
|
let LOG_FLUSH_INTERVAL_MS = 10000;
|
|
4
5
|
const LOG_STORAGE_KEY = 'aidt_trace_log_queue_v1';
|
|
@@ -61,11 +62,15 @@ const scheduleFlush = () => {
|
|
|
61
62
|
};
|
|
62
63
|
const enqueueTraceLog = (item) => {
|
|
63
64
|
logQueue.push(item);
|
|
65
|
+
if (logQueue.length > MAX_QUEUE_SIZE) {
|
|
66
|
+
logQueue.shift();
|
|
67
|
+
console.warn('[Tracker] Queue overflow, dropping oldest log');
|
|
68
|
+
}
|
|
64
69
|
persistQueue();
|
|
70
|
+
scheduleFlush();
|
|
65
71
|
// if (logQueue.length >= LOG_BATCH_MAX) {
|
|
66
72
|
// flushLogQueue();
|
|
67
73
|
// } else {
|
|
68
|
-
scheduleFlush();
|
|
69
74
|
// }
|
|
70
75
|
};
|
|
71
76
|
window.addEventListener('visibilitychange', () => {
|
package/package.json
CHANGED
|
@@ -1,47 +1,46 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"dist"
|
|
16
|
-
],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "tsc",
|
|
19
|
-
"prepare": "npm run build"
|
|
20
|
-
},
|
|
21
|
-
"keywords": [
|
|
22
|
-
"visang",
|
|
23
|
-
"tracker",
|
|
24
|
-
"logging",
|
|
25
|
-
"analytics"
|
|
26
|
-
],
|
|
27
|
-
"author": "",
|
|
28
|
-
"license": "MIT",
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"@types/node": "^22.14.1",
|
|
31
|
-
"@types/qs": "^6.14.0",
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
33
|
-
"@typescript-eslint/parser": "^8.46.2",
|
|
34
|
-
"eslint": "^9.38.0",
|
|
35
|
-
"eslint-config-prettier": "^10.1.8",
|
|
36
|
-
"eslint-plugin-react": "^7.37.5",
|
|
37
|
-
"eslint-plugin-react-hooks": "^7.0.0",
|
|
38
|
-
"prettier": "^3.6.2",
|
|
39
|
-
"typescript": "^5.8.3"
|
|
40
|
-
},
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"axios": "^1.12.2",
|
|
43
|
-
"googleapis": "^148.0.0",
|
|
44
|
-
"qs": "^6.14.0",
|
|
45
|
-
"url": "^0.11.4"
|
|
2
|
+
"name": "visang-tracker",
|
|
3
|
+
"version": "0.9.12",
|
|
4
|
+
"description": "Lightweight logging and tracking helper for Visang apps.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
46
12
|
}
|
|
47
|
-
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"keywords": [
|
|
18
|
+
"visang",
|
|
19
|
+
"tracker",
|
|
20
|
+
"logging",
|
|
21
|
+
"analytics"
|
|
22
|
+
],
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^22.14.1",
|
|
27
|
+
"@types/qs": "^6.14.0",
|
|
28
|
+
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
29
|
+
"@typescript-eslint/parser": "^8.46.2",
|
|
30
|
+
"eslint": "^9.38.0",
|
|
31
|
+
"eslint-config-prettier": "^10.1.8",
|
|
32
|
+
"eslint-plugin-react": "^7.37.5",
|
|
33
|
+
"eslint-plugin-react-hooks": "^7.0.0",
|
|
34
|
+
"prettier": "^3.6.2",
|
|
35
|
+
"typescript": "^5.8.3"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"axios": "^1.12.2",
|
|
39
|
+
"googleapis": "^148.0.0",
|
|
40
|
+
"qs": "^6.14.0",
|
|
41
|
+
"url": "^0.11.4"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc"
|
|
45
|
+
}
|
|
46
|
+
}
|