@meet-im/lxcli 0.0.6 → 0.0.7
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/commands/services/kb/descriptions.js +1 -0
- package/dist/commands/services/kb/handler.d.ts +2 -0
- package/dist/commands/services/kb/handler.js +29 -0
- package/dist/commands/services/kb/index.js +13 -0
- package/dist/commands/services/kb/params.js +6 -0
- package/dist/commands/services/kb/skill-metadata.js +1 -0
- package/package.json +1 -1
|
@@ -4,10 +4,12 @@ export interface KbCommandOptions {
|
|
|
4
4
|
task_id?: string;
|
|
5
5
|
title?: string;
|
|
6
6
|
project_id?: string;
|
|
7
|
+
iteration_id?: string;
|
|
7
8
|
file_id?: string;
|
|
8
9
|
owner_id?: string;
|
|
9
10
|
category_id?: string;
|
|
10
11
|
query?: string;
|
|
12
|
+
page?: string;
|
|
11
13
|
user_id?: string;
|
|
12
14
|
content?: string;
|
|
13
15
|
user?: string;
|
|
@@ -105,6 +105,34 @@ export function createKbAction(method) {
|
|
|
105
105
|
}
|
|
106
106
|
params = { project_id: projectId, query: options.query };
|
|
107
107
|
}
|
|
108
|
+
else if (method === 'searchSubtasks' && (options.project_id || options.iteration_id || options.user_id || options.page)) {
|
|
109
|
+
const projectId = options.project_id === undefined ? undefined : parseTaskId(options.project_id);
|
|
110
|
+
const iterationId = options.iteration_id === undefined ? undefined : parseTaskId(options.iteration_id);
|
|
111
|
+
const userId = options.user_id === undefined ? undefined : options.user_id === '0' ? 0 : parseTaskId(options.user_id);
|
|
112
|
+
const page = options.page === undefined ? undefined : parseTaskId(options.page);
|
|
113
|
+
if (projectId === null) {
|
|
114
|
+
outputCliError('PARAM_INVALID', '--project_id must be a positive integer');
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (iterationId === null) {
|
|
118
|
+
outputCliError('PARAM_INVALID', '--iteration_id must be a positive integer');
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (userId === null) {
|
|
122
|
+
outputCliError('PARAM_INVALID', '--user_id must be a non-negative integer');
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (page === null) {
|
|
126
|
+
outputCliError('PARAM_INVALID', '--page must be a positive integer');
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
params = {
|
|
130
|
+
...(projectId !== undefined ? { project_id: projectId } : {}),
|
|
131
|
+
...(iterationId !== undefined ? { iteration_id: iterationId } : {}),
|
|
132
|
+
...(userId !== undefined ? { user_id: userId } : {}),
|
|
133
|
+
...(page !== undefined ? { page } : {}),
|
|
134
|
+
};
|
|
135
|
+
}
|
|
108
136
|
else if (method === 'getAllActiveIterations' && options.project_id) {
|
|
109
137
|
const projectId = parseTaskId(options.project_id);
|
|
110
138
|
if (projectId === null) {
|
|
@@ -199,6 +227,7 @@ export function createKbAction(method) {
|
|
|
199
227
|
getTask: '--task_id',
|
|
200
228
|
createTask: '--title, --project_id, --owner_id and --category_id',
|
|
201
229
|
searchTasks: '--project_id and --query',
|
|
230
|
+
searchSubtasks: '--project_id, --iteration_id, --user_id, --page',
|
|
202
231
|
getAllActiveIterations: '--project_id',
|
|
203
232
|
getAllCategories: '--project_id',
|
|
204
233
|
getAllComments: '--task_id',
|
|
@@ -60,6 +60,18 @@ const kbService = {
|
|
|
60
60
|
.option('--user <user>', 'Specify user')
|
|
61
61
|
.option('--gateway <url>', 'Override kanboard gateway')
|
|
62
62
|
.action(createKbAction('searchTasks'));
|
|
63
|
+
// searchSubtasks 支持快捷参数 --project_id / --user_id / --page
|
|
64
|
+
cmd
|
|
65
|
+
.command('searchSubtasks')
|
|
66
|
+
.description(METHOD_DESCRIPTIONS.searchSubtasks)
|
|
67
|
+
.option('--params <json>', 'JSON/JSON5 params; CLI fills jsonrpc/method/id')
|
|
68
|
+
.option('--project_id <id>', 'Project ID (shortcut)')
|
|
69
|
+
.option('--iteration_id <id>', 'Iteration ID (shortcut)')
|
|
70
|
+
.option('--user_id <id>', 'User ID (shortcut)')
|
|
71
|
+
.option('--page <page>', 'Page number (shortcut)')
|
|
72
|
+
.option('--user <user>', 'Specify user')
|
|
73
|
+
.option('--gateway <url>', 'Override kanboard gateway')
|
|
74
|
+
.action(createKbAction('searchSubtasks'));
|
|
63
75
|
// getAllActiveIterations 支持快捷参数 --project_id
|
|
64
76
|
cmd
|
|
65
77
|
.command('getAllActiveIterations')
|
|
@@ -103,6 +115,7 @@ const kbService = {
|
|
|
103
115
|
item !== 'getTask' &&
|
|
104
116
|
item !== 'createTask' &&
|
|
105
117
|
item !== 'searchTasks' &&
|
|
118
|
+
item !== 'searchSubtasks' &&
|
|
106
119
|
item !== 'getAllActiveIterations' &&
|
|
107
120
|
item !== 'getAllCategories' &&
|
|
108
121
|
item !== 'getAllComments' &&
|
|
@@ -19,6 +19,12 @@ export const PARAM_DEFS = {
|
|
|
19
19
|
{ name: 'project_id', type: 'integer', required: true, description: '项目 ID。接口按项目检查查看权限。' },
|
|
20
20
|
{ name: 'query', type: 'string', required: true, description: 'Kanboard 搜索表达式,例如 iteration:456 status:1' },
|
|
21
21
|
],
|
|
22
|
+
searchSubtasks: [
|
|
23
|
+
{ name: 'project_id', type: 'integer', required: false, description: '项目 ID。传入后仅返回该项目下的子任务,并按项目检查查看权限;不传时仅在当前用户有权限查看的启用项目中查找。' },
|
|
24
|
+
{ name: 'iteration_id', type: 'integer', required: false, description: '迭代 ID。传入后仅返回所属需求在该迭代下的子任务;不传表示不限制迭代。' },
|
|
25
|
+
{ name: 'user_id', type: 'integer', required: false, description: '处理人 ID。传入后仅返回该处理人的子任务;不传或传 0 表示不限制处理人。' },
|
|
26
|
+
{ name: 'page', type: 'integer', required: false, description: '页码,从 1 开始,默认 1。每页固定最多 30 条,按页翻取。' },
|
|
27
|
+
],
|
|
22
28
|
getAllActiveIterations: [
|
|
23
29
|
{ name: 'project_id', type: 'integer', required: true, description: '项目 ID' },
|
|
24
30
|
],
|
|
@@ -2,6 +2,7 @@ export const METHOD_SHORTCUT_PARAMS = {
|
|
|
2
2
|
getTask: ['task_id'],
|
|
3
3
|
createTask: ['title', 'project_id', 'owner_id', 'category_id'],
|
|
4
4
|
searchTasks: ['project_id', 'query'],
|
|
5
|
+
searchSubtasks: ['project_id', 'iteration_id', 'user_id', 'page'],
|
|
5
6
|
getAllActiveIterations: ['project_id'],
|
|
6
7
|
getAllCategories: ['project_id'],
|
|
7
8
|
getAllComments: ['task_id'],
|