caldav-mcp 0.8.0 → 0.9.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/dist/tools/create-event.js +21 -1
- package/dist/tools/update-event.js +19 -1
- package/package.json +2 -1
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
function toRecurrenceRule(r) {
|
|
3
|
+
const out = {};
|
|
4
|
+
if (r.freq !== undefined)
|
|
5
|
+
out.freq = r.freq;
|
|
6
|
+
if (r.interval !== undefined)
|
|
7
|
+
out.interval = r.interval;
|
|
8
|
+
if (r.count !== undefined)
|
|
9
|
+
out.count = r.count;
|
|
10
|
+
if (r.until !== undefined)
|
|
11
|
+
out.until = new Date(r.until);
|
|
12
|
+
if (r.byday !== undefined)
|
|
13
|
+
out.byday = r.byday;
|
|
14
|
+
if (r.bymonthday !== undefined)
|
|
15
|
+
out.bymonthday = r.bymonthday;
|
|
16
|
+
if (r.bymonth !== undefined)
|
|
17
|
+
out.bymonth = r.bymonth;
|
|
18
|
+
return out;
|
|
19
|
+
}
|
|
2
20
|
const recurrenceRuleSchema = z.object({
|
|
3
21
|
freq: z.enum(["DAILY", "WEEKLY", "MONTHLY", "YEARLY"]).optional(),
|
|
4
22
|
interval: z.number().optional(),
|
|
@@ -40,7 +58,9 @@ export function registerCreateEvent(client, server) {
|
|
|
40
58
|
end: new Date(end),
|
|
41
59
|
...(description !== undefined && { description }),
|
|
42
60
|
...(location !== undefined && { location }),
|
|
43
|
-
recurrenceRule
|
|
61
|
+
...(recurrenceRule !== undefined && {
|
|
62
|
+
recurrenceRule: toRecurrenceRule(recurrenceRule),
|
|
63
|
+
}),
|
|
44
64
|
});
|
|
45
65
|
return {
|
|
46
66
|
content: [{ type: "text", text: event.uid }],
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
function toRecurrenceRule(r) {
|
|
3
|
+
const out = {};
|
|
4
|
+
if (r.freq !== undefined)
|
|
5
|
+
out.freq = r.freq;
|
|
6
|
+
if (r.interval !== undefined)
|
|
7
|
+
out.interval = r.interval;
|
|
8
|
+
if (r.count !== undefined)
|
|
9
|
+
out.count = r.count;
|
|
10
|
+
if (r.until !== undefined)
|
|
11
|
+
out.until = new Date(r.until);
|
|
12
|
+
if (r.byday !== undefined)
|
|
13
|
+
out.byday = r.byday;
|
|
14
|
+
if (r.bymonthday !== undefined)
|
|
15
|
+
out.bymonthday = r.bymonthday;
|
|
16
|
+
if (r.bymonth !== undefined)
|
|
17
|
+
out.bymonth = r.bymonth;
|
|
18
|
+
return out;
|
|
19
|
+
}
|
|
2
20
|
const recurrenceRuleSchema = z.object({
|
|
3
21
|
freq: z.enum(["DAILY", "WEEKLY", "MONTHLY", "YEARLY"]).optional(),
|
|
4
22
|
interval: z.number().optional(),
|
|
@@ -45,7 +63,7 @@ export function registerUpdateEvent(client, server) {
|
|
|
45
63
|
...(description !== undefined && { description }),
|
|
46
64
|
...(location !== undefined && { location }),
|
|
47
65
|
...(recurrenceRule !== undefined && {
|
|
48
|
-
recurrenceRule: recurrenceRule,
|
|
66
|
+
recurrenceRule: toRecurrenceRule(recurrenceRule),
|
|
49
67
|
}),
|
|
50
68
|
});
|
|
51
69
|
return {
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "caldav-mcp",
|
|
3
|
+
"mcpName": "io.github.dominik1001/caldav-mcp",
|
|
3
4
|
"description": "A CalDAV client using Model Context Protocol (MCP) to expose calendar operations as tools for AI assistants.",
|
|
4
|
-
"version": "0.
|
|
5
|
+
"version": "0.9.0",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
7
|
"type": "module",
|
|
7
8
|
"bin": {
|