@meet-im/lxcli 0.0.9 → 0.0.11
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.
|
@@ -51,6 +51,7 @@ export const PARAM_DEFS = {
|
|
|
51
51
|
{ name: 'cc_id', type: 'array<string>', required: false, description: '抄送人列表。数组元素格式为 用户ID-用户名称,例如 ["22-Alice", "33-Bob"];未传时不设置抄送人。' },
|
|
52
52
|
{ name: 'is_bug', type: 'integer', required: false, description: '是否为 bug,1 表示 bug,0 表示需求' },
|
|
53
53
|
{ name: 'platform', type: 'string', required: false, description: 'bug 平台,例如 Server,未传时保存为空字符串' },
|
|
54
|
+
{ name: 'related_task_id', type: 'integer', required: false, description: '关联需求 ID。创建 bug 时可传入对应的需求 ID,建立 bug 与需求的关联;未传时不关联。' },
|
|
54
55
|
],
|
|
55
56
|
createSubtask: [
|
|
56
57
|
{ name: 'task_id', type: 'integer', required: true, description: '父需求/bug ID' },
|
|
@@ -75,6 +76,7 @@ export const PARAM_DEFS = {
|
|
|
75
76
|
{ name: 'reference', type: 'string', required: false, description: '外部引用编号' },
|
|
76
77
|
{ name: 'tags', type: 'array<string>', required: false, description: '标签列表,例如 ["Meet", "Sky", "Co"]' },
|
|
77
78
|
{ name: 'cc_id', type: 'array<string>', required: false, description: '抄送人列表。数组元素格式为 用户ID-用户名称,例如 ["22-Alice", "33-Bob"];传空数组 [] 表示清空抄送人,未传则保持不变。' },
|
|
79
|
+
{ name: 'related_task_id', type: 'integer', required: false, description: '修改 bug 时可传入要关联的需求 ID。仅当前任务是 bug 时生效;目标必须是已存在的需求(is_bug = 0)。' },
|
|
78
80
|
{ name: 'time_spent', type: 'number', required: false, description: '已花费时间' },
|
|
79
81
|
{ name: 'time_estimated', type: 'number', required: false, description: '预估时间' },
|
|
80
82
|
],
|
|
@@ -31,7 +31,7 @@ export async function jsonRpcCall(gateway, method, params, pat) {
|
|
|
31
31
|
const response = result.data;
|
|
32
32
|
// JSON-RPC 层错误
|
|
33
33
|
if (response.error) {
|
|
34
|
-
outputCliError('
|
|
34
|
+
outputCliError('API_ERROR', response.error.message, {
|
|
35
35
|
code: response.error.code,
|
|
36
36
|
data: response.error.data,
|
|
37
37
|
requestId,
|
|
@@ -41,7 +41,7 @@ export async function jsonRpcCall(gateway, method, params, pat) {
|
|
|
41
41
|
return undefined;
|
|
42
42
|
}
|
|
43
43
|
if (response.result === undefined) {
|
|
44
|
-
outputCliError('
|
|
44
|
+
outputCliError('API_ERROR', 'No result returned from Kanboard API', {
|
|
45
45
|
method,
|
|
46
46
|
params,
|
|
47
47
|
requestId,
|
package/dist/core/error.d.ts
CHANGED
|
@@ -62,8 +62,13 @@ export declare const CLI_ERROR_CODES: {
|
|
|
62
62
|
readonly reason: "networkError";
|
|
63
63
|
readonly exitCode: 5;
|
|
64
64
|
};
|
|
65
|
-
readonly
|
|
65
|
+
readonly API_ERROR: {
|
|
66
66
|
readonly code: 50002;
|
|
67
|
+
readonly reason: "apiError";
|
|
68
|
+
readonly exitCode: 1;
|
|
69
|
+
};
|
|
70
|
+
readonly UPGRADE_CHECK_FAILED: {
|
|
71
|
+
readonly code: 50003;
|
|
67
72
|
readonly reason: "upgradeCheckFailed";
|
|
68
73
|
readonly exitCode: 5;
|
|
69
74
|
};
|
|
@@ -111,6 +116,10 @@ export declare function getErrorMeta(key: CliErrorKey): {
|
|
|
111
116
|
readonly exitCode: 5;
|
|
112
117
|
} | {
|
|
113
118
|
readonly code: 50002;
|
|
119
|
+
readonly reason: "apiError";
|
|
120
|
+
readonly exitCode: 1;
|
|
121
|
+
} | {
|
|
122
|
+
readonly code: 50003;
|
|
114
123
|
readonly reason: "upgradeCheckFailed";
|
|
115
124
|
readonly exitCode: 5;
|
|
116
125
|
};
|
package/dist/core/error.js
CHANGED
|
@@ -23,7 +23,8 @@ export const CLI_ERROR_CODES = {
|
|
|
23
23
|
CONFIG_READ_ERROR: { code: 40001, reason: 'configReadError', exitCode: CLI_EXIT_CODES.INTERNAL },
|
|
24
24
|
CONFIG_WRITE_ERROR: { code: 40002, reason: 'configWriteError', exitCode: CLI_EXIT_CODES.INTERNAL },
|
|
25
25
|
NETWORK_ERROR: { code: 50001, reason: 'networkError', exitCode: CLI_EXIT_CODES.INTERNAL },
|
|
26
|
-
|
|
26
|
+
API_ERROR: { code: 50002, reason: 'apiError', exitCode: CLI_EXIT_CODES.GENERAL },
|
|
27
|
+
UPGRADE_CHECK_FAILED: { code: 50003, reason: 'upgradeCheckFailed', exitCode: CLI_EXIT_CODES.INTERNAL },
|
|
27
28
|
};
|
|
28
29
|
export function getErrorMeta(key) {
|
|
29
30
|
return CLI_ERROR_CODES[key];
|
package/dist/index.js
CHANGED