dingtalk-mcp-server 0.1.0
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/LICENSE +21 -0
- package/README.md +256 -0
- package/dist/handlers/calendar.d.ts +8 -0
- package/dist/handlers/calendar.d.ts.map +1 -0
- package/dist/handlers/calendar.js +44 -0
- package/dist/handlers/calendar.js.map +1 -0
- package/dist/handlers/messages.d.ts +8 -0
- package/dist/handlers/messages.d.ts.map +1 -0
- package/dist/handlers/messages.js +46 -0
- package/dist/handlers/messages.js.map +1 -0
- package/dist/handlers/todo.d.ts +8 -0
- package/dist/handlers/todo.d.ts.map +1 -0
- package/dist/handlers/todo.js +52 -0
- package/dist/handlers/todo.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +11 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +110 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/calendar.d.ts +77 -0
- package/dist/tools/calendar.d.ts.map +1 -0
- package/dist/tools/calendar.js +71 -0
- package/dist/tools/calendar.js.map +1 -0
- package/dist/tools/messages.d.ts +81 -0
- package/dist/tools/messages.d.ts.map +1 -0
- package/dist/tools/messages.js +69 -0
- package/dist/tools/messages.js.map +1 -0
- package/dist/tools/todo.d.ts +91 -0
- package/dist/tools/todo.d.ts.map +1 -0
- package/dist/tools/todo.js +76 -0
- package/dist/tools/todo.js.map +1 -0
- package/dist/utils/dingtalk.d.ts +86 -0
- package/dist/utils/dingtalk.d.ts.map +1 -0
- package/dist/utils/dingtalk.js +193 -0
- package/dist/utils/dingtalk.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 日程工具定义
|
|
3
|
+
*/
|
|
4
|
+
export declare const calendarTools: ({
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
inputSchema: {
|
|
8
|
+
type: string;
|
|
9
|
+
properties: {
|
|
10
|
+
summary: {
|
|
11
|
+
type: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
description: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
startTime: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
endTime: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
organizerUserid: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
attendeeUserids: {
|
|
31
|
+
type: string;
|
|
32
|
+
items: {
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
location: {
|
|
38
|
+
type: string;
|
|
39
|
+
description: string;
|
|
40
|
+
};
|
|
41
|
+
reminder: {
|
|
42
|
+
type: string;
|
|
43
|
+
description: string;
|
|
44
|
+
};
|
|
45
|
+
userid?: undefined;
|
|
46
|
+
};
|
|
47
|
+
required: string[];
|
|
48
|
+
};
|
|
49
|
+
} | {
|
|
50
|
+
name: string;
|
|
51
|
+
description: string;
|
|
52
|
+
inputSchema: {
|
|
53
|
+
type: string;
|
|
54
|
+
properties: {
|
|
55
|
+
userid: {
|
|
56
|
+
type: string;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
startTime: {
|
|
60
|
+
type: string;
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
endTime: {
|
|
64
|
+
type: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
summary?: undefined;
|
|
68
|
+
description?: undefined;
|
|
69
|
+
organizerUserid?: undefined;
|
|
70
|
+
attendeeUserids?: undefined;
|
|
71
|
+
location?: undefined;
|
|
72
|
+
reminder?: undefined;
|
|
73
|
+
};
|
|
74
|
+
required: string[];
|
|
75
|
+
};
|
|
76
|
+
})[];
|
|
77
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/tools/calendar.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkEzB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 日程工具定义
|
|
3
|
+
*/
|
|
4
|
+
export const calendarTools = [
|
|
5
|
+
{
|
|
6
|
+
name: 'dingtalk_calendar_create',
|
|
7
|
+
description: '创建一个日程',
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: 'object',
|
|
10
|
+
properties: {
|
|
11
|
+
summary: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
description: '日程标题',
|
|
14
|
+
},
|
|
15
|
+
description: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
description: '日程描述',
|
|
18
|
+
},
|
|
19
|
+
startTime: {
|
|
20
|
+
type: 'number',
|
|
21
|
+
description: '开始时间(Unix时间戳,秒)',
|
|
22
|
+
},
|
|
23
|
+
endTime: {
|
|
24
|
+
type: 'number',
|
|
25
|
+
description: '结束时间(Unix时间戳,秒)',
|
|
26
|
+
},
|
|
27
|
+
organizerUserid: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: '组织者用户ID',
|
|
30
|
+
},
|
|
31
|
+
attendeeUserids: {
|
|
32
|
+
type: 'array',
|
|
33
|
+
items: { type: 'string' },
|
|
34
|
+
description: '参与人用户ID列表',
|
|
35
|
+
},
|
|
36
|
+
location: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: '地点',
|
|
39
|
+
},
|
|
40
|
+
reminder: {
|
|
41
|
+
type: 'number',
|
|
42
|
+
description: '提醒时间(分钟),如15表示提前15分钟提醒',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
required: ['summary', 'startTime', 'endTime', 'organizerUserid', 'attendeeUserids'],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'dingtalk_calendar_list',
|
|
50
|
+
description: '获取指定时间范围内的日程列表',
|
|
51
|
+
inputSchema: {
|
|
52
|
+
type: 'object',
|
|
53
|
+
properties: {
|
|
54
|
+
userid: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
description: '用户ID',
|
|
57
|
+
},
|
|
58
|
+
startTime: {
|
|
59
|
+
type: 'number',
|
|
60
|
+
description: '开始时间(Unix时间戳,秒)',
|
|
61
|
+
},
|
|
62
|
+
endTime: {
|
|
63
|
+
type: 'number',
|
|
64
|
+
description: '结束时间(Unix时间戳,秒)',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
required: ['userid', 'startTime', 'endTime'],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
//# sourceMappingURL=calendar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../src/tools/calendar.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B;QACE,IAAI,EAAE,0BAA0B;QAChC,WAAW,EAAE,QAAQ;QACrB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,MAAM;iBACpB;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,MAAM;iBACpB;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,iBAAiB;iBAC/B;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,iBAAiB;iBAC/B;gBACD,eAAe,EAAE;oBACf,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,SAAS;iBACvB;gBACD,eAAe,EAAE;oBACf,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EAAE,WAAW;iBACzB;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,IAAI;iBAClB;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,wBAAwB;iBACtC;aACF;YACD,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EAAE,iBAAiB,CAAC;SACpF;KACF;IACD;QACE,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,gBAAgB;QAC7B,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,MAAM;iBACpB;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,iBAAiB;iBAC/B;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,iBAAiB;iBAC/B;aACF;YACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,CAAC;SAC7C;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 消息工具定义
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export declare const sendTextMessageSchema: z.ZodObject<{
|
|
6
|
+
userid: z.ZodString;
|
|
7
|
+
content: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
userid: string;
|
|
10
|
+
content: string;
|
|
11
|
+
}, {
|
|
12
|
+
userid: string;
|
|
13
|
+
content: string;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const sendMarkdownMessageSchema: z.ZodObject<{
|
|
16
|
+
userid: z.ZodString;
|
|
17
|
+
title: z.ZodString;
|
|
18
|
+
content: z.ZodString;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
userid: string;
|
|
21
|
+
content: string;
|
|
22
|
+
title: string;
|
|
23
|
+
}, {
|
|
24
|
+
userid: string;
|
|
25
|
+
content: string;
|
|
26
|
+
title: string;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const getContactsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
29
|
+
export declare const messageTools: ({
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
inputSchema: {
|
|
33
|
+
type: string;
|
|
34
|
+
properties: {
|
|
35
|
+
userid: {
|
|
36
|
+
type: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
content: {
|
|
40
|
+
type: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
title?: undefined;
|
|
44
|
+
};
|
|
45
|
+
required: string[];
|
|
46
|
+
};
|
|
47
|
+
} | {
|
|
48
|
+
name: string;
|
|
49
|
+
description: string;
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: string;
|
|
52
|
+
properties: {
|
|
53
|
+
userid: {
|
|
54
|
+
type: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
title: {
|
|
58
|
+
type: string;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
content: {
|
|
62
|
+
type: string;
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
required: string[];
|
|
67
|
+
};
|
|
68
|
+
} | {
|
|
69
|
+
name: string;
|
|
70
|
+
description: string;
|
|
71
|
+
inputSchema: {
|
|
72
|
+
type: string;
|
|
73
|
+
properties: {
|
|
74
|
+
userid?: undefined;
|
|
75
|
+
content?: undefined;
|
|
76
|
+
title?: undefined;
|
|
77
|
+
};
|
|
78
|
+
required?: undefined;
|
|
79
|
+
};
|
|
80
|
+
})[];
|
|
81
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/tools/messages.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,qBAAqB;;;;;;;;;EAGhC,CAAC;AAGH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAIpC,CAAC;AAGH,eAAO,MAAM,iBAAiB,gDAAe,CAAC;AAG9C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiDxB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 消息工具定义
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
// 发送文本消息
|
|
6
|
+
export const sendTextMessageSchema = z.object({
|
|
7
|
+
userid: z.string().describe('接收者用户ID'),
|
|
8
|
+
content: z.string().describe('消息内容'),
|
|
9
|
+
});
|
|
10
|
+
// 发送Markdown消息
|
|
11
|
+
export const sendMarkdownMessageSchema = z.object({
|
|
12
|
+
userid: z.string().describe('接收者用户ID'),
|
|
13
|
+
title: z.string().describe('消息标题'),
|
|
14
|
+
content: z.string().describe('Markdown格式的消息内容'),
|
|
15
|
+
});
|
|
16
|
+
// 获取联系人列表
|
|
17
|
+
export const getContactsSchema = z.object({});
|
|
18
|
+
// 消息工具列表
|
|
19
|
+
export const messageTools = [
|
|
20
|
+
{
|
|
21
|
+
name: 'dingtalk_message_send_text',
|
|
22
|
+
description: '发送文本消息到指定用户',
|
|
23
|
+
inputSchema: {
|
|
24
|
+
type: 'object',
|
|
25
|
+
properties: {
|
|
26
|
+
userid: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
description: '接收者用户ID',
|
|
29
|
+
},
|
|
30
|
+
content: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: '消息内容',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
required: ['userid', 'content'],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'dingtalk_message_send_markdown',
|
|
40
|
+
description: '发送Markdown格式消息到指定用户',
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
properties: {
|
|
44
|
+
userid: {
|
|
45
|
+
type: 'string',
|
|
46
|
+
description: '接收者用户ID',
|
|
47
|
+
},
|
|
48
|
+
title: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
description: '消息标题',
|
|
51
|
+
},
|
|
52
|
+
content: {
|
|
53
|
+
type: 'string',
|
|
54
|
+
description: 'Markdown格式的消息内容',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
required: ['userid', 'title', 'content'],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'dingtalk_message_get_contacts',
|
|
62
|
+
description: '获取钉钉联系人列表',
|
|
63
|
+
inputSchema: {
|
|
64
|
+
type: 'object',
|
|
65
|
+
properties: {},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
];
|
|
69
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/tools/messages.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,SAAS;AACT,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;IACtC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,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;QACE,IAAI,EAAE,+BAA+B;QACrC,WAAW,EAAE,WAAW;QACxB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;SACf;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 待办工具定义
|
|
3
|
+
*/
|
|
4
|
+
export declare const todoTools: ({
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
inputSchema: {
|
|
8
|
+
type: string;
|
|
9
|
+
properties: {
|
|
10
|
+
subject: {
|
|
11
|
+
type: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
description: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
dueTime: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
executorUserIds: {
|
|
23
|
+
type: string;
|
|
24
|
+
items: {
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
participantUserIds: {
|
|
30
|
+
type: string;
|
|
31
|
+
items: {
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
description: string;
|
|
35
|
+
};
|
|
36
|
+
userid?: undefined;
|
|
37
|
+
status?: undefined;
|
|
38
|
+
recordId?: undefined;
|
|
39
|
+
};
|
|
40
|
+
required: string[];
|
|
41
|
+
};
|
|
42
|
+
} | {
|
|
43
|
+
name: string;
|
|
44
|
+
description: string;
|
|
45
|
+
inputSchema: {
|
|
46
|
+
type: string;
|
|
47
|
+
properties: {
|
|
48
|
+
userid: {
|
|
49
|
+
type: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
status: {
|
|
53
|
+
type: string;
|
|
54
|
+
description: string;
|
|
55
|
+
enum: number[];
|
|
56
|
+
};
|
|
57
|
+
subject?: undefined;
|
|
58
|
+
description?: undefined;
|
|
59
|
+
dueTime?: undefined;
|
|
60
|
+
executorUserIds?: undefined;
|
|
61
|
+
participantUserIds?: undefined;
|
|
62
|
+
recordId?: undefined;
|
|
63
|
+
};
|
|
64
|
+
required: string[];
|
|
65
|
+
};
|
|
66
|
+
} | {
|
|
67
|
+
name: string;
|
|
68
|
+
description: string;
|
|
69
|
+
inputSchema: {
|
|
70
|
+
type: string;
|
|
71
|
+
properties: {
|
|
72
|
+
recordId: {
|
|
73
|
+
type: string;
|
|
74
|
+
description: string;
|
|
75
|
+
};
|
|
76
|
+
status: {
|
|
77
|
+
type: string;
|
|
78
|
+
description: string;
|
|
79
|
+
enum: number[];
|
|
80
|
+
};
|
|
81
|
+
subject?: undefined;
|
|
82
|
+
description?: undefined;
|
|
83
|
+
dueTime?: undefined;
|
|
84
|
+
executorUserIds?: undefined;
|
|
85
|
+
participantUserIds?: undefined;
|
|
86
|
+
userid?: undefined;
|
|
87
|
+
};
|
|
88
|
+
required: string[];
|
|
89
|
+
};
|
|
90
|
+
})[];
|
|
91
|
+
//# sourceMappingURL=todo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"todo.d.ts","sourceRoot":"","sources":["../../src/tools/todo.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuErB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 待办工具定义
|
|
3
|
+
*/
|
|
4
|
+
export const todoTools = [
|
|
5
|
+
{
|
|
6
|
+
name: 'dingtalk_todo_create',
|
|
7
|
+
description: '创建一个待办事项',
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: 'object',
|
|
10
|
+
properties: {
|
|
11
|
+
subject: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
description: '待办标题',
|
|
14
|
+
},
|
|
15
|
+
description: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
description: '待办描述',
|
|
18
|
+
},
|
|
19
|
+
dueTime: {
|
|
20
|
+
type: 'number',
|
|
21
|
+
description: '截止时间(Unix时间戳,秒)',
|
|
22
|
+
},
|
|
23
|
+
executorUserIds: {
|
|
24
|
+
type: 'array',
|
|
25
|
+
items: { type: 'string' },
|
|
26
|
+
description: '执行者用户ID列表',
|
|
27
|
+
},
|
|
28
|
+
participantUserIds: {
|
|
29
|
+
type: 'array',
|
|
30
|
+
items: { type: 'string' },
|
|
31
|
+
description: '参与人用户ID列表',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
required: ['subject', 'executorUserIds'],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'dingtalk_todo_list',
|
|
39
|
+
description: '获取用户的待办列表',
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: 'object',
|
|
42
|
+
properties: {
|
|
43
|
+
userid: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: '用户ID',
|
|
46
|
+
},
|
|
47
|
+
status: {
|
|
48
|
+
type: 'number',
|
|
49
|
+
description: '状态: 0-未完成, 1-已完成',
|
|
50
|
+
enum: [0, 1],
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
required: ['userid'],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'dingtalk_todo_update',
|
|
58
|
+
description: '更新待办状态',
|
|
59
|
+
inputSchema: {
|
|
60
|
+
type: 'object',
|
|
61
|
+
properties: {
|
|
62
|
+
recordId: {
|
|
63
|
+
type: 'string',
|
|
64
|
+
description: '待办记录ID',
|
|
65
|
+
},
|
|
66
|
+
status: {
|
|
67
|
+
type: 'number',
|
|
68
|
+
description: '状态: 0-未完成, 1-已完成',
|
|
69
|
+
enum: [0, 1],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
required: ['recordId', 'status'],
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
//# sourceMappingURL=todo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"todo.js","sourceRoot":"","sources":["../../src/tools/todo.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,UAAU;QACvB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,MAAM;iBACpB;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,MAAM;iBACpB;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,iBAAiB;iBAC/B;gBACD,eAAe,EAAE;oBACf,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EAAE,WAAW;iBACzB;gBACD,kBAAkB,EAAE;oBAClB,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;oBACzB,WAAW,EAAE,WAAW;iBACzB;aACF;YACD,QAAQ,EAAE,CAAC,SAAS,EAAE,iBAAiB,CAAC;SACzC;KACF;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,WAAW;QACxB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,MAAM;iBACpB;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,kBAAkB;oBAC/B,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;iBACb;aACF;YACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;SACrB;KACF;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,QAAQ;QACrB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,QAAQ;iBACtB;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,kBAAkB;oBAC/B,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;iBACb;aACF;YACD,QAAQ,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;SACjC;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 钉钉API封装
|
|
3
|
+
*/
|
|
4
|
+
export interface DingTalkConfig {
|
|
5
|
+
appKey: string;
|
|
6
|
+
appSecret: string;
|
|
7
|
+
agentId: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class DingTalkAPI {
|
|
10
|
+
private client;
|
|
11
|
+
private appKey;
|
|
12
|
+
private appSecret;
|
|
13
|
+
private agentId;
|
|
14
|
+
private accessToken;
|
|
15
|
+
private tokenExpireTime;
|
|
16
|
+
constructor(appKey: string, appSecret: string, agentId: string);
|
|
17
|
+
/**
|
|
18
|
+
* 获取access_token
|
|
19
|
+
*/
|
|
20
|
+
private getAccessToken;
|
|
21
|
+
/**
|
|
22
|
+
* 发送消息
|
|
23
|
+
*/
|
|
24
|
+
sendMessage(params: {
|
|
25
|
+
userid?: string;
|
|
26
|
+
chatid?: string;
|
|
27
|
+
msgtype: string;
|
|
28
|
+
content: any;
|
|
29
|
+
}): Promise<any>;
|
|
30
|
+
/**
|
|
31
|
+
* 发送文本消息
|
|
32
|
+
*/
|
|
33
|
+
sendTextMessage(userid: string, content: string): Promise<any>;
|
|
34
|
+
/**
|
|
35
|
+
* 发送Markdown消息
|
|
36
|
+
*/
|
|
37
|
+
sendMarkdownMessage(userid: string, title: string, content: string): Promise<any>;
|
|
38
|
+
/**
|
|
39
|
+
* 获取会话列表
|
|
40
|
+
*/
|
|
41
|
+
getConversations(): Promise<any[]>;
|
|
42
|
+
/**
|
|
43
|
+
* 获取联系人
|
|
44
|
+
*/
|
|
45
|
+
getContacts(): Promise<any[]>;
|
|
46
|
+
/**
|
|
47
|
+
* 创建待办
|
|
48
|
+
*/
|
|
49
|
+
createTodo(params: {
|
|
50
|
+
subject: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
dueTime?: number;
|
|
53
|
+
executorUserIds: string[];
|
|
54
|
+
participantUserIds?: string[];
|
|
55
|
+
}): Promise<any>;
|
|
56
|
+
/**
|
|
57
|
+
* 获取待办列表
|
|
58
|
+
*/
|
|
59
|
+
getTodoList(userid: string, status?: number): Promise<any[]>;
|
|
60
|
+
/**
|
|
61
|
+
* 更新待办状态
|
|
62
|
+
*/
|
|
63
|
+
updateTodo(recordId: string, status: number): Promise<any>;
|
|
64
|
+
/**
|
|
65
|
+
* 创建日程
|
|
66
|
+
*/
|
|
67
|
+
createCalendarEvent(params: {
|
|
68
|
+
summary: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
startTime: number;
|
|
71
|
+
endTime: number;
|
|
72
|
+
organizerUserid: string;
|
|
73
|
+
attendeeUserids: string[];
|
|
74
|
+
location?: string;
|
|
75
|
+
reminder?: number;
|
|
76
|
+
}): Promise<any>;
|
|
77
|
+
/**
|
|
78
|
+
* 获取日程列表
|
|
79
|
+
*/
|
|
80
|
+
getCalendarEvents(userid: string, startTime: number, endTime: number): Promise<any[]>;
|
|
81
|
+
/**
|
|
82
|
+
* 获取用户ID
|
|
83
|
+
*/
|
|
84
|
+
getUserId(code: string): Promise<string>;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=dingtalk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dingtalk.d.ts","sourceRoot":"","sources":["../../src/utils/dingtalk.ts"],"names":[],"mappings":"AAA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