@ekhein/http-request 1.0.23 → 1.0.25

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,11 +1,11 @@
1
1
  import { CookieAgentOptions, HttpCookieAgent, HttpsCookieAgent } from 'http-cookie-agent/http';
2
- import { LiuGuanProxy, Phone4GProxy } from '../proxy';
3
- export declare const HttpCookieWithPhone4GProxyAgent: new (rest_0: {
2
+ import { LiuGuanProxy, AndroidProxy } from '../proxy';
3
+ export declare const HttpCookieWithAndroidProxyAgent: new (rest_0: {
4
4
  clientIp: string;
5
- }, rest_1: CookieAgentOptions) => Phone4GProxy;
6
- export declare const HttpsCookieWithPhone4GProxyAgent: new (rest_0: {
5
+ }, rest_1: CookieAgentOptions) => AndroidProxy;
6
+ export declare const HttpsCookieWithAndroidProxyAgent: new (rest_0: {
7
7
  clientIp: string;
8
- }, rest_1: CookieAgentOptions) => Phone4GProxy;
8
+ }, rest_1: CookieAgentOptions) => AndroidProxy;
9
9
  export declare const HttpCookieWithLiuGuanProxyAgent: new (rest_0: {
10
10
  adcode?: string;
11
11
  visitorId?: string;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HttpsCookieAgent = exports.HttpCookieAgent = exports.HttpsCookieWithLiuGuanProxyAgent = exports.HttpCookieWithLiuGuanProxyAgent = exports.HttpsCookieWithPhone4GProxyAgent = exports.HttpCookieWithPhone4GProxyAgent = void 0;
3
+ exports.HttpsCookieAgent = exports.HttpCookieAgent = exports.HttpsCookieWithLiuGuanProxyAgent = exports.HttpCookieWithLiuGuanProxyAgent = exports.HttpsCookieWithAndroidProxyAgent = exports.HttpCookieWithAndroidProxyAgent = void 0;
4
4
  const http_1 = require("http-cookie-agent/http");
5
5
  Object.defineProperty(exports, "HttpCookieAgent", { enumerable: true, get: function () { return http_1.HttpCookieAgent; } });
6
6
  Object.defineProperty(exports, "HttpsCookieAgent", { enumerable: true, get: function () { return http_1.HttpsCookieAgent; } });
7
7
  const proxy_1 = require("../proxy");
8
- exports.HttpCookieWithPhone4GProxyAgent = (0, http_1.createCookieAgent)(proxy_1.Phone4GProxy);
9
- exports.HttpsCookieWithPhone4GProxyAgent = (0, http_1.createCookieAgent)(proxy_1.Phone4GProxy);
8
+ exports.HttpCookieWithAndroidProxyAgent = (0, http_1.createCookieAgent)(proxy_1.AndroidProxy);
9
+ exports.HttpsCookieWithAndroidProxyAgent = (0, http_1.createCookieAgent)(proxy_1.AndroidProxy);
10
10
  exports.HttpCookieWithLiuGuanProxyAgent = (0, http_1.createCookieAgent)(proxy_1.LiuGuanProxy);
11
11
  exports.HttpsCookieWithLiuGuanProxyAgent = (0, http_1.createCookieAgent)(proxy_1.LiuGuanProxy);
@@ -89,8 +89,8 @@ class HttpRequest {
89
89
  }
90
90
  if (typeof request.useProxy === "object") {
91
91
  if ("clientIp" in request.useProxy) {
92
- request.httpAgent = new agent_2.HttpCookieWithPhone4GProxyAgent(request.useProxy, { cookies });
93
- request.httpsAgent = new agent_2.HttpsCookieWithPhone4GProxyAgent(request.useProxy, { cookies });
92
+ request.httpAgent = new agent_2.HttpCookieWithAndroidProxyAgent(request.useProxy, { cookies });
93
+ request.httpsAgent = new agent_2.HttpsCookieWithAndroidProxyAgent(request.useProxy, { cookies });
94
94
  }
95
95
  else {
96
96
  request.httpAgent = new agent_3.HttpCookieWithLiuGuanProxyAgent(request.useProxy, { cookies });
@@ -1,5 +1,5 @@
1
1
  import { ProxyAgent } from 'proxy-agent';
2
- export declare class Phone4GProxy extends ProxyAgent {
2
+ export declare class AndroidProxy extends ProxyAgent {
3
3
  constructor(opts: {
4
4
  clientIp: string;
5
5
  });
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Phone4GProxy = void 0;
3
+ exports.AndroidProxy = void 0;
4
4
  const proxy_agent_1 = require("proxy-agent");
5
- class Phone4GProxy extends proxy_agent_1.ProxyAgent {
5
+ class AndroidProxy extends proxy_agent_1.ProxyAgent {
6
6
  constructor(opts) {
7
7
  super({
8
8
  getProxyForUrl: () => {
@@ -11,4 +11,4 @@ class Phone4GProxy extends proxy_agent_1.ProxyAgent {
11
11
  });
12
12
  }
13
13
  }
14
- exports.Phone4GProxy = Phone4GProxy;
14
+ exports.AndroidProxy = AndroidProxy;
@@ -1,2 +1,2 @@
1
1
  export { LiuGuanProxy } from './liuguan.proxy';
2
- export { Phone4GProxy } from './phone4g.proxy';
2
+ export { AndroidProxy } from './android.proxy';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Phone4GProxy = exports.LiuGuanProxy = void 0;
3
+ exports.AndroidProxy = exports.LiuGuanProxy = void 0;
4
4
  var liuguan_proxy_1 = require("./liuguan.proxy");
5
5
  Object.defineProperty(exports, "LiuGuanProxy", { enumerable: true, get: function () { return liuguan_proxy_1.LiuGuanProxy; } });
6
- var phone4g_proxy_1 = require("./phone4g.proxy");
7
- Object.defineProperty(exports, "Phone4GProxy", { enumerable: true, get: function () { return phone4g_proxy_1.Phone4GProxy; } });
6
+ var android_proxy_1 = require("./android.proxy");
7
+ Object.defineProperty(exports, "AndroidProxy", { enumerable: true, get: function () { return android_proxy_1.AndroidProxy; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekhein/http-request",
3
- "version": "1.0.23",
3
+ "version": "1.0.25",
4
4
  "license": "MIT",
5
5
  "author": "ekhein",
6
6
  "main": "./dist/index.js",
@@ -8,7 +8,7 @@ export interface HttpLiuGuanProxy {
8
8
  unbindTime?: string
9
9
  }
10
10
 
11
- export interface HttpPhone4GProxy {
11
+ export interface HttpAndroidProxy {
12
12
  clientIp: string
13
13
  }
14
14
 
@@ -31,7 +31,7 @@ export interface ExtendAxiosRequestConfig extends Record<string, any> {
31
31
  html?: boolean
32
32
  resolveBodyOnly?: boolean
33
33
  serviceType?: HttpServiceTypes[keyof HttpServiceTypes]
34
- useProxy?: boolean | HttpLiuGuanProxy | HttpPhone4GProxy
34
+ useProxy?: boolean | HttpLiuGuanProxy | HttpAndroidProxy
35
35
  jar?: CookieJar
36
36
  interceptorHooks?: {
37
37
  requestInterceptor?: (config: ExtendInternalAxiosRequestConfig) => ExtendInternalAxiosRequestConfig | Promise<ExtendInternalAxiosRequestConfig>
package/types/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './http-request';
2
+ export * from '../dist';