@bty/customer-service-cli 0.3.0 → 0.3.1
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/dist/bin.js +13 -2
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -12,6 +12,13 @@ function setRuntimeWorkspaceId(id) {
|
|
|
12
12
|
function getRuntimeWorkspaceId() {
|
|
13
13
|
return runtimeWorkspaceId;
|
|
14
14
|
}
|
|
15
|
+
var runtimeRequestTimeoutMs;
|
|
16
|
+
function setRuntimeRequestTimeoutMs(ms) {
|
|
17
|
+
runtimeRequestTimeoutMs = ms;
|
|
18
|
+
}
|
|
19
|
+
function getRuntimeRequestTimeoutMs() {
|
|
20
|
+
return runtimeRequestTimeoutMs;
|
|
21
|
+
}
|
|
15
22
|
|
|
16
23
|
// src/utils/output.ts
|
|
17
24
|
import Table from "cli-table3";
|
|
@@ -308,7 +315,7 @@ function createRequest(globalTimeout) {
|
|
|
308
315
|
const qs = params.toString();
|
|
309
316
|
if (qs) url += `?${qs}`;
|
|
310
317
|
}
|
|
311
|
-
const timeout = options.timeout ?? globalTimeout ??
|
|
318
|
+
const timeout = options.timeout ?? globalTimeout ?? getRuntimeRequestTimeoutMs() ?? 6e4;
|
|
312
319
|
const init = {
|
|
313
320
|
method: options.method,
|
|
314
321
|
headers,
|
|
@@ -3078,12 +3085,16 @@ var { version } = require2("../package.json");
|
|
|
3078
3085
|
var program = new Command();
|
|
3079
3086
|
program.name("cs-cli").description(
|
|
3080
3087
|
"BetterYeah AI \u5BA2\u670D\u5E73\u53F0 CLI\u3002\u6838\u5FC3\u6982\u5FF5\uFF1Aworkspace\uFF08\u5DE5\u4F5C\u7A7A\u95F4\uFF09\u2192 agent\uFF08AI \u5BA2\u670D\u673A\u5668\u4EBA\uFF09\u2192 SA/product/FAQ\uFF08\u77E5\u8BC6\u914D\u7F6E\uFF09\u2192 issue\uFF08\u5DE5\u5355\uFF09\u2192 debug\uFF08\u8C03\u8BD5\u9A8C\u8BC1\uFF09\u2192 monitor\uFF08\u8FD0\u8425\u76D1\u63A7\uFF09\u2192 repair-record\uFF08\u4FEE\u590D\u5BA1\u8BA1\uFF09\u3002\u6240\u6709\u547D\u4EE4\u9ED8\u8BA4\u8F93\u51FA JSON\uFF0C\u8FFD\u52A0 --table \u53EF\u5207\u6362\u4E3A\u4EBA\u7C7B\u53EF\u8BFB\u8868\u683C"
|
|
3081
|
-
).version(version).option("--table", "\u4EE5\u8868\u683C\u5F62\u5F0F\u8F93\u51FA\uFF08\u9ED8\u8BA4 JSON\uFF09\u3002\u4EBA\u5DE5\u67E5\u770B\u65F6\u4F7F\u7528", false).option("--workspace <id>", "\u4E34\u65F6\u8986\u76D6\u9ED8\u8BA4\u5DE5\u4F5C\u7A7A\u95F4 ID\uFF0C\u4E0D\u4FEE\u6539\u6301\u4E45\u5316\u914D\u7F6E").option("--timeout <ms>", "\u8BF7\u6C42\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09\uFF0C\u590D\u6742 Agent \u56DE\u590D\u5EFA\u8BAE\u8C03\u9AD8", "
|
|
3088
|
+
).version(version).option("--table", "\u4EE5\u8868\u683C\u5F62\u5F0F\u8F93\u51FA\uFF08\u9ED8\u8BA4 JSON\uFF09\u3002\u4EBA\u5DE5\u67E5\u770B\u65F6\u4F7F\u7528", false).option("--workspace <id>", "\u4E34\u65F6\u8986\u76D6\u9ED8\u8BA4\u5DE5\u4F5C\u7A7A\u95F4 ID\uFF0C\u4E0D\u4FEE\u6539\u6301\u4E45\u5316\u914D\u7F6E").option("--timeout <ms>", "\u8BF7\u6C42\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09\uFF0C\u590D\u6742 Agent \u56DE\u590D\u5EFA\u8BAE\u8C03\u9AD8", "60000");
|
|
3082
3089
|
program.hook("preAction", (thisCommand) => {
|
|
3083
3090
|
const opts = thisCommand.opts();
|
|
3084
3091
|
if (opts.workspace) {
|
|
3085
3092
|
setRuntimeWorkspaceId(opts.workspace);
|
|
3086
3093
|
}
|
|
3094
|
+
const timeoutMs = Number(opts.timeout);
|
|
3095
|
+
if (Number.isFinite(timeoutMs) && timeoutMs > 0) {
|
|
3096
|
+
setRuntimeRequestTimeoutMs(timeoutMs);
|
|
3097
|
+
}
|
|
3087
3098
|
});
|
|
3088
3099
|
program.hook("postAction", async () => {
|
|
3089
3100
|
const message = await checkForUpdate(version);
|