@quobix/vacuum 0.21.5 → 0.21.6

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.
@@ -1,12 +1,23 @@
1
1
  import { createWriteStream } from "fs";
2
2
  import * as fs from "fs/promises";
3
3
  import fetch from "node-fetch";
4
+ import { HttpsProxyAgent } from "https-proxy-agent";
4
5
  import { pipeline } from "stream/promises";
5
- import tar from "tar";
6
+ import * as tar from "tar";
6
7
  import { execSync } from "child_process";
7
8
 
8
9
  import { ARCH_MAPPING, CONFIG, PLATFORM_MAPPING } from "./config.js";
9
10
 
11
+ // Get proxy URL from environment variables (standard convention)
12
+ function getProxyUrl() {
13
+ // Check common proxy environment variables (case-insensitive on some systems)
14
+ return process.env.HTTPS_PROXY ||
15
+ process.env.https_proxy ||
16
+ process.env.HTTP_PROXY ||
17
+ process.env.http_proxy ||
18
+ null;
19
+ }
20
+
10
21
  async function install() {
11
22
  if (process.platform === "android") {
12
23
  console.log("Installing, may take a moment...");
@@ -32,9 +43,16 @@ async function install() {
32
43
  url = url.replace(/{{version}}/g, version);
33
44
  url = url.replace(/{{bin_name}}/g, binName);
34
45
 
46
+ // Configure fetch options with proxy support
47
+ const fetchOptions = {};
48
+ const proxyUrl = getProxyUrl();
49
+ if (proxyUrl) {
50
+ console.log('Using proxy:', proxyUrl);
51
+ fetchOptions.agent = new HttpsProxyAgent(proxyUrl);
52
+ }
35
53
 
36
54
  console.log('fetching from URL', url)
37
- const response = await fetch(url);
55
+ const response = await fetch(url, fetchOptions);
38
56
  if (!response.ok) {
39
57
  throw new Error("Failed fetching the binary: " + response.statusText);
40
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quobix/vacuum",
3
- "version": "0.21.5",
3
+ "version": "0.21.6",
4
4
  "description": "The world's fastest, most scalable and complete OpenAPI parser",
5
5
  "type": "module",
6
6
  "author": "Dave Shanley",
@@ -23,6 +23,7 @@
23
23
  "npm-install"
24
24
  ],
25
25
  "dependencies": {
26
+ "https-proxy-agent": "^7.0.6",
26
27
  "node-fetch": "^3.3.2",
27
28
  "tar": "^7.5.2"
28
29
  },