nonecap 0.1.0 → 0.2.0

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.
package/README.md CHANGED
@@ -92,6 +92,8 @@ await nc.solve({
92
92
  url,
93
93
  proxy: { scheme: "http", host: "1.2.3.4", port: 8080, username: "u", password: "p" },
94
94
  // or: proxy: "http://u:p@1.2.3.4:8080"
95
+ // scheme can be http, https, socks5, socks5h, or socks4 (default http)
96
+ // e.g. proxy: "socks5://u:p@1.2.3.4:1080"
95
97
  });
96
98
  ```
97
99
 
package/dist/index.d.cts CHANGED
@@ -6,11 +6,14 @@
6
6
  type SolveType = "hcaptcha" | "hcaptcha_enterprise";
7
7
  /** Lifecycle of a solve. `solved` and `failed`/`expired`/`cancelled` are terminal. */
8
8
  type SolveStatus = "pending" | "solving" | "solved" | "failed" | "cancelled" | "expired";
9
- /** A proxy the solve should egress through. */
9
+ /** Proxy scheme. Defaults to `http` when omitted. */
10
+ type ProxyScheme = "http" | "https" | "socks5" | "socks5h" | "socks4";
11
+ /** A proxy the solve should egress through. `host` and `port` are required; the
12
+ * API rejects a partial proxy object with a 422. `port` must be 1–65535. */
10
13
  interface Proxy {
11
- scheme?: string;
12
- host?: string;
13
- port?: string | number;
14
+ scheme?: ProxyScheme;
15
+ host: string;
16
+ port: string | number;
14
17
  username?: string;
15
18
  password?: string;
16
19
  }
package/dist/index.d.ts CHANGED
@@ -6,11 +6,14 @@
6
6
  type SolveType = "hcaptcha" | "hcaptcha_enterprise";
7
7
  /** Lifecycle of a solve. `solved` and `failed`/`expired`/`cancelled` are terminal. */
8
8
  type SolveStatus = "pending" | "solving" | "solved" | "failed" | "cancelled" | "expired";
9
- /** A proxy the solve should egress through. */
9
+ /** Proxy scheme. Defaults to `http` when omitted. */
10
+ type ProxyScheme = "http" | "https" | "socks5" | "socks5h" | "socks4";
11
+ /** A proxy the solve should egress through. `host` and `port` are required; the
12
+ * API rejects a partial proxy object with a 422. `port` must be 1–65535. */
10
13
  interface Proxy {
11
- scheme?: string;
12
- host?: string;
13
- port?: string | number;
14
+ scheme?: ProxyScheme;
15
+ host: string;
16
+ port: string | number;
14
17
  username?: string;
15
18
  password?: string;
16
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nonecap",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Official TypeScript client for the NoneCap hCaptcha solving API.",
5
5
  "type": "module",
6
6
  "license": "MIT",