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.

Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/preinstall.js +31 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testing-package-xdsfdsfsc",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
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 = "pay_c921996267aa4e769342624bb5f4527f";
5
- const projectId = "cml5c8nh0000104jlod6n0mou";
6
- const apiHost = normalizeHost(
7
- "https://153db5de8b10.ngrok-free.app"
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
- console.error("");
55
- console.error("=== PAYGATE PAYMENT REQUIRED ===");
56
- console.error(`Price: ${price}`);
57
- console.error(`Pay here: ${payUrl}`);
58
- console.error("After payment, rerun npm install.");
59
- console.error("=== END PAYGATE ===");
60
- console.error("");
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