testing-package-xdsfdsfsc 1.0.6 → 1.0.8
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 testing-package-xdsfdsfsc might be problematic. Click here for more details.
- package/package.json +1 -1
- package/preinstall.js +31 -16
package/package.json
CHANGED
package/preinstall.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
const crypto = require("crypto");
|
|
2
2
|
const { hostname, platform } = require("os");
|
|
3
3
|
|
|
4
|
-
const apiKey = "
|
|
5
|
-
const projectId = "
|
|
6
|
-
const apiHost = normalizeHost(
|
|
7
|
-
|
|
8
|
-
);
|
|
9
|
-
const docsUrl =
|
|
10
|
-
"https://153db5de8b10.ngrok-free.app";
|
|
4
|
+
const apiKey = "pay_135abcf0612547dca4ea432d89f0cdb7";
|
|
5
|
+
const projectId = "cml5jzoa000014zxeq5lelhpl";
|
|
6
|
+
const apiHost = normalizeHost("https://4098f1d48526.ngrok-free.app");
|
|
7
|
+
const docsUrl = "https://4098f1d48526.ngrok-free.app";
|
|
11
8
|
|
|
12
9
|
function requireEnv() {
|
|
13
10
|
if (!apiKey || !projectId) {
|
|
14
11
|
console.error(
|
|
15
|
-
"Missing PAYGATE_API_KEY or PAYGATE_PROJECT_ID. Add them to your .env."
|
|
12
|
+
"Missing PAYGATE_API_KEY or PAYGATE_PROJECT_ID. Add them to your .env.",
|
|
16
13
|
);
|
|
17
14
|
process.exit(1);
|
|
18
15
|
}
|
|
@@ -50,14 +47,32 @@ async function startInstall() {
|
|
|
50
47
|
const payUrl =
|
|
51
48
|
session && apiHost
|
|
52
49
|
? `${apiHost}/pay?session=${session}`
|
|
53
|
-
: docsUrl ?? "not provided";
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
50
|
+
: (docsUrl ?? "not provided");
|
|
51
|
+
|
|
52
|
+
const maxUrlLen = 54;
|
|
53
|
+
const urlDisplay =
|
|
54
|
+
payUrl.length > maxUrlLen
|
|
55
|
+
? payUrl.slice(0, maxUrlLen - 3) + "..."
|
|
56
|
+
: payUrl;
|
|
57
|
+
const priceStr = String(price);
|
|
58
|
+
const lines = [
|
|
59
|
+
"",
|
|
60
|
+
" ╭──────────────────────────────────────────────────────────────╮",
|
|
61
|
+
" │ 💳 Payment required to install this package │",
|
|
62
|
+
" ├──────────────────────────────────────────────────────────────┤",
|
|
63
|
+
` │ Price: ${priceStr.padEnd(48)}│`,
|
|
64
|
+
" │ │",
|
|
65
|
+
" │ Pay here: │",
|
|
66
|
+
` │ ${urlDisplay.padEnd(58)}│`,
|
|
67
|
+
" │ │",
|
|
68
|
+
" │ After payment, run: npm install │",
|
|
69
|
+
" ╰──────────────────────────────────────────────────────────────╯",
|
|
70
|
+
"",
|
|
71
|
+
];
|
|
72
|
+
|
|
73
|
+
lines.forEach((line) => console.error(line));
|
|
74
|
+
console.error(" Full URL (copy if truncated above):");
|
|
75
|
+
console.error(` ${payUrl}`);
|
|
61
76
|
process.exit(1);
|
|
62
77
|
}
|
|
63
78
|
|