langmail-mcp 0.1.0 → 0.2.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/LICENSE +1 -1
- package/README.md +89 -169
- package/dist/chunk-ad2666h8.js +12696 -0
- package/dist/langmail-mcp.js +7 -0
- package/package.json +94 -98
- package/THIRD_PARTY_NOTICES.md +0 -388
- package/dist/attachments/download.js +0 -69
- package/dist/attachments/routes.js +0 -42
- package/dist/attachments/tickets.js +0 -45
- package/dist/attachments/upload-tickets.js +0 -43
- package/dist/attachments/upload.js +0 -136
- package/dist/caldav/account-settings.js +0 -92
- package/dist/caldav/agenda.js +0 -277
- package/dist/caldav/alarm.js +0 -97
- package/dist/caldav/client.js +0 -408
- package/dist/caldav/ical.js +0 -248
- package/dist/caldav/occurrence.js +0 -534
- package/dist/caldav/recurrence.js +0 -313
- package/dist/caldav/rsvp.js +0 -107
- package/dist/caldav/scheduling-handover.js +0 -22
- package/dist/caldav/timezone.js +0 -103
- package/dist/caldav/types.js +0 -5
- package/dist/config.js +0 -219
- package/dist/contacts/address-class.js +0 -79
- package/dist/contacts/birthdays.js +0 -81
- package/dist/contacts/card.js +0 -58
- package/dist/contacts/constants.js +0 -46
- package/dist/contacts/fold.js +0 -309
- package/dist/contacts/index.js +0 -10
- package/dist/contacts/merge.js +0 -388
- package/dist/contacts/observations.js +0 -115
- package/dist/contacts/profile.js +0 -402
- package/dist/contacts/scoring.js +0 -146
- package/dist/contacts/types.js +0 -7
- package/dist/contacts/upsert.js +0 -131
- package/dist/drafts/attachments.js +0 -254
- package/dist/drafts/idempotency.js +0 -60
- package/dist/drafts/send-guard.js +0 -184
- package/dist/email-render/email-viewer.html +0 -143
- package/dist/email-render/image-proxy.js +0 -389
- package/dist/email-render/meta.js +0 -48
- package/dist/email-render/sanitize.js +0 -93
- package/dist/email-render/viewer-resource.js +0 -104
- package/dist/http/bearer.js +0 -30
- package/dist/http/guard.js +0 -57
- package/dist/http/hosts.js +0 -10
- package/dist/http/listener.js +0 -170
- package/dist/http/routes.js +0 -72
- package/dist/ical/ical-parse.js +0 -357
- package/dist/ical/index.js +0 -4
- package/dist/ical/timezone.js +0 -22
- package/dist/ical/windows-zones.js +0 -155
- package/dist/index.js +0 -79
- package/dist/jmap/blob.js +0 -49
- package/dist/jmap/contacts.js +0 -226
- package/dist/jmap/drafts.js +0 -480
- package/dist/jmap/email.js +0 -668
- package/dist/jmap/index.js +0 -12
- package/dist/jmap/keywords.js +0 -22
- package/dist/jmap/live.js +0 -21
- package/dist/jmap/origin.js +0 -113
- package/dist/jmap/patch.js +0 -29
- package/dist/jmap/request.js +0 -37
- package/dist/jmap/session.js +0 -89
- package/dist/jmap/sieve.js +0 -71
- package/dist/jmap/submission.js +0 -107
- package/dist/jmap/timeout.js +0 -30
- package/dist/jmap/types.js +0 -6
- package/dist/logger.js +0 -48
- package/dist/mcp/handler.js +0 -255
- package/dist/mcp/http.js +0 -29
- package/dist/mcp/instructions.js +0 -44
- package/dist/mcp/links.js +0 -64
- package/dist/mcp/tool-logging.js +0 -67
- package/dist/observability/errors.js +0 -41
- package/dist/rules/apply.js +0 -236
- package/dist/rules/rule.js +0 -280
- package/dist/rules/store.js +0 -92
- package/dist/tools/annotations.js +0 -71
- package/dist/tools/archive-emails.js +0 -40
- package/dist/tools/calendar-lookup.js +0 -64
- package/dist/tools/contact-common.js +0 -146
- package/dist/tools/contact-format.js +0 -72
- package/dist/tools/contact-write-through.js +0 -37
- package/dist/tools/create-calendar-event.js +0 -231
- package/dist/tools/create-calendar.js +0 -54
- package/dist/tools/create-contact.js +0 -172
- package/dist/tools/create-draft.js +0 -369
- package/dist/tools/create-mail-rule.js +0 -101
- package/dist/tools/delete-calendar-event.js +0 -165
- package/dist/tools/delete-contact.js +0 -60
- package/dist/tools/delete-draft.js +0 -129
- package/dist/tools/delete-mail-rule.js +0 -38
- package/dist/tools/download-attachment.js +0 -90
- package/dist/tools/download-email.js +0 -112
- package/dist/tools/draft-common.js +0 -600
- package/dist/tools/email-types.js +0 -58
- package/dist/tools/error-detail.js +0 -10
- package/dist/tools/file-emails-common.js +0 -75
- package/dist/tools/format.js +0 -131
- package/dist/tools/forward-message.js +0 -237
- package/dist/tools/forward-quote.js +0 -179
- package/dist/tools/get-draft.js +0 -61
- package/dist/tools/get-email.js +0 -164
- package/dist/tools/get-thread.js +0 -67
- package/dist/tools/keywords.js +0 -43
- package/dist/tools/list-calendar-events.js +0 -180
- package/dist/tools/list-calendars.js +0 -44
- package/dist/tools/list-drafts.js +0 -134
- package/dist/tools/list-mail-rules.js +0 -28
- package/dist/tools/list-unsubscribe.js +0 -152
- package/dist/tools/list-upcoming-birthdays.js +0 -165
- package/dist/tools/mail-rule-common.js +0 -43
- package/dist/tools/mail-rule-format.js +0 -79
- package/dist/tools/mailbox-lookup.js +0 -13
- package/dist/tools/mark-emails.js +0 -78
- package/dist/tools/merge-contacts.js +0 -145
- package/dist/tools/move-calendar-events.js +0 -340
- package/dist/tools/move-emails.js +0 -64
- package/dist/tools/one-click-post.js +0 -275
- package/dist/tools/preview-email.js +0 -204
- package/dist/tools/preview-mail-rule.js +0 -79
- package/dist/tools/reply-quote.js +0 -426
- package/dist/tools/reply-to-message.js +0 -292
- package/dist/tools/respond-to-event.js +0 -110
- package/dist/tools/result.js +0 -9
- package/dist/tools/search-contacts.js +0 -431
- package/dist/tools/search-emails.js +0 -570
- package/dist/tools/send-draft.js +0 -308
- package/dist/tools/trash-emails.js +0 -36
- package/dist/tools/unsubscribe-from-list.js +0 -249
- package/dist/tools/update-calendar-event.js +0 -973
- package/dist/tools/update-calendar.js +0 -100
- package/dist/tools/update-contact.js +0 -382
- package/dist/tools/update-draft.js +0 -714
- package/dist/tools/update-mail-rule.js +0 -103
- package/dist/tools/upload-attachments.js +0 -126
|
@@ -1,973 +0,0 @@
|
|
|
1
|
-
// update_calendar_event tool — edits an existing VEVENT in place and re-sends
|
|
2
|
-
// DKIM-signed iMIP invitations, so the attendees' clients treat it as an update
|
|
3
|
-
// rather than a new invite. Only a reschedule (start, end, all-day flag or
|
|
4
|
-
// repeat rule) bumps SEQUENCE and resets every reply to NEEDS-ACTION; any other
|
|
5
|
-
// edit keeps each attendee's reply (RFC 5546 §3.2.2.2).
|
|
6
|
-
//
|
|
7
|
-
// The edit is a *partial* one: the caller passes the stable UID returned from
|
|
8
|
-
// create_calendar_event plus only the fields it wants to change, and every field
|
|
9
|
-
// it omits keeps the value we read back from CalDAV. There is no full-replacement
|
|
10
|
-
// mode — no caller ever has to restate what it is not changing, which is what
|
|
11
|
-
// used to silently drop attendees added elsewhere and collapse recurring series.
|
|
12
|
-
// Clearing therefore needs an explicit value: `attendees: []`, `location: ""`,
|
|
13
|
-
// `description: ""`, `recurrence: "none"`. Properties the tool doesn't model
|
|
14
|
-
// (CATEGORIES, CLASS, URL, TRANSP, X- properties, …) are carried over from the
|
|
15
|
-
// stored VEVENT verbatim (caldav/occurrence.ts carryStoredProperties), so an
|
|
16
|
-
// edit changes only what the caller asked for.
|
|
17
|
-
//
|
|
18
|
-
// Two edit scopes, chosen by `recurrenceId`:
|
|
19
|
-
// - omitted → the whole event (the entire series for a recurring one);
|
|
20
|
-
// - present → a single occurrence of a recurring series, written as a
|
|
21
|
-
// RECURRENCE-ID override spliced alongside the untouched master (see
|
|
22
|
-
// caldav/occurrence.ts). Stalwart then schedules an iMIP update scoped to
|
|
23
|
-
// that instance. Omitted fields merge against that occurrence's own stored
|
|
24
|
-
// state (an existing override, else the instant the recurrenceId names).
|
|
25
|
-
//
|
|
26
|
-
// Logic sits behind a `Deps` interface (discover + fetchEvent + updateEvent)
|
|
27
|
-
// so it unit-tests without live Stalwart; `makeLiveDeps` wires tsdav in.
|
|
28
|
-
import { z } from "zod";
|
|
29
|
-
import { makeAccountTimeZoneResolver, } from "../caldav/account-settings.js";
|
|
30
|
-
import { describeReminder, MAX_REMINDER_MINUTES } from "../caldav/alarm.js";
|
|
31
|
-
import { discoverAccount, fetchEvent, resolveCalendarUrl, updateEvent, } from "../caldav/client.js";
|
|
32
|
-
import { buildInvite, maxSequence, parseSequence, } from "../caldav/ical.js";
|
|
33
|
-
import { carryStoredProperties, spliceAlarms, spliceOccurrenceOverride, } from "../caldav/occurrence.js";
|
|
34
|
-
import { alignUntil, isSeriesOccurrence, recurrenceDescription, recurrenceSchema, resolveRecurrenceId, seriesTimeZone, startContradictsRule, toRRule, } from "../caldav/recurrence.js";
|
|
35
|
-
import { logSchedulingHandover } from "../caldav/scheduling-handover.js";
|
|
36
|
-
import { allDayEndError, dateOnlyToInstant, instantToDateOnly, isDateOnly, resolveEventTimes, resolveInputDateTime, toWallClockIso, UTC_TIME_ZONE, } from "../caldav/timezone.js";
|
|
37
|
-
import { parseEvents, } from "../ical/index.js";
|
|
38
|
-
import { OUTWARD_DESTRUCTIVE } from "./annotations.js";
|
|
39
|
-
import { createCalendarEventInput, eventUidSchema, } from "./create-calendar-event.js";
|
|
40
|
-
import { errorResult, textResult } from "./result.js";
|
|
41
|
-
// `"none"` is the explicit "make this a one-off again" sentinel: it is the one
|
|
42
|
-
// clearing case with no natural empty value, and omitting `recurrence` now means
|
|
43
|
-
// "keep the stored rule". Listed first so it can't be read as a raw RRULE.
|
|
44
|
-
const NO_RECURRENCE = "none";
|
|
45
|
-
const updateRecurrenceSchema = z.union([
|
|
46
|
-
z.literal(NO_RECURRENCE),
|
|
47
|
-
recurrenceSchema,
|
|
48
|
-
]);
|
|
49
|
-
// Same sentinel for reminders: omitting keeps the stored alarms, a number
|
|
50
|
-
// replaces them all with one, `"none"` removes them.
|
|
51
|
-
const NO_REMINDER = "none";
|
|
52
|
-
const shared = createCalendarEventInput.shape;
|
|
53
|
-
const TOOL_NAME = "update_calendar_event";
|
|
54
|
-
export const updateCalendarEventInput = z.object({
|
|
55
|
-
addedAttendees: z
|
|
56
|
-
.array(z.email())
|
|
57
|
-
.min(1)
|
|
58
|
-
.max(50)
|
|
59
|
-
.optional()
|
|
60
|
-
.describe("Email addresses to invite on top of the stored attendees. Cannot be combined with `attendees`."),
|
|
61
|
-
attendees: shared.attendees.describe("The complete attendee list after the edit; `[]` uninvites everyone. Omit to keep the stored attendees, " +
|
|
62
|
-
"or use `addedAttendees`/`removedAttendees` instead."),
|
|
63
|
-
calendarUrl: shared.calendarUrl,
|
|
64
|
-
description: shared.description.describe('New description; `""` clears it. Omit to keep the stored one.'),
|
|
65
|
-
end: shared.end
|
|
66
|
-
.optional()
|
|
67
|
-
.describe("New end, ISO 8601, or an exclusive date for an all-day event. Omit to keep the event’s length when " +
|
|
68
|
-
"moving `start`, its stored end otherwise."),
|
|
69
|
-
location: shared.location.describe('New location; `""` clears it. Omit to keep the stored one.'),
|
|
70
|
-
notify: z
|
|
71
|
-
.enum(["all", "none"])
|
|
72
|
-
.optional()
|
|
73
|
-
.describe("`all` (default) re-notifies the attendees by iMIP; `none` edits silently."),
|
|
74
|
-
recurrence: updateRecurrenceSchema
|
|
75
|
-
.optional()
|
|
76
|
-
.describe(`New repeat rule for the whole series; "${NO_RECURRENCE}" makes it a one-off. ` +
|
|
77
|
-
`Omit to keep the stored rule. ${recurrenceDescription}`),
|
|
78
|
-
recurrenceId: z
|
|
79
|
-
.union([z.iso.date(), z.iso.datetime({ offset: true })])
|
|
80
|
-
.optional()
|
|
81
|
-
.describe("To change one occurrence of a repeating series alone, its original start as an ISO 8601 instant " +
|
|
82
|
-
"(e.g. 2026-06-16T10:00:00Z), or its date for an all-day series (2026-06-16). Not combinable with " +
|
|
83
|
-
"`recurrence`, `addedAttendees` or `removedAttendees`."),
|
|
84
|
-
reminderMinutesBefore: z
|
|
85
|
-
.union([
|
|
86
|
-
z.literal(NO_REMINDER),
|
|
87
|
-
z.number().int().min(0).max(MAX_REMINDER_MINUTES),
|
|
88
|
-
])
|
|
89
|
-
.optional()
|
|
90
|
-
.describe("Minutes before the start to remind the user (all-day events start at 00:00, so 900 = 09:00 the day " +
|
|
91
|
-
`before); replaces any stored reminders. "${NO_REMINDER}" removes them. Omit to keep the stored ones.`),
|
|
92
|
-
removedAttendees: z
|
|
93
|
-
.array(z.email())
|
|
94
|
-
.min(1)
|
|
95
|
-
.max(50)
|
|
96
|
-
.optional()
|
|
97
|
-
.describe("Email addresses to uninvite (case-insensitive). Cannot be combined with `attendees`."),
|
|
98
|
-
start: shared.start
|
|
99
|
-
.optional()
|
|
100
|
-
.describe("New start, ISO 8601, or a date (2026-10-03) for an all-day event. Omit to keep the stored start."),
|
|
101
|
-
// Not `shared.timeZone`: on update this zone governs the caller's own
|
|
102
|
-
// start/end and the rebuilt event's rendering, and it defaults to the stored
|
|
103
|
-
// event's own zone rather than the account's.
|
|
104
|
-
timeZone: shared.timeZone.describe("IANA zone for the start/end you pass, e.g. Europe/Berlin: their clock digits are read as wall-clock " +
|
|
105
|
-
"time here, overriding any offset. Defaults to the event’s own stored zone. Times you omit keep theirs."),
|
|
106
|
-
title: shared.title
|
|
107
|
-
.optional()
|
|
108
|
-
.describe("New title. Omit to keep the stored one."),
|
|
109
|
-
uid: eventUidSchema,
|
|
110
|
-
});
|
|
111
|
-
// Merges an attendee delta onto the stored list: start from `base`, append
|
|
112
|
-
// `added`, drop everything in `removed`. All comparison is case-insensitive
|
|
113
|
-
// (RFC 5545 calendar-user-addresses are), and duplicates collapse to the first
|
|
114
|
-
// spelling seen — so re-adding an existing attendee or removing an absent one is
|
|
115
|
-
// a harmless no-op, and the result never carries the same address twice.
|
|
116
|
-
export const mergeAttendees = (base, added, removed) => {
|
|
117
|
-
const removedSet = new Set(removed.map((email) => email.toLowerCase()));
|
|
118
|
-
const seen = new Set();
|
|
119
|
-
const result = [];
|
|
120
|
-
for (const email of [...base, ...added]) {
|
|
121
|
-
const key = email.toLowerCase();
|
|
122
|
-
if (removedSet.has(key) || seen.has(key)) {
|
|
123
|
-
continue;
|
|
124
|
-
}
|
|
125
|
-
seen.add(key);
|
|
126
|
-
result.push(email);
|
|
127
|
-
}
|
|
128
|
-
return result;
|
|
129
|
-
};
|
|
130
|
-
// Edits one occurrence of a recurring series: validate the target instant
|
|
131
|
-
// against the master's RRULE, build a RECURRENCE-ID override, and splice it into
|
|
132
|
-
// the stored object alongside the untouched master before PUTting it back.
|
|
133
|
-
const updateOccurrence = async (u) => {
|
|
134
|
-
const { alarms, allDay, args, attendees, deps, description, end, existing, invitees, location, organizer, recurrenceId, removedAttendees, rescheduled, scheduleAgent, start, timeZone, title, token, } = u;
|
|
135
|
-
// The stored object holds the master (the only VEVENT with an RRULE) plus any
|
|
136
|
-
// existing overrides. The master identifies the series we validate against.
|
|
137
|
-
const master = parseEvents(existing.data).find((e) => e.recurrence !== undefined);
|
|
138
|
-
if (!master?.recurrence) {
|
|
139
|
-
return errorResult(`Event ${args.uid} is not a recurring series; omit recurrenceId to edit it.`);
|
|
140
|
-
}
|
|
141
|
-
const zone = seriesTimeZone(master, args.recurrenceId ?? recurrenceId);
|
|
142
|
-
if (!zone.ok) {
|
|
143
|
-
return errorResult(`${zone.error} Nothing was changed.`);
|
|
144
|
-
}
|
|
145
|
-
// The master RRULE is only lightly validated on create (raw rules pass
|
|
146
|
-
// through to CalDAV), so `rrule` may reject one Stalwart happily stored — a
|
|
147
|
-
// trailing `;`, an unknown BYDAY code, an exotic FREQ. Treat an unparseable
|
|
148
|
-
// rule as a clean rejection rather than let it surface as an opaque internal
|
|
149
|
-
// error: we can't confirm the instant is a real occurrence, and writing an
|
|
150
|
-
// unvalidated override risks the very orphan this guard exists to prevent.
|
|
151
|
-
let onOccurrence;
|
|
152
|
-
try {
|
|
153
|
-
onOccurrence = isSeriesOccurrence(master.start, master.recurrence, recurrenceId, zone.value);
|
|
154
|
-
}
|
|
155
|
-
catch {
|
|
156
|
-
return errorResult(`Could not evaluate this series' recurrence rule (${master.recurrence}) to validate ` +
|
|
157
|
-
`recurrenceId ${args.recurrenceId ?? recurrenceId}. Nothing was changed.`);
|
|
158
|
-
}
|
|
159
|
-
if (!onOccurrence) {
|
|
160
|
-
return errorResult(`recurrenceId ${args.recurrenceId ?? recurrenceId} does not match an occurrence of this series ` +
|
|
161
|
-
`(${master.recurrence}); it must equal an occurrence’s original ${master.allDay ? "date" : "start"}. ` +
|
|
162
|
-
"Nothing was changed. Use list_calendar_events to see the series.");
|
|
163
|
-
}
|
|
164
|
-
// An EXDATE on the master cancels the instant; an override for it would be
|
|
165
|
-
// an orphan the series never shows, while this tool reported success.
|
|
166
|
-
if (isExcluded(master, recurrenceId)) {
|
|
167
|
-
return errorResult(`The occurrence on ${args.recurrenceId ?? recurrenceId} was cancelled, so there is nothing to edit. ` +
|
|
168
|
-
"Nothing was changed.");
|
|
169
|
-
}
|
|
170
|
-
// A move bumps past every SEQUENCE already in the object so this override
|
|
171
|
-
// supersedes any prior edit of the same instance. Any other edit is not a
|
|
172
|
-
// reschedule (RFC 5546 §3.2.2.2) and keeps the highest one, which never
|
|
173
|
-
// ranks the override below the revision it replaces.
|
|
174
|
-
const sequence = nextSequence(maxSequence(existing.data), rescheduled);
|
|
175
|
-
const override = buildInvite({
|
|
176
|
-
alarms,
|
|
177
|
-
allDay,
|
|
178
|
-
attendees: invitees,
|
|
179
|
-
end,
|
|
180
|
-
// The master's stored ORGANIZER wins over the discovered principal: an
|
|
181
|
-
// event created under a previous account address (still an alias) would
|
|
182
|
-
// otherwise get an override with a different ORGANIZER, which Stalwart
|
|
183
|
-
// rejects with 412 SameOrganizerInAllComponents.
|
|
184
|
-
organizer: master.organizer ?? organizer,
|
|
185
|
-
recurrenceAllDay: master.allDay === true,
|
|
186
|
-
// The stored TZID name, so the RECURRENCE-ID names the object's own
|
|
187
|
-
// VTIMEZONE even when that is a Windows zone name.
|
|
188
|
-
recurrenceTimeZone: master.storedStartTzid ?? master.startTzid ?? UTC_TIME_ZONE,
|
|
189
|
-
recurrenceId: new Date(recurrenceId),
|
|
190
|
-
sequence,
|
|
191
|
-
start,
|
|
192
|
-
timeZone,
|
|
193
|
-
title,
|
|
194
|
-
uid: args.uid,
|
|
195
|
-
...(description ? { description } : {}),
|
|
196
|
-
...(location ? { location } : {}),
|
|
197
|
-
...(scheduleAgent ? { scheduleAgent } : {}),
|
|
198
|
-
});
|
|
199
|
-
// RDATE is the series' own: an override is one instance and never carries
|
|
200
|
-
// one. A fresh override starts from the master, whose Thunderbird alarm
|
|
201
|
-
// state belongs to other occurrences, so that never comes along either.
|
|
202
|
-
const patched = carryStoredProperties(override, existing.data, {
|
|
203
|
-
recurrenceId,
|
|
204
|
-
replaced: [...replacedProperties(args), ...MOZ_ALARM_STATE, "RDATE"],
|
|
205
|
-
});
|
|
206
|
-
const ical = spliceOccurrenceOverride(existing.data, patched, recurrenceId);
|
|
207
|
-
await deps.updateEvent({
|
|
208
|
-
ical,
|
|
209
|
-
token,
|
|
210
|
-
url: existing.url,
|
|
211
|
-
...(existing.etag ? { etag: existing.etag } : {}),
|
|
212
|
-
});
|
|
213
|
-
logSchedulingHandover({
|
|
214
|
-
attendees,
|
|
215
|
-
ical,
|
|
216
|
-
recurrenceId,
|
|
217
|
-
removedAttendees,
|
|
218
|
-
scheduleAgent,
|
|
219
|
-
sequence,
|
|
220
|
-
tool: TOOL_NAME,
|
|
221
|
-
uid: args.uid,
|
|
222
|
-
});
|
|
223
|
-
// An occurrence edit is a scheduling action like any other, so its
|
|
224
|
-
// attendees are collected too.
|
|
225
|
-
await deps.collectAttendees?.({
|
|
226
|
-
attendees: attendeesWithStoredNames(attendees, master),
|
|
227
|
-
organizer: master.organizer ?? organizer,
|
|
228
|
-
selfAddress: organizer,
|
|
229
|
-
start: start.toISOString(),
|
|
230
|
-
token,
|
|
231
|
-
uid: args.uid,
|
|
232
|
-
});
|
|
233
|
-
return textResult(`Occurrence of "${title}" on ${args.recurrenceId ?? recurrenceId} updated ` +
|
|
234
|
-
`(${deliverySummary(attendees, scheduleAgent, removedAttendees.length > 0)}${reminderSummary(args, allDay)}). ` +
|
|
235
|
-
"The rest of the series is unchanged.");
|
|
236
|
-
};
|
|
237
|
-
// Thunderbird's state for the alarms it has seen: snoozes and the last
|
|
238
|
-
// acknowledgement, tied to the old alarm times.
|
|
239
|
-
const MOZ_ALARM_STATE = ["X-MOZ-SNOOZE-TIME*", "X-MOZ-LASTACK"];
|
|
240
|
-
// Stored properties an edit replaces beyond those it always writes (see
|
|
241
|
-
// carryStoredProperties): the twins of a field the caller changed, which would
|
|
242
|
-
// otherwise keep showing its old value — an HTML description, the map position
|
|
243
|
-
// and Apple's travel time for a location, Thunderbird's alarm state for moved
|
|
244
|
-
// or replaced reminders — and a series' extra dates (RDATE), which are fixed
|
|
245
|
-
// instants that neither follow a move nor a restated rule.
|
|
246
|
-
const replacedProperties = (args) => {
|
|
247
|
-
const moved = args.start !== undefined || args.end !== undefined;
|
|
248
|
-
return [
|
|
249
|
-
...(args.description === undefined
|
|
250
|
-
? []
|
|
251
|
-
: ["X-ALT-DESC", "STYLED-DESCRIPTION"]),
|
|
252
|
-
...(args.location === undefined
|
|
253
|
-
? []
|
|
254
|
-
: ["GEO", "X-APPLE-STRUCTURED-LOCATION", "X-APPLE-TRAVEL-*"]),
|
|
255
|
-
...(moved || args.reminderMinutesBefore !== undefined
|
|
256
|
-
? MOZ_ALARM_STATE
|
|
257
|
-
: []),
|
|
258
|
-
...(moved || args.recurrence !== undefined ? ["RDATE"] : []),
|
|
259
|
-
];
|
|
260
|
-
};
|
|
261
|
-
// The reminder change an edit made, for the result line; empty when the
|
|
262
|
-
// stored reminders were kept.
|
|
263
|
-
const reminderSummary = (args, allDay) => {
|
|
264
|
-
if (args.reminderMinutesBefore === undefined) {
|
|
265
|
-
return "";
|
|
266
|
-
}
|
|
267
|
-
return args.reminderMinutesBefore === NO_REMINDER
|
|
268
|
-
? "; reminders removed"
|
|
269
|
-
: `; reminder ${describeReminder(args.reminderMinutesBefore, allDay)}`;
|
|
270
|
-
};
|
|
271
|
-
// One-line human summary of who the PUT notified. Dropping an attendee is
|
|
272
|
-
// Stalwart's RFC 6638 cue to CANCEL them, and SCHEDULE-AGENT=NONE is only
|
|
273
|
-
// stamped on the attendees that *remain* — so neither the zero-attendee branch
|
|
274
|
-
// nor a silent edit that removed someone may claim nobody heard anything.
|
|
275
|
-
// True when the edit drops anyone the stored event had — whether they were
|
|
276
|
-
// named in `removedAttendees` or simply left out of a replacement `attendees`
|
|
277
|
-
// list. Compared case-insensitively, like every other address comparison here.
|
|
278
|
-
const removedAttendees = (stored, resolved) => {
|
|
279
|
-
const kept = new Set(resolved.map((email) => email.toLowerCase()));
|
|
280
|
-
return stored.filter((email) => !kept.has(email.toLowerCase()));
|
|
281
|
-
};
|
|
282
|
-
// Reports what was handed to Stalwart, not what it sent — the iMIP fan-out is
|
|
283
|
-
// Stalwart's (RFC 6638), so this names the intended recipients, not delivery
|
|
284
|
-
// receipts. Until 0.16.21 the moved-occurrence path was additionally
|
|
285
|
-
// unreliable (an RFC-invalid METHOD:ADD Google could not load); that is fixed
|
|
286
|
-
// upstream and guarded by caldav/stalwart-move-occurrence.test.ts.
|
|
287
|
-
const deliverySummary = (attendees, scheduleAgent, removedAny = false) => {
|
|
288
|
-
if (attendees.length === 0) {
|
|
289
|
-
return "no attendees remain; anyone previously invited may receive a cancellation";
|
|
290
|
-
}
|
|
291
|
-
if (scheduleAgent === "NONE") {
|
|
292
|
-
return removedAny
|
|
293
|
-
? "notifications suppressed for the remaining attendees; a removed attendee may still receive a cancellation"
|
|
294
|
-
: "notifications suppressed";
|
|
295
|
-
}
|
|
296
|
-
return `notifications requested for ${attendees.length} attendee(s): ${attendees.join(", ")}`;
|
|
297
|
-
};
|
|
298
|
-
const baseOf = (event) => ({
|
|
299
|
-
alarms: (event?.alarms ?? []).map((a) => a.lines),
|
|
300
|
-
allDay: event?.allDay === true,
|
|
301
|
-
attendees: (event?.attendees ?? []).map((a) => a.email),
|
|
302
|
-
hasExcludedDates: (event?.excludedDates?.length ?? 0) > 0,
|
|
303
|
-
storedAttendees: event?.attendees ?? [],
|
|
304
|
-
unparsedAttendeeCount: event?.unparsedAttendeeCount ?? 0,
|
|
305
|
-
...(event?.description ? { description: event.description } : {}),
|
|
306
|
-
...(event?.end ? { end: event.end } : {}),
|
|
307
|
-
...(event?.location ? { location: event.location } : {}),
|
|
308
|
-
...(event?.recurrence ? { recurrence: event.recurrence } : {}),
|
|
309
|
-
...(event?.start ? { start: event.start } : {}),
|
|
310
|
-
...(event?.startTzid ? { timeZone: event.startTzid } : {}),
|
|
311
|
-
...(event?.title ? { title: event.title } : {}),
|
|
312
|
-
});
|
|
313
|
-
// The fields that actually change the event. A call naming none of them (just a
|
|
314
|
-
// `uid`, or a `recurrenceId` that scopes nothing) has nothing to write.
|
|
315
|
-
const MUTATING_FIELDS = [
|
|
316
|
-
"addedAttendees",
|
|
317
|
-
"attendees",
|
|
318
|
-
"description",
|
|
319
|
-
"end",
|
|
320
|
-
"location",
|
|
321
|
-
"recurrence",
|
|
322
|
-
"reminderMinutesBefore",
|
|
323
|
-
"removedAttendees",
|
|
324
|
-
"start",
|
|
325
|
-
"title",
|
|
326
|
-
];
|
|
327
|
-
// Rejects contradictory or empty field combinations up front (validated here,
|
|
328
|
-
// not in the schema, so registerTool can keep the plain-object `.shape`).
|
|
329
|
-
// Returns the error message, or undefined when the combination is coherent.
|
|
330
|
-
const combinationError = (args, isDelta) => {
|
|
331
|
-
if (MUTATING_FIELDS.every((field) => args[field] === undefined)) {
|
|
332
|
-
return "Nothing to update: pass at least one field to change — `start`/`end` to reschedule, `title`, `location`, `description`, `attendees` (or `addedAttendees`/`removedAttendees`), `recurrence`, or `reminderMinutesBefore`.";
|
|
333
|
-
}
|
|
334
|
-
// `recurrence` re-rules the whole series; `recurrenceId` edits one occurrence.
|
|
335
|
-
if (args.recurrenceId !== undefined && args.recurrence !== undefined) {
|
|
336
|
-
return "Pass either `recurrence` (to re-rule the whole series) or `recurrenceId` (to edit a single occurrence), not both.";
|
|
337
|
-
}
|
|
338
|
-
// A delta and a replacement of the attendee list are contradictory.
|
|
339
|
-
if (isDelta && args.attendees !== undefined) {
|
|
340
|
-
return "Pass either `attendees` (the complete replacement list) or `addedAttendees`/`removedAttendees` (a delta against the stored list), not both.";
|
|
341
|
-
}
|
|
342
|
-
// Attendee membership is a property of the whole series; a single-occurrence
|
|
343
|
-
// scope would make it ambiguous whose list is being edited.
|
|
344
|
-
if (isDelta && args.recurrenceId !== undefined) {
|
|
345
|
-
return "Attendee changes (`addedAttendees`/`removedAttendees`) apply to the whole event and cannot be combined with `recurrenceId`. Omit `recurrenceId` to change the series’ attendees.";
|
|
346
|
-
}
|
|
347
|
-
};
|
|
348
|
-
// True when an ISO string carries an explicit clock time (…THH:MM:SS…), as
|
|
349
|
-
// opposed to a date-only value (all-day event) or an empty string (an event
|
|
350
|
-
// stored with DURATION and no DTEND).
|
|
351
|
-
const CLOCK_TIME_RE = /T\d{2}:\d{2}:\d{2}/u;
|
|
352
|
-
const hasClockTime = (iso) => iso !== undefined && CLOCK_TIME_RE.test(iso);
|
|
353
|
-
// A stored start/end an edit can carry over: a clock time, or an all-day date.
|
|
354
|
-
const isReadableTime = (iso) => hasClockTime(iso) || isDateOnly(iso);
|
|
355
|
-
// A caller that re-specifies the event's whole shape — its time, title, attendee
|
|
356
|
-
// list and repeat rule — has said what the event should become without relying
|
|
357
|
-
// on anything stored. That is the one edit allowed to flatten per-occurrence
|
|
358
|
-
// customizations, because nothing is being silently carried over.
|
|
359
|
-
const isWholeEventRespecification = (args) => args.start !== undefined &&
|
|
360
|
-
args.end !== undefined &&
|
|
361
|
-
args.title !== undefined &&
|
|
362
|
-
args.attendees !== undefined &&
|
|
363
|
-
args.recurrence !== undefined;
|
|
364
|
-
// A partial edit rebuilds the event from its stored state, so refuse — with a
|
|
365
|
-
// clear, actionable error — when that stored state can't be reproduced
|
|
366
|
-
// faithfully, rather than silently dropping data. Each check fires only when the
|
|
367
|
-
// edit actually preserves the field it protects.
|
|
368
|
-
const mergeSafetyError = (stored, base, args) => {
|
|
369
|
-
// Per-occurrence overrides (master + RECURRENCE-ID VEVENTs share the object):
|
|
370
|
-
// a whole-event rebuild collapses the object to a single VEVENT and discards
|
|
371
|
-
// them. The occurrence path splices instead of rebuilding, so it is exempt.
|
|
372
|
-
if (args.recurrenceId === undefined &&
|
|
373
|
-
stored.length > 1 &&
|
|
374
|
-
!isWholeEventRespecification(args)) {
|
|
375
|
-
return "This event has individually-customized occurrences; editing the whole event would discard them. Edit the occurrence(s) directly (with `recurrenceId`), or re-specify the whole event (`start`, `end`, `title`, `attendees` and `recurrence`) to replace the series.";
|
|
376
|
-
}
|
|
377
|
-
// delete_calendar_event cancels one occurrence by writing an EXDATE onto the
|
|
378
|
-
// master, not by adding a VEVENT — so `stored.length` stays 1 and the guard
|
|
379
|
-
// above can't see it. A rebuilt VEVENT carries no EXDATE, which would
|
|
380
|
-
// resurrect the cancelled instance and re-invite everyone to it.
|
|
381
|
-
if (args.recurrenceId === undefined && base.hasExcludedDates) {
|
|
382
|
-
return "This series has cancelled occurrence(s); editing the whole event would restore them and re-invite the attendees. Edit an occurrence directly (with `recurrenceId`), or delete the event and recreate it.";
|
|
383
|
-
}
|
|
384
|
-
// A non-mailto attendee (e.g. an Apple `urn:uuid:` cal-address) the parser
|
|
385
|
-
// can't reduce to an email — keeping the stored list would drop them.
|
|
386
|
-
if (args.attendees === undefined && base.unparsedAttendeeCount > 0) {
|
|
387
|
-
return "This event has attendee(s) in an address format the connector can’t safely preserve. Pass the complete `attendees` list instead.";
|
|
388
|
-
}
|
|
389
|
-
// A preserved start has to be a clock time or an all-day date.
|
|
390
|
-
if (args.start === undefined && !isReadableTime(base.start)) {
|
|
391
|
-
return "This event has no explicit start time; pass `start` and `end` to edit it.";
|
|
392
|
-
}
|
|
393
|
-
// A preserved end is the stored end, or — when `start` moves — the stored
|
|
394
|
-
// duration carried over; either way both stored values have to be readable.
|
|
395
|
-
// An event stored with DURATION and no DTEND has no end to read.
|
|
396
|
-
if (args.end === undefined &&
|
|
397
|
-
!(isReadableTime(base.start) && isReadableTime(base.end))) {
|
|
398
|
-
return "This event has no explicit end time (e.g. one stored with a DURATION); pass `start` and `end` to edit it.";
|
|
399
|
-
}
|
|
400
|
-
};
|
|
401
|
-
// The effective attendee list: a delta merges add/remove onto the stored
|
|
402
|
-
// attendees (read from Langmail, not re-supplied), an explicit `attendees`
|
|
403
|
-
// replaces them wholesale, and omitting both keeps them as stored.
|
|
404
|
-
const resolveAttendees = (args, isDelta, base) => {
|
|
405
|
-
if (isDelta) {
|
|
406
|
-
const attendees = mergeAttendees(base.attendees, args.addedAttendees ?? [], args.removedAttendees ?? []);
|
|
407
|
-
// A delta that empties the list is likelier a mistake than an intent; the
|
|
408
|
-
// explicit way to strip every attendee is `attendees: []`.
|
|
409
|
-
if (attendees.length === 0) {
|
|
410
|
-
return {
|
|
411
|
-
error: "Removing those attendees would leave the event with none. To keep the event without attendees, pass `attendees: []`; otherwise delete the event or keep at least one attendee.",
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
return { attendees };
|
|
415
|
-
}
|
|
416
|
-
return { attendees: args.attendees ?? base.attendees };
|
|
417
|
-
};
|
|
418
|
-
// Reconciles every editable field: the caller's value wins, and an omitted field
|
|
419
|
-
// keeps the stored one. `location`/`description` accept `""` to clear (an empty
|
|
420
|
-
// string is falsy, so it simply drops the property from the rebuilt VEVENT).
|
|
421
|
-
const resolveEditFields = (args, isDelta, base, timeZone) => {
|
|
422
|
-
const attendees = resolveAttendees(args, isDelta, base);
|
|
423
|
-
if ("error" in attendees) {
|
|
424
|
-
return { error: attendees.error, ok: false };
|
|
425
|
-
}
|
|
426
|
-
const title = args.title ?? base.title;
|
|
427
|
-
if (title === undefined) {
|
|
428
|
-
return {
|
|
429
|
-
error: "This event has no readable title to keep; pass `title`.",
|
|
430
|
-
ok: false,
|
|
431
|
-
};
|
|
432
|
-
}
|
|
433
|
-
const times = resolveEditTimes(args, base, timeZone);
|
|
434
|
-
if (!times.ok) {
|
|
435
|
-
return times;
|
|
436
|
-
}
|
|
437
|
-
const { allDay, end, start } = times.value;
|
|
438
|
-
const location = args.location ?? base.location;
|
|
439
|
-
const description = args.description ?? base.description;
|
|
440
|
-
return {
|
|
441
|
-
ok: true,
|
|
442
|
-
value: {
|
|
443
|
-
alarms: resolveAlarms(args, base),
|
|
444
|
-
allDay,
|
|
445
|
-
attendees: attendees.attendees,
|
|
446
|
-
end,
|
|
447
|
-
start,
|
|
448
|
-
title,
|
|
449
|
-
...(description ? { description } : {}),
|
|
450
|
-
...(location ? { location } : {}),
|
|
451
|
-
...(args.notify === "none" ? { scheduleAgent: "NONE" } : {}),
|
|
452
|
-
},
|
|
453
|
-
};
|
|
454
|
-
};
|
|
455
|
-
// The alarms the edited VEVENT carries: a number replaces every stored alarm
|
|
456
|
-
// with one DISPLAY reminder, `"none"` drops them all, and omitting it carries
|
|
457
|
-
// the stored ones across verbatim.
|
|
458
|
-
const resolveAlarms = (args, base) => {
|
|
459
|
-
if (args.reminderMinutesBefore === NO_REMINDER) {
|
|
460
|
-
return [];
|
|
461
|
-
}
|
|
462
|
-
if (args.reminderMinutesBefore !== undefined) {
|
|
463
|
-
return [{ minutesBefore: args.reminderMinutesBefore }];
|
|
464
|
-
}
|
|
465
|
-
return base.alarms.map((lines) => ({ lines }));
|
|
466
|
-
};
|
|
467
|
-
// Whether the edited event is all-day: the value type of whichever time the
|
|
468
|
-
// caller passed (start first), else the stored event's.
|
|
469
|
-
const targetAllDay = (args, base) => {
|
|
470
|
-
const given = args.start ?? args.end;
|
|
471
|
-
return given === undefined ? base.allDay : isDateOnly(given);
|
|
472
|
-
};
|
|
473
|
-
// Resolves the edited event's times. Passing both `start` and `end` states them
|
|
474
|
-
// outright (and may switch between all-day and timed); passing one or neither
|
|
475
|
-
// carries the rest over from storage, which only makes sense within the stored
|
|
476
|
-
// kind — converting with one side would have to invent the other side's clock
|
|
477
|
-
// time or length.
|
|
478
|
-
const resolveEditTimes = (args, base, timeZone) => {
|
|
479
|
-
const allDay = targetAllDay(args, base);
|
|
480
|
-
if (args.start !== undefined && args.end !== undefined) {
|
|
481
|
-
return resolveEventTimes(args.start, args.end, timeZone, args.timeZone !== undefined);
|
|
482
|
-
}
|
|
483
|
-
if (allDay !== base.allDay) {
|
|
484
|
-
return {
|
|
485
|
-
error: "To switch an event between all-day and timed, pass both `start` and `end` — dates (YYYY-MM-DD, end " +
|
|
486
|
-
"exclusive) for all-day, date-times for timed.",
|
|
487
|
-
ok: false,
|
|
488
|
-
};
|
|
489
|
-
}
|
|
490
|
-
if (args.start === undefined && base.start === undefined) {
|
|
491
|
-
return {
|
|
492
|
-
error: "This event has no readable start to keep; pass `start` and `end`.",
|
|
493
|
-
ok: false,
|
|
494
|
-
};
|
|
495
|
-
}
|
|
496
|
-
// A caller-supplied value is read with the caller's timeZone semantics; a
|
|
497
|
-
// preserved stored value is read as wall-clock in the zone it was *stored* in
|
|
498
|
-
// (base.timeZone), never in the caller's — an explicit `timeZone` on a
|
|
499
|
-
// title-only edit must not silently re-express the event elsewhere.
|
|
500
|
-
const start = args.start === undefined
|
|
501
|
-
? resolveStored(base.start ?? "", base, timeZone)
|
|
502
|
-
: resolveCallerTime(args.start, args, timeZone);
|
|
503
|
-
const end = resolveEnd(args, base, timeZone, start);
|
|
504
|
-
if (end === undefined) {
|
|
505
|
-
return {
|
|
506
|
-
error: "This event has no readable end to keep; pass `start` and `end`.",
|
|
507
|
-
ok: false,
|
|
508
|
-
};
|
|
509
|
-
}
|
|
510
|
-
if (end <= start) {
|
|
511
|
-
return {
|
|
512
|
-
error: allDay
|
|
513
|
-
? allDayEndError(instantToDateOnly(start))
|
|
514
|
-
: "Event end must be after its start.",
|
|
515
|
-
ok: false,
|
|
516
|
-
};
|
|
517
|
-
}
|
|
518
|
-
return { ok: true, value: { allDay, end, start } };
|
|
519
|
-
};
|
|
520
|
-
// A caller's start/end: an all-day date as its UTC midnight, a date-time read
|
|
521
|
-
// with the caller's timeZone semantics.
|
|
522
|
-
const resolveCallerTime = (value, args, timeZone) => isDateOnly(value)
|
|
523
|
-
? dateOnlyToInstant(value)
|
|
524
|
-
: resolveInputDateTime(value, timeZone, args.timeZone !== undefined);
|
|
525
|
-
// The effective end. An explicit `end` wins. Omitting it while moving `start`
|
|
526
|
-
// keeps the event's stored *duration* — "push the standup an hour later" is a
|
|
527
|
-
// one-field call and must not silently stretch the meeting — and omitting it
|
|
528
|
-
// without moving `start` keeps the stored end.
|
|
529
|
-
// A stored wall-clock value, read in the zone it was stored in. `timeZone` is
|
|
530
|
-
// only the fallback for a floating stored time (no TZID, no `Z`), where the
|
|
531
|
-
// caller's zone is the best guess we have.
|
|
532
|
-
const resolveStored = (iso, base, timeZone) => isDateOnly(iso)
|
|
533
|
-
? dateOnlyToInstant(iso)
|
|
534
|
-
: resolveInputDateTime(iso, base.timeZone ?? timeZone, false);
|
|
535
|
-
const resolveEnd = (args, base, timeZone, start) => {
|
|
536
|
-
if (args.end !== undefined) {
|
|
537
|
-
return resolveCallerTime(args.end, args, timeZone);
|
|
538
|
-
}
|
|
539
|
-
if (base.start === undefined || base.end === undefined) {
|
|
540
|
-
return;
|
|
541
|
-
}
|
|
542
|
-
const storedStart = resolveStored(base.start, base, timeZone);
|
|
543
|
-
const storedEnd = resolveStored(base.end, base, timeZone);
|
|
544
|
-
if (args.start === undefined) {
|
|
545
|
-
return storedEnd;
|
|
546
|
-
}
|
|
547
|
-
return new Date(start.getTime() + (storedEnd.getTime() - storedStart.getTime()));
|
|
548
|
-
};
|
|
549
|
-
// The whole-series RRULE for a whole-event edit: an explicit `recurrence`
|
|
550
|
-
// re-rules the series, the `"none"` sentinel collapses it to a one-off, and
|
|
551
|
-
// omitting it keeps the stored rule.
|
|
552
|
-
// Every rule is re-aligned to the edited event (alignUntil), so a preserved rule
|
|
553
|
-
// follows the event across a switch between all-day and timed.
|
|
554
|
-
const resolveRrule = (args, base, allDay, timeZone) => {
|
|
555
|
-
if (args.recurrence === NO_RECURRENCE) {
|
|
556
|
-
return;
|
|
557
|
-
}
|
|
558
|
-
const rrule = args.recurrence === undefined ? base.recurrence : toRRule(args.recurrence);
|
|
559
|
-
return rrule === undefined ? undefined : alignUntil(rrule, allDay, timeZone);
|
|
560
|
-
};
|
|
561
|
-
// True when the edit moves the event: its start, end or all-day flag changes.
|
|
562
|
-
// A reschedule (this, or a new repeat rule — see isSeriesRescheduled) is the
|
|
563
|
-
// one edit every attendee must answer again (RFC 5546 §3.2.2.2); any other
|
|
564
|
-
// edit keeps their replies. Stored times are read exactly the way
|
|
565
|
-
// resolveEditTimes reads preserved ones, so an omitted start/end compares equal.
|
|
566
|
-
const isRescheduled = (f, base, timeZone) => {
|
|
567
|
-
if (f.allDay !== base.allDay ||
|
|
568
|
-
!(isReadableTime(base.start) && isReadableTime(base.end))) {
|
|
569
|
-
return true;
|
|
570
|
-
}
|
|
571
|
-
const storedStart = resolveStored(base.start ?? "", base, timeZone);
|
|
572
|
-
const storedEnd = resolveStored(base.end ?? "", base, timeZone);
|
|
573
|
-
return (f.start.getTime() !== storedStart.getTime() ||
|
|
574
|
-
f.end.getTime() !== storedEnd.getTime());
|
|
575
|
-
};
|
|
576
|
-
// A whole-event edit also reschedules when its resolved rule differs from the
|
|
577
|
-
// stored one, aligned the same way resolveRrule aligns it.
|
|
578
|
-
// Compared by meaning, not spelling (see sameRule).
|
|
579
|
-
const isSeriesRescheduled = (f, base, timeZone, rrule) => isRescheduled(f, base, timeZone) ||
|
|
580
|
-
!sameRule(rrule, base.recurrence === undefined
|
|
581
|
-
? undefined
|
|
582
|
-
: alignUntil(base.recurrence, f.allDay, timeZone));
|
|
583
|
-
// RRULE parts whose value is the RFC 5545 §3.3.10 default, so their presence
|
|
584
|
-
// changes nothing.
|
|
585
|
-
const DEFAULT_RULE_PARTS = new Set(["INTERVAL=1", "WKST=MO"]);
|
|
586
|
-
// True when two RRULEs say the same thing: equal as sets of uppercased
|
|
587
|
-
// KEY=VALUE parts, defaults ignored. A rule another client wrote
|
|
588
|
-
// (`FREQ=WEEKLY;WKST=MO;BYDAY=TU`) and the one toRRule writes for the same
|
|
589
|
-
// series (`FREQ=WEEKLY;BYDAY=TU`) must not read as a reschedule.
|
|
590
|
-
const sameRule = (a, b) => {
|
|
591
|
-
const parts = (rule) => (rule ?? "")
|
|
592
|
-
.toUpperCase()
|
|
593
|
-
.split(";")
|
|
594
|
-
.filter((part) => part !== "" && !DEFAULT_RULE_PARTS.has(part))
|
|
595
|
-
.sort();
|
|
596
|
-
return parts(a).join(";") === parts(b).join(";");
|
|
597
|
-
};
|
|
598
|
-
// RFC 5546 §3.2.2.2: only a reschedule is a new revision, so only it bumps
|
|
599
|
-
// SEQUENCE; a detail edit keeps the current one.
|
|
600
|
-
const nextSequence = (current, rescheduled) => rescheduled ? current + 1 : current;
|
|
601
|
-
// The ATTENDEE lines of the rebuilt VEVENT. A newly invited address starts at
|
|
602
|
-
// NEEDS-ACTION; a stored attendee keeps its CN and ROLE, and its reply too
|
|
603
|
-
// unless the event was rescheduled. SCHEDULE-STATUS is never carried: the
|
|
604
|
-
// server owns it.
|
|
605
|
-
const inviteAttendees = (attendees, stored, rescheduled) => {
|
|
606
|
-
const byEmail = new Map(stored.map((a) => [a.email.toLowerCase(), a]));
|
|
607
|
-
return attendees.map((email) => {
|
|
608
|
-
const known = byEmail.get(email.toLowerCase());
|
|
609
|
-
if (!known) {
|
|
610
|
-
return email;
|
|
611
|
-
}
|
|
612
|
-
return {
|
|
613
|
-
email,
|
|
614
|
-
...(known.name ? { name: known.name } : {}),
|
|
615
|
-
...(known.role ? { role: known.role } : {}),
|
|
616
|
-
...(!rescheduled && known.status ? { status: known.status } : {}),
|
|
617
|
-
};
|
|
618
|
-
});
|
|
619
|
-
};
|
|
620
|
-
// Names for the effective attendees of the contact write-through, recovered
|
|
621
|
-
// from the stored parse where available (a CN survives the rebuild; a
|
|
622
|
-
// freshly added address has none).
|
|
623
|
-
const attendeesWithStoredNames = (attendees, storedMaster) => {
|
|
624
|
-
const names = new Map((storedMaster?.attendees ?? []).map((a) => [a.email.toLowerCase(), a.name]));
|
|
625
|
-
return attendees.map((email) => {
|
|
626
|
-
const name = names.get(email.toLowerCase());
|
|
627
|
-
return { email, ...(name ? { name } : {}) };
|
|
628
|
-
});
|
|
629
|
-
};
|
|
630
|
-
// Moving a series onto a weekday its kept rule doesn't list would produce "that
|
|
631
|
-
// one Friday, plus every Tuesday" (RFC 5545) while reporting success. Only a
|
|
632
|
-
// *preserved* rule can contradict the caller this way — an explicit
|
|
633
|
-
// `recurrence` is the caller's own statement of intent.
|
|
634
|
-
const movedStartConflict = (args, rrule, start, timeZone) => {
|
|
635
|
-
if (!rrule || args.start === undefined || args.recurrence !== undefined) {
|
|
636
|
-
return;
|
|
637
|
-
}
|
|
638
|
-
return startContradictsRule(rrule, start, timeZone)
|
|
639
|
-
? `This series repeats on fixed weekdays (${rrule}), so moving its start alone would add one occurrence ` +
|
|
640
|
-
"instead of moving the series. Pass `recurrence` with the new rule as well."
|
|
641
|
-
: undefined;
|
|
642
|
-
};
|
|
643
|
-
// The stored state an occurrence edit merges against: a previously written
|
|
644
|
-
// override for the same instant if there is one, otherwise a synthetic base
|
|
645
|
-
// standing for the untouched occurrence — the instant `recurrenceId` names,
|
|
646
|
-
// running for the master's duration.
|
|
647
|
-
const occurrenceBase = (stored, master, recurrenceId) => {
|
|
648
|
-
const targetMs = Date.parse(recurrenceId);
|
|
649
|
-
const existingOverride = stored.find((e) => e.recurrenceId !== undefined && Date.parse(e.recurrenceId) === targetMs);
|
|
650
|
-
if (existingOverride) {
|
|
651
|
-
return baseOf(existingOverride);
|
|
652
|
-
}
|
|
653
|
-
const base = baseOf(master);
|
|
654
|
-
if (base.allDay && isDateOnly(base.start) && isDateOnly(base.end)) {
|
|
655
|
-
// An all-day occurrence: the recurrenceId's date, for the master's length
|
|
656
|
-
// in days (both UTC midnights, so the arithmetic is exact).
|
|
657
|
-
const lengthMs = dateOnlyToInstant(base.end).getTime() -
|
|
658
|
-
dateOnlyToInstant(base.start).getTime();
|
|
659
|
-
return {
|
|
660
|
-
...base,
|
|
661
|
-
end: instantToDateOnly(new Date(targetMs + lengthMs)),
|
|
662
|
-
start: instantToDateOnly(new Date(targetMs)),
|
|
663
|
-
};
|
|
664
|
-
}
|
|
665
|
-
if (base.start === undefined ||
|
|
666
|
-
base.end === undefined ||
|
|
667
|
-
!(hasClockTime(base.start) && hasClockTime(base.end))) {
|
|
668
|
-
// DURATION-only master: the occurrence has no slot we can derive, and the
|
|
669
|
-
// master's own DTSTART is the series' *first* day, not this occurrence's.
|
|
670
|
-
// Drop both times so mergeSafetyError refuses unless the caller passes
|
|
671
|
-
// `start` and `end`.
|
|
672
|
-
const { end: _end, start: _start, ...rest } = base;
|
|
673
|
-
return rest;
|
|
674
|
-
}
|
|
675
|
-
// The occurrence's own start/end, expressed exactly the way the master's are
|
|
676
|
-
// — wall clock in the master's zone, or the `…Z` form when it has none — so
|
|
677
|
-
// resolveEditFields reads them back identically.
|
|
678
|
-
const floating = base.timeZone === undefined;
|
|
679
|
-
const zone = base.timeZone ?? UTC_TIME_ZONE;
|
|
680
|
-
const durationMs = resolveInputDateTime(base.end, zone, false).getTime() -
|
|
681
|
-
resolveInputDateTime(base.start, zone, false).getTime();
|
|
682
|
-
const zoned = (at) => `${toWallClockIso(at, zone)}${floating ? "Z" : ""}`;
|
|
683
|
-
return {
|
|
684
|
-
...base,
|
|
685
|
-
end: zoned(new Date(targetMs + durationMs)),
|
|
686
|
-
start: zoned(new Date(targetMs)),
|
|
687
|
-
};
|
|
688
|
-
};
|
|
689
|
-
// True when the master's EXDATEs cancel the instant `recurrenceId` names.
|
|
690
|
-
// Compared by instant, so a DATE exclusion matches the UTC midnight an
|
|
691
|
-
// all-day recurrenceId resolves to.
|
|
692
|
-
const isExcluded = (master, recurrenceId) => {
|
|
693
|
-
const targetMs = Date.parse(recurrenceId);
|
|
694
|
-
return (master.excludedDates ?? []).some((excluded) => Date.parse(excluded) === targetMs);
|
|
695
|
-
};
|
|
696
|
-
// An edit that changes nothing but the reminder. It takes its own path
|
|
697
|
-
// (spliceAlarms) instead of the rebuild: a rebuild hands the event to
|
|
698
|
-
// Stalwart's scheduler, so setting one's own reminder would re-send the
|
|
699
|
-
// invitation to every guest.
|
|
700
|
-
const isReminderOnly = (args) => args.reminderMinutesBefore !== undefined &&
|
|
701
|
-
MUTATING_FIELDS.every((field) => field === "reminderMinutesBefore" || args[field] === undefined);
|
|
702
|
-
// The reminder-only path for one occurrence. An existing override already
|
|
703
|
-
// holds that occurrence's attendee state, so its alarms are spliced like the
|
|
704
|
-
// whole event's. Without one, an override has to be created, which hands the
|
|
705
|
-
// occurrence to Stalwart's scheduler as a fresh REQUEST to every attendee —
|
|
706
|
-
// acceptable for a personal series (nobody to re-invite, so the caller falls
|
|
707
|
-
// through to the normal occurrence path) but not for one with attendees.
|
|
708
|
-
const occurrenceReminderPath = (stored, master, recurrenceId) => {
|
|
709
|
-
const targetMs = Date.parse(recurrenceId);
|
|
710
|
-
const override = stored.find((e) => e.recurrenceId !== undefined && Date.parse(e.recurrenceId) === targetMs);
|
|
711
|
-
if (override) {
|
|
712
|
-
return { override, path: "splice" };
|
|
713
|
-
}
|
|
714
|
-
return { path: (master?.attendees.length ?? 0) > 0 ? "refuse" : "rebuild" };
|
|
715
|
-
};
|
|
716
|
-
const updateReminderOnly = async (deps, existing, master, args, token, scope) => {
|
|
717
|
-
const minutes = args.reminderMinutesBefore === NO_REMINDER
|
|
718
|
-
? null
|
|
719
|
-
: (args.reminderMinutesBefore ?? null);
|
|
720
|
-
const ical = spliceAlarms(existing.data, minutes, scope.kind === "occurrence" ? scope.recurrenceId : undefined);
|
|
721
|
-
await deps.updateEvent({
|
|
722
|
-
ical,
|
|
723
|
-
token,
|
|
724
|
-
url: existing.url,
|
|
725
|
-
...(existing.etag ? { etag: existing.etag } : {}),
|
|
726
|
-
});
|
|
727
|
-
return textResult(`Event "${master?.title || args.uid}" updated (no notifications requested${reminderSummary(args, master?.allDay === true)}); ` +
|
|
728
|
-
REMINDER_SCOPE_NOTE[scope.kind]);
|
|
729
|
-
};
|
|
730
|
-
const REMINDER_SCOPE_NOTE = {
|
|
731
|
-
event: "only the reminder changed.",
|
|
732
|
-
occurrence: "only this occurrence’s reminder changed.",
|
|
733
|
-
series: "only the reminder changed, on the series and every occurrence, including individually changed ones.",
|
|
734
|
-
};
|
|
735
|
-
// The result of a reminder-only edit, or undefined when the edit is not one
|
|
736
|
-
// (or is one for a personal series' un-overridden occurrence, which the
|
|
737
|
-
// normal occurrence path handles without anyone to re-invite).
|
|
738
|
-
const reminderOnlyResult = (e) => {
|
|
739
|
-
if (!isReminderOnly(e.args)) {
|
|
740
|
-
return;
|
|
741
|
-
}
|
|
742
|
-
if (e.recurrenceId === undefined) {
|
|
743
|
-
const kind = e.stored.length > 1 ? "series" : "event";
|
|
744
|
-
return updateReminderOnly(e.deps, e.existing, e.storedMaster, e.args, e.token, { kind });
|
|
745
|
-
}
|
|
746
|
-
const target = occurrenceReminderPath(e.stored, e.storedMaster, e.recurrenceId);
|
|
747
|
-
if (target.path === "splice") {
|
|
748
|
-
// Report from the override being changed: its title and kind (a timed
|
|
749
|
-
// override of an all-day series) can differ from the master's. A foreign
|
|
750
|
-
// override may omit SUMMARY (the parser then yields ''), so fall back to
|
|
751
|
-
// the series title rather than report `Event ""`.
|
|
752
|
-
const described = {
|
|
753
|
-
...target.override,
|
|
754
|
-
title: target.override.title || (e.storedMaster?.title ?? ""),
|
|
755
|
-
};
|
|
756
|
-
return updateReminderOnly(e.deps, e.existing, described, e.args, e.token, {
|
|
757
|
-
kind: "occurrence",
|
|
758
|
-
recurrenceId: e.recurrenceId,
|
|
759
|
-
});
|
|
760
|
-
}
|
|
761
|
-
if (target.path === "refuse") {
|
|
762
|
-
return errorResult("This occurrence has no individual changes yet, so setting its reminder alone would re-send the " +
|
|
763
|
-
"invitation for it to every attendee. Set the reminder on the whole series instead (omit `recurrenceId`). " +
|
|
764
|
-
"Nothing was changed.");
|
|
765
|
-
}
|
|
766
|
-
};
|
|
767
|
-
// What the edit targets: the whole event (merging against the master), or —
|
|
768
|
-
// with `recurrenceId` — one occurrence, named by its normalized instant and
|
|
769
|
-
// merging against that occurrence's own stored state.
|
|
770
|
-
const editScope = (args, stored, storedMaster) => {
|
|
771
|
-
if (args.recurrenceId === undefined) {
|
|
772
|
-
return { base: baseOf(storedMaster) };
|
|
773
|
-
}
|
|
774
|
-
const recurrenceId = resolveRecurrenceId(args.recurrenceId, storedMaster);
|
|
775
|
-
if (!recurrenceId.ok) {
|
|
776
|
-
return { error: recurrenceId.error };
|
|
777
|
-
}
|
|
778
|
-
return {
|
|
779
|
-
base: occurrenceBase(stored, storedMaster, recurrenceId.value),
|
|
780
|
-
recurrenceId: recurrenceId.value,
|
|
781
|
-
};
|
|
782
|
-
};
|
|
783
|
-
// Serializes the whole-event edit as a single VEVENT: the fields the edit
|
|
784
|
-
// resolved, plus every stored property the builder doesn't write.
|
|
785
|
-
const rebuildEvent = ({ args, f, invitees, organizer, rrule, sequence, stored, storedIcal, timeZone, }) => {
|
|
786
|
-
const built = buildInvite({
|
|
787
|
-
alarms: f.alarms,
|
|
788
|
-
allDay: f.allDay,
|
|
789
|
-
attendees: invitees,
|
|
790
|
-
end: f.end,
|
|
791
|
-
// Keep the stored ORGANIZER (see updateOccurrence): re-stamping the freshly
|
|
792
|
-
// discovered principal onto an event created under a previous account
|
|
793
|
-
// address silently changes the organizer, which Stalwart's scheduler treats
|
|
794
|
-
// as an unsupported organizer replacement (RFC 6638).
|
|
795
|
-
organizer: stored.find((e) => e.organizer)?.organizer ?? organizer,
|
|
796
|
-
// Bumped past the stored SEQUENCE only on a reschedule (see the caller).
|
|
797
|
-
sequence,
|
|
798
|
-
start: f.start,
|
|
799
|
-
timeZone,
|
|
800
|
-
title: f.title,
|
|
801
|
-
uid: args.uid,
|
|
802
|
-
...(f.description ? { description: f.description } : {}),
|
|
803
|
-
...(f.location ? { location: f.location } : {}),
|
|
804
|
-
...(rrule ? { rrule } : {}),
|
|
805
|
-
...(f.scheduleAgent ? { scheduleAgent: f.scheduleAgent } : {}),
|
|
806
|
-
});
|
|
807
|
-
return carryStoredProperties(built, storedIcal, {
|
|
808
|
-
replaced: replacedProperties(args),
|
|
809
|
-
});
|
|
810
|
-
};
|
|
811
|
-
export const updateCalendarEvent = async (deps, ctx) => {
|
|
812
|
-
const { args, token } = ctx;
|
|
813
|
-
// A delta edit names the attendees to add/remove instead of the whole list.
|
|
814
|
-
const isDelta = args.addedAttendees !== undefined || args.removedAttendees !== undefined;
|
|
815
|
-
const comboError = combinationError(args, isDelta);
|
|
816
|
-
if (comboError) {
|
|
817
|
-
return errorResult(comboError);
|
|
818
|
-
}
|
|
819
|
-
const account = await deps.discover(token);
|
|
820
|
-
if (!account.organizer) {
|
|
821
|
-
return errorResult("Could not determine an organizer address for this account.");
|
|
822
|
-
}
|
|
823
|
-
const resolved = resolveCalendarUrl(account, args.calendarUrl);
|
|
824
|
-
if (!resolved.ok) {
|
|
825
|
-
return errorResult(resolved.reason === "none"
|
|
826
|
-
? "No calendar available to update the event in."
|
|
827
|
-
: `Calendar not found: ${args.calendarUrl}`);
|
|
828
|
-
}
|
|
829
|
-
const existing = await deps.fetchEvent({
|
|
830
|
-
calendarUrl: resolved.url,
|
|
831
|
-
token,
|
|
832
|
-
uid: args.uid,
|
|
833
|
-
});
|
|
834
|
-
if (!existing) {
|
|
835
|
-
return errorResult(`Event not found: ${args.uid}`);
|
|
836
|
-
}
|
|
837
|
-
const stored = parseEvents(existing.data);
|
|
838
|
-
const storedMaster = stored.find((e) => e.recurrence !== undefined) ?? stored[0];
|
|
839
|
-
const timeZone = args.timeZone ??
|
|
840
|
-
storedMaster?.startTzid ??
|
|
841
|
-
(await deps.resolveTimeZone(token)) ??
|
|
842
|
-
UTC_TIME_ZONE;
|
|
843
|
-
const scope = editScope(args, stored, storedMaster);
|
|
844
|
-
if ("error" in scope) {
|
|
845
|
-
return errorResult(`${scope.error} Nothing was changed.`);
|
|
846
|
-
}
|
|
847
|
-
const { base, recurrenceId } = scope;
|
|
848
|
-
const reminderOnly = await reminderOnlyResult({
|
|
849
|
-
args,
|
|
850
|
-
deps,
|
|
851
|
-
existing,
|
|
852
|
-
recurrenceId,
|
|
853
|
-
stored,
|
|
854
|
-
storedMaster,
|
|
855
|
-
token,
|
|
856
|
-
});
|
|
857
|
-
if (reminderOnly) {
|
|
858
|
-
return reminderOnly;
|
|
859
|
-
}
|
|
860
|
-
const unsafe = mergeSafetyError(stored, base, args);
|
|
861
|
-
if (unsafe) {
|
|
862
|
-
return errorResult(unsafe);
|
|
863
|
-
}
|
|
864
|
-
const fields = resolveEditFields(args, isDelta, base, timeZone);
|
|
865
|
-
if (!fields.ok) {
|
|
866
|
-
return errorResult(`${fields.error} Nothing was changed.`);
|
|
867
|
-
}
|
|
868
|
-
const f = fields.value;
|
|
869
|
-
const removed = removedAttendees(base.attendees, f.attendees);
|
|
870
|
-
if (recurrenceId !== undefined) {
|
|
871
|
-
const rescheduled = isRescheduled(f, base, timeZone);
|
|
872
|
-
return updateOccurrence({
|
|
873
|
-
args,
|
|
874
|
-
deps,
|
|
875
|
-
existing,
|
|
876
|
-
invitees: inviteAttendees(f.attendees, base.storedAttendees, rescheduled),
|
|
877
|
-
organizer: account.organizer,
|
|
878
|
-
recurrenceId,
|
|
879
|
-
removedAttendees: removed,
|
|
880
|
-
rescheduled,
|
|
881
|
-
timeZone,
|
|
882
|
-
token,
|
|
883
|
-
...f,
|
|
884
|
-
});
|
|
885
|
-
}
|
|
886
|
-
const rrule = resolveRrule(args, base, f.allDay, timeZone);
|
|
887
|
-
// All-day dates are UTC midnights, so their weekday is read in UTC.
|
|
888
|
-
const ruleConflict = movedStartConflict(args, rrule, f.start, f.allDay ? UTC_TIME_ZONE : timeZone);
|
|
889
|
-
if (ruleConflict) {
|
|
890
|
-
return errorResult(ruleConflict);
|
|
891
|
-
}
|
|
892
|
-
const rescheduled = isSeriesRescheduled(f, base, timeZone, rrule);
|
|
893
|
-
const sequence = nextSequence(parseSequence(existing.data), rescheduled);
|
|
894
|
-
const ical = rebuildEvent({
|
|
895
|
-
args,
|
|
896
|
-
f,
|
|
897
|
-
invitees: inviteAttendees(f.attendees, base.storedAttendees, rescheduled),
|
|
898
|
-
organizer: account.organizer,
|
|
899
|
-
sequence,
|
|
900
|
-
stored,
|
|
901
|
-
storedIcal: existing.data,
|
|
902
|
-
timeZone,
|
|
903
|
-
...(rrule ? { rrule } : {}),
|
|
904
|
-
});
|
|
905
|
-
await deps.updateEvent({
|
|
906
|
-
ical,
|
|
907
|
-
token,
|
|
908
|
-
url: existing.url,
|
|
909
|
-
...(existing.etag ? { etag: existing.etag } : {}),
|
|
910
|
-
});
|
|
911
|
-
logSchedulingHandover({
|
|
912
|
-
attendees: f.attendees,
|
|
913
|
-
ical,
|
|
914
|
-
removedAttendees: removed,
|
|
915
|
-
scheduleAgent: f.scheduleAgent,
|
|
916
|
-
sequence,
|
|
917
|
-
tool: TOOL_NAME,
|
|
918
|
-
uid: args.uid,
|
|
919
|
-
});
|
|
920
|
-
await deps.collectAttendees?.({
|
|
921
|
-
attendees: attendeesWithStoredNames(f.attendees, storedMaster),
|
|
922
|
-
// The same stored-organizer preference rebuildEvent applies, so the
|
|
923
|
-
// collected card credits whoever actually owns the event.
|
|
924
|
-
organizer: stored.find((e) => e.organizer)?.organizer ?? account.organizer,
|
|
925
|
-
selfAddress: account.organizer,
|
|
926
|
-
start: f.start.toISOString(),
|
|
927
|
-
token,
|
|
928
|
-
uid: args.uid,
|
|
929
|
-
});
|
|
930
|
-
return textResult(`${rrule ? "Recurring event" : "Event"} "${f.title}" updated ` +
|
|
931
|
-
`(${deliverySummary(f.attendees, f.scheduleAgent, removed.length > 0)}${reminderSummary(args, f.allDay)}).`);
|
|
932
|
-
};
|
|
933
|
-
// --- live-deps wiring ----------------------------------------------------
|
|
934
|
-
export const makeLiveDeps = (cfg,
|
|
935
|
-
// Shared across the calendar tools (see mcp/handler.ts) so create→update reuse
|
|
936
|
-
// one per-token cache; defaults to a fresh resolver for standalone callers.
|
|
937
|
-
resolveTimeZone = makeAccountTimeZoneResolver({
|
|
938
|
-
serverUrl: cfg.serverUrl,
|
|
939
|
-
}), collectAttendees) => ({
|
|
940
|
-
discover: (token) => discoverAccount(cfg, token),
|
|
941
|
-
fetchEvent: (params) => fetchEvent(cfg, params),
|
|
942
|
-
resolveTimeZone,
|
|
943
|
-
updateEvent: (params) => updateEvent(cfg, params),
|
|
944
|
-
...(collectAttendees ? { collectAttendees } : {}),
|
|
945
|
-
});
|
|
946
|
-
// --- MCP registration ----------------------------------------------------
|
|
947
|
-
export const registerUpdateCalendarEvent = (server, deps,
|
|
948
|
-
// Bearer threaded per request — see mcp/handler.ts.
|
|
949
|
-
getToken) => {
|
|
950
|
-
server.registerTool(TOOL_NAME, {
|
|
951
|
-
annotations: OUTWARD_DESTRUCTIVE,
|
|
952
|
-
// Kept short and front-loaded with the words a user actually types
|
|
953
|
-
// ("update", "edit", "reschedule", "move", "change the time", "add
|
|
954
|
-
// attendees"): tool search ranks this string plus the argument
|
|
955
|
-
// descriptions, and BM25 penalises long documents. Edge-case semantics
|
|
956
|
-
// live in the error messages and on the docs site, not here.
|
|
957
|
-
description: "Update, edit or reschedule an existing calendar event or meeting: move it to a new time, " +
|
|
958
|
-
"change the time or title, set the location, or add and remove attendees. Pass the event `uid` " +
|
|
959
|
-
"(from list_calendar_events or create_calendar_event) plus only the fields to change — every " +
|
|
960
|
-
"field you omit keeps its stored value, so rescheduling needs nothing but `uid` and `start`. " +
|
|
961
|
-
"All-day events stay all-day; pass `start`/`end` as dates or date-times to switch. Set or clear " +
|
|
962
|
-
"a reminder with `reminderMinutesBefore`. " +
|
|
963
|
-
'Attendees are re-notified by iMIP unless you pass `notify: "none"`. To change one occurrence ' +
|
|
964
|
-
"of a repeating series instead of the whole series, pass `recurrenceId`. To rename or recolor " +
|
|
965
|
-
"a calendar itself, use update_calendar. To put an event on a different calendar, use " +
|
|
966
|
-
"move_calendar_events.",
|
|
967
|
-
inputSchema: updateCalendarEventInput,
|
|
968
|
-
title: "Update calendar event",
|
|
969
|
-
}, (args) => {
|
|
970
|
-
const parsed = updateCalendarEventInput.parse(args);
|
|
971
|
-
return updateCalendarEvent(deps, { args: parsed, token: getToken() });
|
|
972
|
-
});
|
|
973
|
-
};
|