xshell 1.0.80 → 1.0.81
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/i18n/dict.json +3 -0
- package/net.js +9 -7
- package/package.json +8 -8
- package/process.d.ts +10 -0
- package/server.js +6 -2
- package/utils.browser.d.ts +1 -1
- package/utils.d.ts +1 -1
package/i18n/dict.json
CHANGED
|
@@ -376,5 +376,8 @@
|
|
|
376
376
|
},
|
|
377
377
|
"不支持 content-encoding: {{encoding}} 的 http 请求": {
|
|
378
378
|
"en": "http requests with content-encoding: {{encoding}} are not supported"
|
|
379
|
+
},
|
|
380
|
+
"等待 {{duration}} 秒后重试 request (已尝试 {{_count}} 次) …": {
|
|
381
|
+
"en": "Wait {{duration}} seconds before retrying request (tried {{_count}} times) …"
|
|
379
382
|
}
|
|
380
383
|
}
|
package/net.js
CHANGED
|
@@ -43,14 +43,16 @@ async function request_retry(url, options, timeout, retries = 0, count = 0) {
|
|
|
43
43
|
return await undici_request(url, options);
|
|
44
44
|
}
|
|
45
45
|
catch (error) {
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
if (error.name === 'TimeoutError') {
|
|
47
|
+
if (count < retries) {
|
|
48
|
+
const duration = 2 ** count;
|
|
49
|
+
console.log(`${t('等待 {{duration}} 秒后重试 request (已尝试 {{_count}} 次) …', { duration, _count: count + 1 }).yellow} ${url.toString().blue.underline}`);
|
|
50
|
+
await delay(1000 * duration);
|
|
51
|
+
return request_retry(url, options, timeout, retries, count + 1);
|
|
52
|
+
}
|
|
53
|
+
else
|
|
54
|
+
throw Object.assign(new Error(`request 超时: ${url.toString()}`), { name: 'TimeoutError' });
|
|
51
55
|
}
|
|
52
|
-
else if (error.name === 'AbortError' || error.name === 'TimeoutError')
|
|
53
|
-
throw Object.assign(new Error(`request 超时: ${url.toString()}`), { name: 'TimeoutError' });
|
|
54
56
|
else
|
|
55
57
|
throw error;
|
|
56
58
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xshell",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.81",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"bin": {
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"emoji-regex": "^10.3.0",
|
|
71
71
|
"gulp-sort": "^2.0.0",
|
|
72
72
|
"hash-string": "^1.0.0",
|
|
73
|
-
"i18next": "^23.7.
|
|
73
|
+
"i18next": "^23.7.16",
|
|
74
74
|
"i18next-scanner": "^4.4.0",
|
|
75
75
|
"js-cookie": "^3.0.5",
|
|
76
76
|
"koa": "^2.15.0",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"tslib": "^2.6.2",
|
|
90
90
|
"typescript": "^5.3.3",
|
|
91
91
|
"ua-parser-js": "2.0.0-alpha.2",
|
|
92
|
-
"undici": "^6.
|
|
92
|
+
"undici": "^6.3.0",
|
|
93
93
|
"vinyl": "^3.0.0",
|
|
94
94
|
"vinyl-fs": "^4.0.0",
|
|
95
95
|
"ws": "^8.16.0",
|
|
@@ -107,19 +107,19 @@
|
|
|
107
107
|
"@types/chardet": "^0.8.3",
|
|
108
108
|
"@types/gulp-sort": "2.0.4",
|
|
109
109
|
"@types/js-cookie": "^3.0.6",
|
|
110
|
-
"@types/koa": "^2.
|
|
110
|
+
"@types/koa": "^2.14.0",
|
|
111
111
|
"@types/koa-compress": "^4.0.6",
|
|
112
112
|
"@types/lodash": "^4.14.202",
|
|
113
113
|
"@types/mime-types": "^2.1.4",
|
|
114
|
-
"@types/node": "^20.10.
|
|
115
|
-
"@types/react": "^18.2.
|
|
114
|
+
"@types/node": "^20.10.8",
|
|
115
|
+
"@types/react": "^18.2.47",
|
|
116
116
|
"@types/through2": "^2.0.41",
|
|
117
117
|
"@types/tough-cookie": "^4.0.5",
|
|
118
118
|
"@types/ua-parser-js": "^0.7.39",
|
|
119
119
|
"@types/vinyl-fs": "^3.0.5",
|
|
120
120
|
"@types/vscode": "^1.85.0",
|
|
121
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
122
|
-
"@typescript-eslint/parser": "^6.
|
|
121
|
+
"@typescript-eslint/eslint-plugin": "^6.18.1",
|
|
122
|
+
"@typescript-eslint/parser": "^6.18.1",
|
|
123
123
|
"eslint": "^8.56.0",
|
|
124
124
|
"eslint-plugin-react": "^7.33.2",
|
|
125
125
|
"eslint-plugin-xlint": "^1.0.11"
|
package/process.d.ts
CHANGED
|
@@ -65,6 +65,16 @@ export interface CallResult<TOutput extends string | Buffer = string> {
|
|
|
65
65
|
child: ChildProcess;
|
|
66
66
|
[inspect.custom](): string;
|
|
67
67
|
}
|
|
68
|
+
export interface CallError {
|
|
69
|
+
result: {
|
|
70
|
+
pid: number;
|
|
71
|
+
stdout: string;
|
|
72
|
+
stderr: string;
|
|
73
|
+
code: number;
|
|
74
|
+
signal: number | NodeJS.Signals;
|
|
75
|
+
child: ChildProcess;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
68
78
|
/** call process for result
|
|
69
79
|
- exe: .exe 路径或文件名 (建议使用路径,跳过 path 搜索,性能更高) path or filename (full path is recommanded to skip path searching for better perf)
|
|
70
80
|
- args: `[]` 参数列表 arguments list
|
package/server.js
CHANGED
|
@@ -109,18 +109,22 @@ export class Server {
|
|
|
109
109
|
// fpd_certs 文件夹下面的每个 .key 对应一个证书及域名
|
|
110
110
|
(await flist(fpd_certs, { print: false, filter: /\.key$/ }))
|
|
111
111
|
.map(async (fname) => {
|
|
112
|
-
|
|
112
|
+
let domain = fname.slice(0, -'.key'.length);
|
|
113
113
|
const [key, cert] = await Promise.all([
|
|
114
114
|
fname,
|
|
115
115
|
`${domain}.crt`,
|
|
116
116
|
].map(async (fname) => fread(`${fpd_certs}${fname}`, { print: false })));
|
|
117
|
+
if (domain.startsWith('star.'))
|
|
118
|
+
domain = `*.${domain.slice('star.'.length)}`;
|
|
117
119
|
return [domain, { key, cert }];
|
|
118
120
|
})));
|
|
119
121
|
const default_ctx = lazy_secure_ctxs[this.default_hostnames.find(hostname => hostname in lazy_secure_ctxs)];
|
|
120
122
|
assert(default_ctx);
|
|
121
123
|
this.http2_server = http2_create_server({
|
|
122
124
|
SNICallback(servername, callback) {
|
|
123
|
-
let lazy_ctx = lazy_secure_ctxs[servername] ||
|
|
125
|
+
let lazy_ctx = lazy_secure_ctxs[servername] ||
|
|
126
|
+
lazy_secure_ctxs[servername.replace(/^.*?\./, '*.')] ||
|
|
127
|
+
default_ctx;
|
|
124
128
|
callback(null, lazy_ctx.ctx ??= createSecureContext(lazy_ctx));
|
|
125
129
|
},
|
|
126
130
|
allowHTTP1: true,
|
package/utils.browser.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export declare function encode(str: string): Uint8Array;
|
|
|
56
56
|
在流式处理 (buffer 可能不完整) 时,应使用独立的 TextDecoder 实例调用 decode(buffer, { stream: true }) */
|
|
57
57
|
export declare function decode(buffer: Uint8Array): string;
|
|
58
58
|
/** 字符串字典序比较 */
|
|
59
|
-
export declare function strcmp(l: string, r: string):
|
|
59
|
+
export declare function strcmp(l: string, r: string): 0 | 1 | -1;
|
|
60
60
|
/** 比较 1.10.02 这种版本号 */
|
|
61
61
|
export declare function vercmp(l: string, r: string): number;
|
|
62
62
|
export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;
|
package/utils.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export declare function map_values<TValue, TNewValue>(obj: {
|
|
|
32
32
|
/** 映射对象中的 keys, 返回新对象 */
|
|
33
33
|
export declare function filter_keys<TObj>(obj: TObj, filter: (key: string) => any): TObj;
|
|
34
34
|
/** 字符串字典序比较 */
|
|
35
|
-
export declare function strcmp(l: string, r: string):
|
|
35
|
+
export declare function strcmp(l: string, r: string): 0 | 1 | -1;
|
|
36
36
|
/** 比较 1.10.02 这种版本号 */
|
|
37
37
|
export declare function vercmp(l: string, r: string): number;
|
|
38
38
|
export declare function get<TReturn = any>(obj: any, keypath: string): TReturn;
|