ddan-js 2.7.3 → 2.7.5

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.
@@ -12,17 +12,17 @@ exports.default = () => {
12
12
  : '';
13
13
  const v4 = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}';
14
14
  const v6seg = '[a-fA-F\\d]{1,4}';
15
- const v6 = `
16
- (?:
17
- (?:${v6seg}:){7}(?:${v6seg}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
18
- (?:${v6seg}:){6}(?:${v4}|:${v6seg}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
19
- (?:${v6seg}:){5}(?::${v4}|(?::${v6seg}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
20
- (?:${v6seg}:){4}(?:(?::${v6seg}){0,1}:${v4}|(?::${v6seg}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
21
- (?:${v6seg}:){3}(?:(?::${v6seg}){0,2}:${v4}|(?::${v6seg}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
22
- (?:${v6seg}:){2}(?:(?::${v6seg}){0,3}:${v4}|(?::${v6seg}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
23
- (?:${v6seg}:){1}(?:(?::${v6seg}){0,4}:${v4}|(?::${v6seg}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
24
- (?::(?:(?::${v6seg}){0,5}:${v4}|(?::${v6seg}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
25
- )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
15
+ const v6 = `
16
+ (?:
17
+ (?:${v6seg}:){7}(?:${v6seg}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
18
+ (?:${v6seg}:){6}(?:${v4}|:${v6seg}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
19
+ (?:${v6seg}:){5}(?::${v4}|(?::${v6seg}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
20
+ (?:${v6seg}:){4}(?:(?::${v6seg}){0,1}:${v4}|(?::${v6seg}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
21
+ (?:${v6seg}:){3}(?:(?::${v6seg}){0,2}:${v4}|(?::${v6seg}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
22
+ (?:${v6seg}:){2}(?:(?::${v6seg}){0,3}:${v4}|(?::${v6seg}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
23
+ (?:${v6seg}:){1}(?:(?::${v6seg}){0,4}:${v4}|(?::${v6seg}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
24
+ (?::(?:(?::${v6seg}){0,5}:${v4}|(?::${v6seg}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
25
+ )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
26
26
  `
27
27
  .replace(/\s*\/\/.*$/gm, '')
28
28
  .replace(/\n/g, '')
@@ -571,11 +571,7 @@ declare const dNode: {
571
571
  ipaddress: string;
572
572
  port: number;
573
573
  } | undefined> | undefined;
574
- toPacScript: ({ proxy, system, rules }: {
575
- proxy?: string | undefined;
576
- system?: string | undefined;
577
- rules?: string[] | undefined;
578
- }) => string;
574
+ toPacScript: (proxy: string, rules?: string[], defaultProxy?: string) => string;
579
575
  toPacProxy: (ipaddress: string, port: number, options?: {
580
576
  type?: "PROXY" | "SOCKS5" | "ALL" | undefined;
581
577
  direct?: boolean | undefined;
@@ -9,11 +9,7 @@ declare const _default: {
9
9
  ipaddress: string;
10
10
  port: number;
11
11
  } | undefined> | undefined;
12
- toPacScript: ({ proxy, system, rules }: {
13
- proxy?: string | undefined;
14
- system?: string | undefined;
15
- rules?: string[] | undefined;
16
- }) => string;
12
+ toPacScript: (proxy: string, rules?: string[], defaultProxy?: string) => string;
17
13
  toPacProxy: (ipaddress: string, port: number, options?: {
18
14
  type?: "PROXY" | "SOCKS5" | "ALL" | undefined;
19
15
  direct?: boolean | undefined;
@@ -1,16 +1,12 @@
1
- declare const _default: {
1
+ declare const _default_1: {
2
2
  getSystemProxy: () => Promise<{
3
3
  ipaddress: string;
4
4
  port: number;
5
5
  } | undefined> | undefined;
6
- toPacScript: ({ proxy, system, rules }: {
7
- proxy?: string | undefined;
8
- system?: string | undefined;
9
- rules?: string[] | undefined;
10
- }) => string;
6
+ toPacScript: (proxy: string, rules?: string[], defaultProxy?: string) => string;
11
7
  toPacProxy: (ipaddress: string, port: number, options?: {
12
8
  type?: "PROXY" | "SOCKS5" | "ALL" | undefined;
13
9
  direct?: boolean | undefined;
14
10
  } | undefined) => string;
15
11
  };
16
- export default _default;
12
+ export default _default_1;
@@ -33,6 +33,7 @@ export declare class Socks5 {
33
33
  constructor(upstreamProxy: IProxyConfig, allowedDomains?: string[] | ['*'], debug?: boolean, logger?: ILogger);
34
34
  get id(): string;
35
35
  get port(): number;
36
+ get url(): string;
36
37
  validateProxyConfig(proxyConfig?: IProxyConfig): "" | "无效的上游代理 IP 地址" | "无效的上游代理端口" | "无效的上游代理用户名" | "无效的上游代理密码";
37
38
  start(startPort?: number): Promise<number>;
38
39
  setUpstreamProxy(upstreamProxy: IProxyConfig): boolean;
@@ -14,12 +14,6 @@ declare class Schema {
14
14
  string: import("./interface").ExecuteValidator;
15
15
  method: import("./interface").ExecuteValidator;
16
16
  number: import("./interface").ExecuteValidator;
17
- /**
18
- * Encapsulates a validation schema.
19
- *
20
- * @param descriptor An object declaring validation rules
21
- * for this schema.
22
- */
23
17
  boolean: import("./interface").ExecuteValidator;
24
18
  regexp: import("./interface").ExecuteValidator;
25
19
  integer: import("./interface").ExecuteValidator;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ddan-js",
3
- "version": "2.7.3",
3
+ "version": "2.7.5",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "ddan-js",