lansenger-cli 1.0.0 → 1.0.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/README.md +395 -0
- package/dist/commands/calendar.js +153 -67
- package/dist/commands/callback.js +73 -22
- package/dist/commands/chat.js +26 -6
- package/dist/commands/config.js +30 -14
- package/dist/commands/department.js +20 -16
- package/dist/commands/group.js +66 -43
- package/dist/commands/media.js +41 -18
- package/dist/commands/message.js +278 -132
- package/dist/commands/oauth.js +36 -15
- package/dist/commands/staff.js +55 -37
- package/dist/commands/streaming.js +9 -9
- package/dist/commands/todo.js +142 -69
- package/dist/main.js +1 -1
- package/package.json +3 -3
package/dist/commands/staff.js
CHANGED
|
@@ -3,83 +3,101 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.registerStaffCommands = registerStaffCommands;
|
|
4
4
|
const utils_1 = require("../utils");
|
|
5
5
|
function registerStaffCommands(program) {
|
|
6
|
-
const cmd = program.command("staff").description("Query staff/
|
|
6
|
+
const cmd = program.command("staff").description("Query staff/contacts information");
|
|
7
7
|
cmd
|
|
8
8
|
.command("basic-info")
|
|
9
9
|
.description("Fetch basic staff info")
|
|
10
|
-
.
|
|
11
|
-
.option("--user-token <token>", "User token")
|
|
12
|
-
.action(async (opts) => {
|
|
10
|
+
.argument("<staffId>", "Staff ID")
|
|
11
|
+
.option("--user-token <token>", "User token", "")
|
|
12
|
+
.action(async (staffId, opts) => {
|
|
13
13
|
const client = (0, utils_1.getClient)();
|
|
14
|
-
const result = await client.fetchStaffBasicInfo(
|
|
14
|
+
const result = await client.fetchStaffBasicInfo(staffId, { user_token: opts.userToken || undefined });
|
|
15
15
|
(0, utils_1.checkError)(result);
|
|
16
16
|
(0, utils_1.outputResult)(result);
|
|
17
17
|
});
|
|
18
18
|
cmd
|
|
19
19
|
.command("detail")
|
|
20
20
|
.description("Fetch detailed staff info")
|
|
21
|
-
.
|
|
22
|
-
.option("--user-token <token>", "User token")
|
|
23
|
-
.action(async (opts) => {
|
|
21
|
+
.argument("<staffId>", "Staff ID")
|
|
22
|
+
.option("--user-token <token>", "User token", "")
|
|
23
|
+
.action(async (staffId, opts) => {
|
|
24
24
|
const client = (0, utils_1.getClient)();
|
|
25
|
-
const result = await client.fetchStaffDetail(
|
|
25
|
+
const result = await client.fetchStaffDetail(staffId, { user_token: opts.userToken || undefined });
|
|
26
26
|
(0, utils_1.checkError)(result);
|
|
27
27
|
(0, utils_1.outputResult)(result);
|
|
28
28
|
});
|
|
29
29
|
cmd
|
|
30
30
|
.command("ancestors")
|
|
31
31
|
.description("Fetch department ancestors for a staff member")
|
|
32
|
-
.
|
|
33
|
-
.option("--user-token <token>", "User token")
|
|
34
|
-
.action(async (opts) => {
|
|
32
|
+
.argument("<staffId>", "Staff ID")
|
|
33
|
+
.option("--user-token <token>", "User token", "")
|
|
34
|
+
.action(async (staffId, opts) => {
|
|
35
35
|
const client = (0, utils_1.getClient)();
|
|
36
|
-
const result = await client.fetchDepartmentAncestors(
|
|
36
|
+
const result = await client.fetchDepartmentAncestors(staffId, { user_token: opts.userToken || undefined });
|
|
37
37
|
(0, utils_1.checkError)(result);
|
|
38
38
|
(0, utils_1.outputResult)(result);
|
|
39
39
|
});
|
|
40
40
|
cmd
|
|
41
41
|
.command("id-mapping")
|
|
42
42
|
.description("Map an ID (phone/email/etc.) to a staff ID")
|
|
43
|
-
.
|
|
44
|
-
.
|
|
45
|
-
.
|
|
46
|
-
.option("--user-token <token>", "User token")
|
|
47
|
-
.action(async (opts) => {
|
|
43
|
+
.argument("<orgId>", "Organization ID")
|
|
44
|
+
.argument("<idType>", "ID type: phone, email, login_name, external_id")
|
|
45
|
+
.argument("<idValue>", "ID value to map")
|
|
46
|
+
.option("--user-token <token>", "User token", "")
|
|
47
|
+
.action(async (orgId, idType, idValue, opts) => {
|
|
48
48
|
const client = (0, utils_1.getClient)();
|
|
49
|
-
const result = await client.fetchStaffIdMapping(
|
|
49
|
+
const result = await client.fetchStaffIdMapping(orgId, idType, idValue, { user_token: opts.userToken || undefined });
|
|
50
50
|
(0, utils_1.checkError)(result);
|
|
51
51
|
(0, utils_1.outputResult)(result);
|
|
52
52
|
});
|
|
53
53
|
cmd
|
|
54
|
-
.command("
|
|
55
|
-
.description("
|
|
56
|
-
.
|
|
57
|
-
.option("--user-token <token>", "User token")
|
|
58
|
-
.
|
|
54
|
+
.command("org-extra-fields")
|
|
55
|
+
.description("Fetch organization extra field IDs")
|
|
56
|
+
.argument("<orgId>", "Organization ID")
|
|
57
|
+
.option("--user-token <token>", "User token", "")
|
|
58
|
+
.option("-p, --page <page>", "Page number", "1")
|
|
59
|
+
.option("-s, --size <size>", "Page size", "1000")
|
|
60
|
+
.action(async (orgId, opts) => {
|
|
59
61
|
const client = (0, utils_1.getClient)();
|
|
60
|
-
const result = await client.
|
|
62
|
+
const result = await client.fetchOrgExtraFieldIds(orgId, {
|
|
63
|
+
user_token: opts.userToken || undefined,
|
|
64
|
+
page: parseInt(opts.page),
|
|
65
|
+
page_size: parseInt(opts.size),
|
|
66
|
+
});
|
|
61
67
|
(0, utils_1.checkError)(result);
|
|
62
68
|
(0, utils_1.outputResult)(result);
|
|
63
69
|
});
|
|
64
70
|
cmd
|
|
65
|
-
.command("
|
|
66
|
-
.description("
|
|
67
|
-
.
|
|
68
|
-
.option("--user-token <token>", "User token")
|
|
69
|
-
.
|
|
71
|
+
.command("search")
|
|
72
|
+
.description("Search staff by keyword")
|
|
73
|
+
.argument("<keyword>", "Search keyword")
|
|
74
|
+
.option("--user-token <token>", "User token", "")
|
|
75
|
+
.option("--user-id <userId>", "User ID context", "")
|
|
76
|
+
.option("--recursive/--no-recursive", "Recursive search", true)
|
|
77
|
+
.option("--sector <ids...>", "Sector IDs, space-separated")
|
|
78
|
+
.option("-p, --page <page>", "Page number")
|
|
79
|
+
.option("-s, --size <size>", "Page size")
|
|
80
|
+
.action(async (keyword, opts) => {
|
|
70
81
|
const client = (0, utils_1.getClient)();
|
|
71
|
-
const result = await client.
|
|
82
|
+
const result = await client.searchStaff(keyword, {
|
|
83
|
+
user_token: opts.userToken || undefined,
|
|
84
|
+
user_id: opts.userId || undefined,
|
|
85
|
+
recursive: opts.recursive,
|
|
86
|
+
sector_ids: opts.sector || undefined,
|
|
87
|
+
page: opts.page ? parseInt(opts.page) : undefined,
|
|
88
|
+
page_size: opts.size ? parseInt(opts.size) : undefined,
|
|
89
|
+
});
|
|
72
90
|
(0, utils_1.checkError)(result);
|
|
73
91
|
(0, utils_1.outputResult)(result);
|
|
74
92
|
});
|
|
75
93
|
cmd
|
|
76
|
-
.command("org-
|
|
77
|
-
.description("Fetch organization
|
|
78
|
-
.
|
|
79
|
-
.option("--user-token <token>", "User token")
|
|
80
|
-
.action(async (opts) => {
|
|
94
|
+
.command("org-info")
|
|
95
|
+
.description("Fetch organization info")
|
|
96
|
+
.argument("<orgId>", "Organization ID")
|
|
97
|
+
.option("--user-token <token>", "User token", "")
|
|
98
|
+
.action(async (orgId, opts) => {
|
|
81
99
|
const client = (0, utils_1.getClient)();
|
|
82
|
-
const result = await client.
|
|
100
|
+
const result = await client.fetchOrgInfo(orgId, { user_token: opts.userToken || undefined });
|
|
83
101
|
(0, utils_1.checkError)(result);
|
|
84
102
|
(0, utils_1.outputResult)(result);
|
|
85
103
|
});
|
|
@@ -3,26 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.registerStreamingCommands = registerStreamingCommands;
|
|
4
4
|
const utils_1 = require("../utils");
|
|
5
5
|
function registerStreamingCommands(program) {
|
|
6
|
-
const cmd = program.command("streaming").description("
|
|
6
|
+
const cmd = program.command("streaming").description("Streaming message operations (for AI agent progressive output)");
|
|
7
7
|
cmd
|
|
8
8
|
.command("create")
|
|
9
9
|
.description("Create a stream message session")
|
|
10
|
-
.
|
|
11
|
-
.
|
|
12
|
-
.
|
|
13
|
-
.action(async (
|
|
10
|
+
.argument("<receiverId>", "Receiver ID")
|
|
11
|
+
.argument("<receiverType>", "Receiver type: single or group")
|
|
12
|
+
.argument("<streamId>", "Stream ID (unique per session)")
|
|
13
|
+
.action(async (receiverId, receiverType, streamId) => {
|
|
14
14
|
const client = (0, utils_1.getClient)();
|
|
15
|
-
const result = await client.createStreamMessage(
|
|
15
|
+
const result = await client.createStreamMessage(receiverId, receiverType, streamId);
|
|
16
16
|
(0, utils_1.checkError)(result);
|
|
17
17
|
(0, utils_1.outputResult)(result);
|
|
18
18
|
});
|
|
19
19
|
cmd
|
|
20
20
|
.command("fetch")
|
|
21
21
|
.description("Fetch stream message status")
|
|
22
|
-
.
|
|
23
|
-
.action(async (
|
|
22
|
+
.argument("<msgId>", "Message ID of the stream message")
|
|
23
|
+
.action(async (msgId) => {
|
|
24
24
|
const client = (0, utils_1.getClient)();
|
|
25
|
-
const result = await client.fetchStreamMessage(
|
|
25
|
+
const result = await client.fetchStreamMessage(msgId);
|
|
26
26
|
(0, utils_1.checkError)(result);
|
|
27
27
|
(0, utils_1.outputResult)(result);
|
|
28
28
|
});
|
package/dist/commands/todo.js
CHANGED
|
@@ -7,115 +7,181 @@ function registerTodoCommands(program) {
|
|
|
7
7
|
cmd
|
|
8
8
|
.command("create")
|
|
9
9
|
.description("Create a todo task")
|
|
10
|
-
.
|
|
11
|
-
.
|
|
12
|
-
.
|
|
13
|
-
.
|
|
14
|
-
.
|
|
15
|
-
.option("--type <type>", "
|
|
16
|
-
.
|
|
10
|
+
.argument("<title>", "Task title")
|
|
11
|
+
.argument("<link>", "Task link URL")
|
|
12
|
+
.argument("<pcLink>", "PC link URL")
|
|
13
|
+
.argument("<executorIds>", "Executor IDs as comma-separated list")
|
|
14
|
+
.argument("<orgId>", "Organization ID")
|
|
15
|
+
.option("-t, --type <type>", "1=notification, 2=approval", "1")
|
|
16
|
+
.option("--source-id <sourceId>", "Source ID", "")
|
|
17
|
+
.option("-d, --desc <desc>", "Task description", "")
|
|
18
|
+
.option("--sender-id <senderId>", "Sender staff ID", "")
|
|
19
|
+
.option("--user-token <token>", "User token", "")
|
|
20
|
+
.action(async (title, link, pcLink, executorIds, orgId, opts) => {
|
|
17
21
|
const client = (0, utils_1.getClient)();
|
|
18
|
-
const
|
|
19
|
-
const result = await client.createTodoTask(
|
|
22
|
+
const ids = (0, utils_1.commaList)(executorIds);
|
|
23
|
+
const result = await client.createTodoTask(title, link, pcLink, ids, orgId, parseInt(opts.type), {
|
|
24
|
+
source_id: opts.sourceId || undefined,
|
|
25
|
+
desc: opts.desc || undefined,
|
|
26
|
+
sender_id: opts.senderId || undefined,
|
|
27
|
+
user_token: opts.userToken || undefined,
|
|
28
|
+
});
|
|
20
29
|
(0, utils_1.checkError)(result);
|
|
21
30
|
(0, utils_1.outputResult)(result);
|
|
22
31
|
});
|
|
23
32
|
cmd
|
|
24
33
|
.command("update")
|
|
25
34
|
.description("Update a todo task")
|
|
26
|
-
.
|
|
27
|
-
.
|
|
28
|
-
.
|
|
29
|
-
.
|
|
30
|
-
.
|
|
31
|
-
.
|
|
35
|
+
.argument("<todotaskId>", "Todo task ID")
|
|
36
|
+
.argument("<title>", "New title")
|
|
37
|
+
.argument("<link>", "New link URL")
|
|
38
|
+
.argument("<pcLink>", "New PC link URL")
|
|
39
|
+
.argument("<orgId>", "Organization ID")
|
|
40
|
+
.option("-d, --desc <desc>", "New description", "")
|
|
41
|
+
.option("--user-token <token>", "User token", "")
|
|
42
|
+
.action(async (todotaskId, title, link, pcLink, orgId, opts) => {
|
|
32
43
|
const client = (0, utils_1.getClient)();
|
|
33
|
-
const result = await client.updateTodoTask(
|
|
44
|
+
const result = await client.updateTodoTask(todotaskId, title, link, pcLink, orgId, {
|
|
45
|
+
desc: opts.desc || undefined,
|
|
46
|
+
user_token: opts.userToken || undefined,
|
|
47
|
+
});
|
|
34
48
|
(0, utils_1.checkError)(result);
|
|
35
49
|
(0, utils_1.outputResult)(result);
|
|
36
50
|
});
|
|
37
51
|
cmd
|
|
38
52
|
.command("update-status")
|
|
39
53
|
.description("Update todo task status")
|
|
40
|
-
.
|
|
41
|
-
.
|
|
42
|
-
.
|
|
43
|
-
.
|
|
54
|
+
.argument("<todotaskId>", "Todo task ID")
|
|
55
|
+
.argument("<status>", "Status: 11=pending read, 12=read, 21=pending do, 22=done")
|
|
56
|
+
.argument("<orgId>", "Organization ID")
|
|
57
|
+
.option("--staff-id <staffId>", "Staff ID", "")
|
|
58
|
+
.option("--user-token <token>", "User token", "")
|
|
59
|
+
.action(async (todotaskId, status, orgId, opts) => {
|
|
44
60
|
const client = (0, utils_1.getClient)();
|
|
45
|
-
const result = await client.updateTodoTaskStatus(
|
|
61
|
+
const result = await client.updateTodoTaskStatus(todotaskId, status, orgId, {
|
|
62
|
+
staff_id: opts.staffId || undefined,
|
|
63
|
+
user_token: opts.userToken || undefined,
|
|
64
|
+
});
|
|
46
65
|
(0, utils_1.checkError)(result);
|
|
47
66
|
(0, utils_1.outputResult)(result);
|
|
48
67
|
});
|
|
49
68
|
cmd
|
|
50
69
|
.command("delete")
|
|
51
70
|
.description("Delete a todo task")
|
|
52
|
-
.
|
|
53
|
-
.
|
|
54
|
-
.
|
|
71
|
+
.argument("<todotaskId>", "Todo task ID")
|
|
72
|
+
.argument("<orgId>", "Organization ID")
|
|
73
|
+
.option("--staff-id <staffId>", "Staff ID", "")
|
|
74
|
+
.option("--user-token <token>", "User token", "")
|
|
75
|
+
.action(async (todotaskId, orgId, opts) => {
|
|
55
76
|
const client = (0, utils_1.getClient)();
|
|
56
|
-
const result = await client.deleteTodoTask(
|
|
77
|
+
const result = await client.deleteTodoTask(todotaskId, orgId, {
|
|
78
|
+
staff_id: opts.staffId || undefined,
|
|
79
|
+
user_token: opts.userToken || undefined,
|
|
80
|
+
});
|
|
57
81
|
(0, utils_1.checkError)(result);
|
|
58
82
|
(0, utils_1.outputResult)(result);
|
|
59
83
|
});
|
|
60
84
|
cmd
|
|
61
85
|
.command("list")
|
|
62
86
|
.description("List todo tasks for an organization")
|
|
63
|
-
.
|
|
64
|
-
.option("--user-token <token>", "User token")
|
|
65
|
-
.
|
|
87
|
+
.argument("<orgId>", "Organization ID")
|
|
88
|
+
.option("--user-token <token>", "User token", "")
|
|
89
|
+
.option("--app-ids <ids>", "App IDs (comma-separated)")
|
|
90
|
+
.option("--staff-id <staffId>", "Staff ID", "")
|
|
91
|
+
.option("--status <ids>", "Status list (comma-separated)")
|
|
92
|
+
.action(async (orgId, opts) => {
|
|
66
93
|
const client = (0, utils_1.getClient)();
|
|
67
|
-
const
|
|
94
|
+
const appIdsList = opts.appIds ? (0, utils_1.commaList)(opts.appIds) : undefined;
|
|
95
|
+
const statusListParsed = opts.status ? (0, utils_1.commaList)(opts.status) : undefined;
|
|
96
|
+
const result = await client.fetchTodoTaskList(orgId, {
|
|
97
|
+
user_token: opts.userToken || undefined,
|
|
98
|
+
app_ids: appIdsList,
|
|
99
|
+
staff_id: opts.staffId || undefined,
|
|
100
|
+
status_list: statusListParsed,
|
|
101
|
+
});
|
|
68
102
|
(0, utils_1.checkError)(result);
|
|
69
103
|
(0, utils_1.outputResult)(result);
|
|
70
104
|
});
|
|
71
105
|
cmd
|
|
72
|
-
.command("fetch-by-
|
|
73
|
-
.description("Fetch a todo task by ID")
|
|
74
|
-
.
|
|
75
|
-
.
|
|
76
|
-
.option("--
|
|
77
|
-
.
|
|
106
|
+
.command("fetch-by-source")
|
|
107
|
+
.description("Fetch a todo task by source ID")
|
|
108
|
+
.argument("<sourceId>", "Source ID")
|
|
109
|
+
.argument("<orgId>", "Organization ID")
|
|
110
|
+
.option("--staff-id <staffId>", "Staff ID", "")
|
|
111
|
+
.option("--user-token <token>", "User token", "")
|
|
112
|
+
.action(async (sourceId, orgId, opts) => {
|
|
78
113
|
const client = (0, utils_1.getClient)();
|
|
79
|
-
const result = await client.
|
|
114
|
+
const result = await client.fetchTodoTaskBySourceId(sourceId, orgId, {
|
|
115
|
+
staff_id: opts.staffId || undefined,
|
|
116
|
+
user_token: opts.userToken || undefined,
|
|
117
|
+
});
|
|
80
118
|
(0, utils_1.checkError)(result);
|
|
81
119
|
(0, utils_1.outputResult)(result);
|
|
82
120
|
});
|
|
83
121
|
cmd
|
|
84
|
-
.command("fetch-by-
|
|
85
|
-
.description("Fetch a todo task by
|
|
86
|
-
.
|
|
87
|
-
.
|
|
88
|
-
.option("--
|
|
89
|
-
.
|
|
122
|
+
.command("fetch-by-id")
|
|
123
|
+
.description("Fetch a todo task by ID")
|
|
124
|
+
.argument("<todotaskId>", "Todo task ID")
|
|
125
|
+
.argument("<orgId>", "Organization ID")
|
|
126
|
+
.option("--staff-id <staffId>", "Staff ID", "")
|
|
127
|
+
.option("--user-token <token>", "User token", "")
|
|
128
|
+
.action(async (todotaskId, orgId, opts) => {
|
|
90
129
|
const client = (0, utils_1.getClient)();
|
|
91
|
-
const result = await client.
|
|
130
|
+
const result = await client.fetchTodoTaskById(todotaskId, orgId, {
|
|
131
|
+
staff_id: opts.staffId || undefined,
|
|
132
|
+
user_token: opts.userToken || undefined,
|
|
133
|
+
});
|
|
92
134
|
(0, utils_1.checkError)(result);
|
|
93
135
|
(0, utils_1.outputResult)(result);
|
|
94
136
|
});
|
|
95
137
|
cmd
|
|
96
138
|
.command("status-counts")
|
|
97
139
|
.description("Fetch todo task status counts")
|
|
98
|
-
.
|
|
99
|
-
.
|
|
100
|
-
.option("--
|
|
101
|
-
.
|
|
140
|
+
.argument("<staffId>", "Staff ID")
|
|
141
|
+
.argument("<orgId>", "Organization ID")
|
|
142
|
+
.option("--app-id <appId>", "App ID", "")
|
|
143
|
+
.option("--status <ids>", "Status list (comma-separated)")
|
|
144
|
+
.option("--user-token <token>", "User token", "")
|
|
145
|
+
.action(async (staffId, orgId, opts) => {
|
|
146
|
+
const client = (0, utils_1.getClient)();
|
|
147
|
+
const statusParsed = opts.status ? (0, utils_1.commaList)(opts.status) : undefined;
|
|
148
|
+
const result = await client.fetchTodoTaskStatusCounts(staffId, orgId, {
|
|
149
|
+
app_id: opts.appId || undefined,
|
|
150
|
+
status_list: statusParsed,
|
|
151
|
+
user_token: opts.userToken || undefined,
|
|
152
|
+
});
|
|
153
|
+
(0, utils_1.checkError)(result);
|
|
154
|
+
(0, utils_1.outputResult)(result);
|
|
155
|
+
});
|
|
156
|
+
cmd
|
|
157
|
+
.command("executor-status")
|
|
158
|
+
.description("Update executor status list for a todo task")
|
|
159
|
+
.argument("<executorStatusList>", "Executor status list as JSON: '[{\"executorId\":\"x\",\"status\":\"22\"}]'")
|
|
160
|
+
.argument("<orgId>", "Organization ID")
|
|
161
|
+
.option("--task-id <taskId>", "Todo task ID", "")
|
|
162
|
+
.option("--user-token <token>", "User token", "")
|
|
163
|
+
.action(async (executorStatusList, orgId, opts) => {
|
|
102
164
|
const client = (0, utils_1.getClient)();
|
|
103
|
-
const
|
|
165
|
+
const parsed = (0, utils_1.parseJsonOption)(executorStatusList);
|
|
166
|
+
const result = await client.updateExecutorStatus(parsed, orgId, {
|
|
167
|
+
todotask_id: opts.taskId || undefined,
|
|
168
|
+
user_token: opts.userToken || undefined,
|
|
169
|
+
});
|
|
104
170
|
(0, utils_1.checkError)(result);
|
|
105
171
|
(0, utils_1.outputResult)(result);
|
|
106
172
|
});
|
|
107
173
|
cmd
|
|
108
174
|
.command("add-executors")
|
|
109
175
|
.description("Add executors to a todo task")
|
|
110
|
-
.
|
|
111
|
-
.
|
|
112
|
-
.option("--
|
|
113
|
-
.option("--user-token <token>", "User token")
|
|
114
|
-
.action(async (opts) => {
|
|
176
|
+
.argument("<executorIds>", "Executor IDs (comma-separated)")
|
|
177
|
+
.argument("<orgId>", "Organization ID")
|
|
178
|
+
.option("--task-id <taskId>", "Todo task ID", "")
|
|
179
|
+
.option("--user-token <token>", "User token", "")
|
|
180
|
+
.action(async (executorIds, orgId, opts) => {
|
|
115
181
|
const client = (0, utils_1.getClient)();
|
|
116
|
-
const
|
|
117
|
-
const result = await client.addExecutors(
|
|
118
|
-
todotask_id: opts.
|
|
182
|
+
const ids = (0, utils_1.commaList)(executorIds);
|
|
183
|
+
const result = await client.addExecutors(ids, orgId, {
|
|
184
|
+
todotask_id: opts.taskId || undefined,
|
|
119
185
|
user_token: opts.userToken || undefined,
|
|
120
186
|
});
|
|
121
187
|
(0, utils_1.checkError)(result);
|
|
@@ -124,15 +190,15 @@ function registerTodoCommands(program) {
|
|
|
124
190
|
cmd
|
|
125
191
|
.command("delete-executors")
|
|
126
192
|
.description("Remove executors from a todo task")
|
|
127
|
-
.
|
|
128
|
-
.
|
|
129
|
-
.option("--
|
|
130
|
-
.option("--user-token <token>", "User token")
|
|
131
|
-
.action(async (opts) => {
|
|
193
|
+
.argument("<executorIds>", "Executor IDs (comma-separated)")
|
|
194
|
+
.argument("<orgId>", "Organization ID")
|
|
195
|
+
.option("--task-id <taskId>", "Todo task ID", "")
|
|
196
|
+
.option("--user-token <token>", "User token", "")
|
|
197
|
+
.action(async (executorIds, orgId, opts) => {
|
|
132
198
|
const client = (0, utils_1.getClient)();
|
|
133
|
-
const
|
|
134
|
-
const result = await client.deleteExecutors(
|
|
135
|
-
todotask_id: opts.
|
|
199
|
+
const ids = (0, utils_1.commaList)(executorIds);
|
|
200
|
+
const result = await client.deleteExecutors(ids, orgId, {
|
|
201
|
+
todotask_id: opts.taskId || undefined,
|
|
136
202
|
user_token: opts.userToken || undefined,
|
|
137
203
|
});
|
|
138
204
|
(0, utils_1.checkError)(result);
|
|
@@ -141,12 +207,19 @@ function registerTodoCommands(program) {
|
|
|
141
207
|
cmd
|
|
142
208
|
.command("executor-list")
|
|
143
209
|
.description("List executors of a todo task")
|
|
144
|
-
.
|
|
145
|
-
.
|
|
146
|
-
.option("--
|
|
147
|
-
.
|
|
210
|
+
.argument("<todotaskId>", "Todo task ID")
|
|
211
|
+
.argument("<orgId>", "Organization ID")
|
|
212
|
+
.option("--staff-id <staffId>", "Staff ID", "")
|
|
213
|
+
.option("--status <ids>", "Status list (comma-separated)")
|
|
214
|
+
.option("--user-token <token>", "User token", "")
|
|
215
|
+
.action(async (todotaskId, orgId, opts) => {
|
|
148
216
|
const client = (0, utils_1.getClient)();
|
|
149
|
-
const
|
|
217
|
+
const statusParsed = opts.status ? (0, utils_1.commaList)(opts.status) : undefined;
|
|
218
|
+
const result = await client.fetchExecutorList(todotaskId, orgId, {
|
|
219
|
+
staff_id: opts.staffId || undefined,
|
|
220
|
+
status_list: statusParsed,
|
|
221
|
+
user_token: opts.userToken || undefined,
|
|
222
|
+
});
|
|
150
223
|
(0, utils_1.checkError)(result);
|
|
151
224
|
(0, utils_1.outputResult)(result);
|
|
152
225
|
});
|
package/dist/main.js
CHANGED
|
@@ -18,7 +18,7 @@ const chat_1 = require("./commands/chat");
|
|
|
18
18
|
const health_1 = require("./commands/health");
|
|
19
19
|
const program = new commander_1.Command();
|
|
20
20
|
program
|
|
21
|
-
.name("lansenger
|
|
21
|
+
.name("lansenger")
|
|
22
22
|
.description("CLI for Lansenger (蓝信) — send messages, manage groups, staff, departments, calendars, todos, and more")
|
|
23
23
|
.version("1.0.0")
|
|
24
24
|
.option("-j, --json", "Output as JSON", false)
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lansenger-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "CLI for Lansenger (蓝信) — send messages, manage groups, staff, departments, calendars, todos, and more",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"lansenger
|
|
7
|
+
"lansenger": "dist/main.js"
|
|
8
8
|
},
|
|
9
9
|
"engines": {
|
|
10
10
|
"node": ">=18.0.0"
|
|
@@ -30,4 +30,4 @@
|
|
|
30
30
|
"typescript": "^5.0.0"
|
|
31
31
|
},
|
|
32
32
|
"license": "MIT"
|
|
33
|
-
}
|
|
33
|
+
}
|