@pipedream/google_calendar 0.8.4 → 0.8.6
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/actions/add-attendees-to-event/add-attendees-to-event.mjs +1 -1
- package/actions/common/create-event-common.mjs +27 -7
- package/actions/create-event/create-event.mjs +27 -27
- package/actions/delete-event/delete-event.mjs +1 -1
- package/actions/get-calendar/get-calendar.mjs +1 -1
- package/actions/get-current-user/get-current-user.mjs +1 -1
- package/actions/get-date-time/get-date-time.mjs +1 -1
- package/actions/get-event/get-event.mjs +1 -1
- package/actions/list-calendars/list-calendars.mjs +1 -1
- package/actions/list-event-instances/list-event-instances.mjs +1 -1
- package/actions/list-events/list-events.mjs +1 -1
- package/actions/query-free-busy-calendars/query-free-busy-calendars.mjs +1 -1
- package/actions/quick-add-event/quick-add-event.mjs +1 -1
- package/actions/update-event/update-event.mjs +2 -12
- package/actions/update-event-instance/update-event-instance.mjs +1 -1
- package/actions/update-following-instances/update-following-instances.mjs +103 -56
- package/common/constants.mjs +36 -0
- package/package.json +1 -1
- package/sources/event-cancelled/event-cancelled.mjs +1 -1
- package/sources/event-ended/event-ended.mjs +1 -1
- package/sources/new-calendar/new-calendar.mjs +1 -1
- package/sources/new-event-search/new-event-search.mjs +1 -1
- package/sources/new-or-updated-event-instant/new-or-updated-event-instant.mjs +1 -1
- package/sources/upcoming-event-alert/upcoming-event-alert.mjs +1 -1
- package/sources/upcoming-event-alert-polling/upcoming-event-alert-polling.mjs +1 -1
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "google_calendar-add-attendees-to-event",
|
|
6
6
|
name: "Add Attendees To Event",
|
|
7
7
|
description: "Add attendees to an existing event. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#update)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.7",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: true,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -46,28 +46,31 @@ export default {
|
|
|
46
46
|
description: "Select a frequency to make this event repeating",
|
|
47
47
|
optional: true,
|
|
48
48
|
options: Object.keys(constants.REPEAT_FREQUENCIES),
|
|
49
|
-
reloadProps: true,
|
|
50
49
|
},
|
|
51
50
|
repeatInterval: {
|
|
52
51
|
type: "integer",
|
|
53
52
|
label: "Repeat Interval",
|
|
54
53
|
description: "Enter 1 to \"repeat every day\", enter 2 to \"repeat every other day\", etc. Defaults to 1.",
|
|
55
54
|
optional: true,
|
|
56
|
-
|
|
55
|
+
},
|
|
56
|
+
repeatSpecificDays: {
|
|
57
|
+
type: "string[]",
|
|
58
|
+
label: "Repeat Specific Days",
|
|
59
|
+
description: "The event will repeat on these days of the week. Repeat Frequency must be `WEEKLY`.",
|
|
60
|
+
optional: true,
|
|
61
|
+
options: constants.DAYS_OF_WEEK,
|
|
57
62
|
},
|
|
58
63
|
repeatUntil: {
|
|
59
64
|
type: "string",
|
|
60
65
|
label: "Repeat Until",
|
|
61
|
-
description: "The event will repeat only until this date, if set",
|
|
66
|
+
description: "The event will repeat only until this date, if set. Only one of `Repeat Until` or Repeat `How Many Times` may be entered.",
|
|
62
67
|
optional: true,
|
|
63
|
-
hidden: true,
|
|
64
68
|
},
|
|
65
69
|
repeatTimes: {
|
|
66
70
|
type: "integer",
|
|
67
71
|
label: "Repeat How Many Times?",
|
|
68
|
-
description: "Limit the number of times this event will occur",
|
|
72
|
+
description: "Limit the number of times this event will occur. Only one of `Repeat Until` or Repeat `How Many Times` may be entered.",
|
|
69
73
|
optional: true,
|
|
70
|
-
hidden: true,
|
|
71
74
|
},
|
|
72
75
|
}
|
|
73
76
|
),
|
|
@@ -159,15 +162,32 @@ export default {
|
|
|
159
162
|
repeatInterval,
|
|
160
163
|
repeatTimes,
|
|
161
164
|
repeatUntil,
|
|
165
|
+
repeatSpecificDays,
|
|
162
166
|
}) {
|
|
167
|
+
if (!repeatFrequency
|
|
168
|
+
&& (repeatInterval || repeatTimes || repeatUntil || repeatSpecificDays)
|
|
169
|
+
) {
|
|
170
|
+
throw new ConfigurationError("`Repeat Frequency` is required when `Repeat Interval`, `Repeat Times`, `Repeat Until`, or `Repeat Specific Days` is entered.");
|
|
171
|
+
}
|
|
163
172
|
if (!repeatFrequency) {
|
|
164
173
|
return;
|
|
165
174
|
}
|
|
166
175
|
if (repeatTimes && repeatUntil) {
|
|
167
176
|
throw new ConfigurationError("Only one of `Repeat Until` or Repeat `How Many Times` may be entered");
|
|
168
177
|
}
|
|
178
|
+
if (repeatSpecificDays && repeatFrequency !== "WEEKLY") {
|
|
179
|
+
throw new ConfigurationError("`Repeat Specific Days` is only for use with `Repeat Frequency` of `WEEKLY`.");
|
|
180
|
+
}
|
|
169
181
|
|
|
170
|
-
let recurrence = `RRULE:FREQ=${repeatFrequency}
|
|
182
|
+
let recurrence = `RRULE:FREQ=${repeatFrequency}` ;
|
|
183
|
+
if (repeatSpecificDays?.length) {
|
|
184
|
+
const byDay = [
|
|
185
|
+
...new Set(
|
|
186
|
+
repeatSpecificDays.flatMap((value) => value.split(",")),
|
|
187
|
+
),
|
|
188
|
+
].join(",");
|
|
189
|
+
recurrence = `${recurrence};BYDAY=${byDay}`;
|
|
190
|
+
}
|
|
171
191
|
if (repeatInterval) {
|
|
172
192
|
recurrence = `${recurrence};INTERVAL=${repeatInterval}`;
|
|
173
193
|
}
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "google_calendar-create-event",
|
|
8
8
|
name: "Create Event",
|
|
9
9
|
description: "Create an event in a Google Calendar. [See the documentation](https://developers.google.com/calendar/api/v3/reference/events/insert)",
|
|
10
|
-
version: "1.0.
|
|
10
|
+
version: "1.0.2",
|
|
11
11
|
annotations: {
|
|
12
12
|
destructiveHint: false,
|
|
13
13
|
openWorldHint: true,
|
|
@@ -97,33 +97,32 @@ export default {
|
|
|
97
97
|
description: "Select a frequency to make this event repeating",
|
|
98
98
|
optional: true,
|
|
99
99
|
options: Object.keys(constants.REPEAT_FREQUENCIES),
|
|
100
|
-
reloadProps: true,
|
|
101
100
|
},
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
101
|
+
repeatInterval: {
|
|
102
|
+
type: "integer",
|
|
103
|
+
label: "Repeat Interval",
|
|
104
|
+
description: "Enter 1 to \"repeat every day\", enter 2 to \"repeat every other day\", etc. Defaults to 1.",
|
|
105
|
+
optional: true,
|
|
106
|
+
},
|
|
107
|
+
repeatSpecificDays: {
|
|
108
|
+
type: "string[]",
|
|
109
|
+
label: "Repeat Specific Days",
|
|
110
|
+
description: "The event will repeat on these days of the week. Repeat Frequency must be `WEEKLY`.",
|
|
111
|
+
optional: true,
|
|
112
|
+
options: constants.DAYS_OF_WEEK,
|
|
113
|
+
},
|
|
114
|
+
repeatUntil: {
|
|
115
|
+
type: "string",
|
|
116
|
+
label: "Repeat Until",
|
|
117
|
+
description: "The event will repeat only until this date, if set. Only one of `Repeat Until` or Repeat `How Many Times` may be entered.",
|
|
118
|
+
optional: true,
|
|
119
|
+
},
|
|
120
|
+
repeatTimes: {
|
|
121
|
+
type: "integer",
|
|
122
|
+
label: "Repeat How Many Times?",
|
|
123
|
+
description: "Limit the number of times this event will occur. Only one of `Repeat Until` or Repeat `How Many Times` may be entered.",
|
|
124
|
+
optional: true,
|
|
125
|
+
},
|
|
127
126
|
},
|
|
128
127
|
methods: {
|
|
129
128
|
...createEventCommon.methods,
|
|
@@ -136,6 +135,7 @@ export default {
|
|
|
136
135
|
repeatInterval: this.repeatInterval,
|
|
137
136
|
repeatTimes: this.repeatTimes,
|
|
138
137
|
repeatUntil: this.repeatUntil,
|
|
138
|
+
repeatSpecificDays: this.repeatSpecificDays,
|
|
139
139
|
});
|
|
140
140
|
|
|
141
141
|
const trimmedStart = this.eventStartDate?.trim();
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_calendar-delete-event",
|
|
5
5
|
name: "Delete an Event",
|
|
6
6
|
description: "Delete an event from a Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#delete)",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.10",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: true,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_calendar-get-calendar",
|
|
5
5
|
name: "Retrieve Calendar Details",
|
|
6
6
|
description: "Retrieve calendar details of a Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Calendars.html#get)",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.11",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -7,7 +7,7 @@ export default {
|
|
|
7
7
|
key: "google_calendar-get-current-user",
|
|
8
8
|
name: "Get Current User",
|
|
9
9
|
description: "Retrieve information about the authenticated Google Calendar account, including the primary calendar (summary, timezone, ACL flags), a list of accessible calendars, user-level settings (timezone, locale, week start), and the color palette that controls events and calendars. Ideal for confirming which calendar account is in use, customizing downstream scheduling, or equipping LLMs with the user’s context (timezones, available calendars) prior to creating or updating events. [See the documentation](https://developers.google.com/calendar/api/v3/reference/calendars/get).",
|
|
10
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.3",
|
|
11
11
|
type: "action",
|
|
12
12
|
annotations: {
|
|
13
13
|
destructiveHint: false,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_calendar-get-date-time",
|
|
5
5
|
name: "Get Date Time",
|
|
6
6
|
description: "Get current date and time for use in Google Calendar actions. Useful for agents that need datetime awareness and timezone context before calling other Google Calendar tools.",
|
|
7
|
-
version: "0.0.
|
|
7
|
+
version: "0.0.2",
|
|
8
8
|
type: "action",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_calendar-get-event",
|
|
5
5
|
name: "Retrieve Event Details",
|
|
6
6
|
description: "Retrieve event details from Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#get)",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.11",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
key: "google_calendar-list-calendars",
|
|
5
5
|
name: "List Calendars",
|
|
6
6
|
description: "Retrieve a list of calendars from Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Calendarlist.html#list)",
|
|
7
|
-
version: "0.1.
|
|
7
|
+
version: "0.1.11",
|
|
8
8
|
annotations: {
|
|
9
9
|
destructiveHint: false,
|
|
10
10
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "google_calendar-list-event-instances",
|
|
6
6
|
name: "List Event Instances",
|
|
7
7
|
description: "Retrieve instances of a recurring event. [See the documentation](https://developers.google.com/calendar/api/v3/reference/events/instances)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.3",
|
|
9
9
|
type: "action",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: false,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_calendar-list-events",
|
|
7
7
|
name: "List Events",
|
|
8
8
|
description: "Retrieve a list of event from the Google Calendar. [See the documentation](https://developers.google.com/calendar/api/v3/reference/events/list)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.14",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: false,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "google_calendar-query-free-busy-calendars",
|
|
6
6
|
name: "Retrieve Free/Busy Calendar Details",
|
|
7
7
|
description: "Retrieve free/busy calendar details from Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Freebusy.html#query)",
|
|
8
|
-
version: "0.2.
|
|
8
|
+
version: "0.2.1",
|
|
9
9
|
annotations: {
|
|
10
10
|
destructiveHint: false,
|
|
11
11
|
openWorldHint: true,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_calendar-quick-add-event",
|
|
7
7
|
name: "Add Quick Event",
|
|
8
8
|
description: "Create a quick event to the Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#quickAdd)",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.12",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: false,
|
|
12
12
|
openWorldHint: true,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import googleCalendar from "../../google_calendar.app.mjs";
|
|
2
2
|
import createEventCommon from "../common/create-event-common.mjs";
|
|
3
|
-
import constants from "../../common/constants.mjs";
|
|
4
3
|
|
|
5
4
|
export default {
|
|
6
5
|
key: "google_calendar-update-event",
|
|
7
6
|
name: "Update Event",
|
|
8
7
|
description: "Update an event from Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#update)",
|
|
9
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.15",
|
|
10
9
|
annotations: {
|
|
11
10
|
destructiveHint: true,
|
|
12
11
|
openWorldHint: true,
|
|
@@ -46,16 +45,6 @@ export default {
|
|
|
46
45
|
],
|
|
47
46
|
},
|
|
48
47
|
},
|
|
49
|
-
async additionalProps(props) {
|
|
50
|
-
if (this.repeatFrequency) {
|
|
51
|
-
const frequency = constants.REPEAT_FREQUENCIES[this.repeatFrequency];
|
|
52
|
-
props.repeatInterval.description = `Enter 1 to "repeat every ${frequency}", enter 2 to "repeat every other ${frequency}", etc. Defaults to 1.`;
|
|
53
|
-
}
|
|
54
|
-
props.repeatInterval.hidden = !this.repeatFrequency;
|
|
55
|
-
props.repeatUntil.hidden = !this.repeatFrequency;
|
|
56
|
-
props.repeatTimes.hidden = !this.repeatFrequency;
|
|
57
|
-
return {};
|
|
58
|
-
},
|
|
59
48
|
methods: {
|
|
60
49
|
...createEventCommon.methods,
|
|
61
50
|
},
|
|
@@ -72,6 +61,7 @@ export default {
|
|
|
72
61
|
repeatInterval: this.repeatInterval,
|
|
73
62
|
repeatTimes: this.repeatTimes,
|
|
74
63
|
repeatUntil: this.repeatUntil,
|
|
64
|
+
repeatSpecificDays: this.repeatSpecificDays,
|
|
75
65
|
});
|
|
76
66
|
|
|
77
67
|
const response = await this.googleCalendar.updateEvent({
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "google_calendar-update-event-instance",
|
|
6
6
|
name: "Update Event Instance",
|
|
7
7
|
description: "Update a specific instance of a recurring event. Changes apply only to the selected instance. [See the documentation](https://developers.google.com/calendar/api/v3/reference/events/update)",
|
|
8
|
-
version: "0.0.
|
|
8
|
+
version: "0.0.4",
|
|
9
9
|
type: "action",
|
|
10
10
|
annotations: {
|
|
11
11
|
destructiveHint: true,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_calendar-update-following-instances",
|
|
7
7
|
name: "Update Following Event Instances",
|
|
8
8
|
description: "Update all instances of a recurring event following a specific instance. This creates a new recurring event starting from the selected instance. [See the documentation](https://developers.google.com/calendar/api/guides/recurringevents#modifying_all_following_instances)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.5",
|
|
10
10
|
type: "action",
|
|
11
11
|
annotations: {
|
|
12
12
|
destructiveHint: true,
|
|
@@ -191,69 +191,116 @@ export default {
|
|
|
191
191
|
const instanceStartDate = targetInstance.start.dateTime || targetInstance.start.date;
|
|
192
192
|
const untilDate = this.calculateUntilDate(instanceStartDate);
|
|
193
193
|
|
|
194
|
-
// Step 3:
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
await this.googleCalendar.updateEvent({
|
|
194
|
+
// Step 3: Delete the target instance while it is still a valid part of the
|
|
195
|
+
// series. This must happen before trimming the RRULE — once UNTIL excludes the
|
|
196
|
+
// instance, Google Calendar rejects the delete with a 400 Bad Request.
|
|
197
|
+
// Explicit deletion prevents the instance from appearing as an orphaned
|
|
198
|
+
// duplicate after the series is split.
|
|
199
|
+
await this.googleCalendar.deleteEvent({
|
|
201
200
|
calendarId: this.calendarId,
|
|
202
|
-
eventId: this.
|
|
201
|
+
eventId: this.instanceId,
|
|
203
202
|
sendUpdates: this.sendUpdates,
|
|
204
|
-
requestBody: {
|
|
205
|
-
...originalEvent,
|
|
206
|
-
recurrence: trimmedRecurrence,
|
|
207
|
-
},
|
|
208
203
|
});
|
|
209
204
|
|
|
210
|
-
//
|
|
211
|
-
|
|
212
|
-
|
|
205
|
+
// Steps 4 & 5 are wrapped in a try/catch: the delete above is irreversible,
|
|
206
|
+
// so if either subsequent call fails we attempt to restore the deleted instance
|
|
207
|
+
// (by patching its status back to "confirmed") before re-throwing. If the
|
|
208
|
+
// restore itself fails we emit a distinct partial-failure summary so the caller
|
|
209
|
+
// knows the instance is gone and manual intervention is required.
|
|
210
|
+
let step4TrimApplied = false;
|
|
211
|
+
try {
|
|
212
|
+
// Step 4: Trim the original recurring event
|
|
213
|
+
const trimmedRecurrence = this.modifyRecurrenceRule(
|
|
214
|
+
originalEvent.recurrence,
|
|
215
|
+
untilDate,
|
|
216
|
+
);
|
|
213
217
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
218
|
+
await this.googleCalendar.updateEvent({
|
|
219
|
+
calendarId: this.calendarId,
|
|
220
|
+
eventId: this.recurringEventId,
|
|
221
|
+
sendUpdates: this.sendUpdates,
|
|
222
|
+
requestBody: {
|
|
223
|
+
...originalEvent,
|
|
224
|
+
recurrence: trimmedRecurrence,
|
|
225
|
+
},
|
|
222
226
|
});
|
|
223
|
-
|
|
224
|
-
// Use original recurrence rules
|
|
225
|
-
newRecurrence = originalEvent.recurrence;
|
|
226
|
-
}
|
|
227
|
+
step4TrimApplied = true;
|
|
227
228
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
229
|
+
// Step 5: Create new recurring event with changes
|
|
230
|
+
const timeZone = await this.getTimeZone(this.timeZone || targetInstance.start.timeZone);
|
|
231
|
+
const attendees = this.formatAttendees(this.attendees, originalEvent.attendees);
|
|
232
|
+
|
|
233
|
+
// Determine recurrence for new event
|
|
234
|
+
let newRecurrence;
|
|
235
|
+
if (this.repeatFrequency) {
|
|
236
|
+
newRecurrence = this.formatRecurrence({
|
|
237
|
+
repeatFrequency: this.repeatFrequency,
|
|
238
|
+
repeatInterval: this.repeatInterval,
|
|
239
|
+
repeatTimes: this.repeatTimes,
|
|
240
|
+
repeatUntil: this.repeatUntil,
|
|
241
|
+
});
|
|
242
|
+
} else {
|
|
243
|
+
// Inherit original recurrence rules, but strip any COUNT so the tail
|
|
244
|
+
// series does not reapply the original total-count from the beginning.
|
|
245
|
+
newRecurrence = originalEvent.recurrence?.map((rule) => {
|
|
246
|
+
if (!rule.startsWith("RRULE:")) {
|
|
247
|
+
return rule;
|
|
248
|
+
}
|
|
249
|
+
return rule.replace(/;COUNT=[^;]+/g, "");
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const newEvent = await this.googleCalendar.createEvent({
|
|
254
|
+
calendarId: this.calendarId,
|
|
255
|
+
sendUpdates: this.sendUpdates,
|
|
256
|
+
resource: {
|
|
257
|
+
summary: this.summary || originalEvent.summary,
|
|
258
|
+
location: this.location || originalEvent.location,
|
|
259
|
+
description: this.description || originalEvent.description,
|
|
260
|
+
start: this.getDateParam({
|
|
261
|
+
date: this.eventStartDate || instanceStartDate,
|
|
262
|
+
timeZone: timeZone || targetInstance.start.timeZone,
|
|
263
|
+
}),
|
|
264
|
+
end: this.getDateParam({
|
|
265
|
+
date: this.eventEndDate || targetInstance.end.dateTime || targetInstance.end.date,
|
|
266
|
+
timeZone: timeZone || targetInstance.end.timeZone,
|
|
267
|
+
}),
|
|
268
|
+
recurrence: newRecurrence,
|
|
269
|
+
attendees,
|
|
270
|
+
colorId: this.colorId || originalEvent.colorId,
|
|
271
|
+
},
|
|
272
|
+
});
|
|
248
273
|
|
|
249
|
-
|
|
274
|
+
$.export("$summary", `Successfully split recurring event. Original trimmed, new event created with ID: \`${newEvent.id}\``);
|
|
250
275
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
276
|
+
return {
|
|
277
|
+
originalEvent: {
|
|
278
|
+
id: this.recurringEventId,
|
|
279
|
+
trimmedRecurrence,
|
|
280
|
+
},
|
|
281
|
+
newEvent,
|
|
282
|
+
};
|
|
283
|
+
} catch (splitError) {
|
|
284
|
+
// Attempt to restore the deleted instance by patching its status back to
|
|
285
|
+
// "confirmed". The instance ID is still valid as a cancelled exception.
|
|
286
|
+
try {
|
|
287
|
+
await this.googleCalendar.updateEvent({
|
|
288
|
+
calendarId: this.calendarId,
|
|
289
|
+
eventId: this.instanceId,
|
|
290
|
+
sendUpdates: this.sendUpdates,
|
|
291
|
+
requestBody: {
|
|
292
|
+
...targetInstance,
|
|
293
|
+
status: "confirmed",
|
|
294
|
+
},
|
|
295
|
+
});
|
|
296
|
+
if (step4TrimApplied) {
|
|
297
|
+
$.export("$summary", `Partial failure: the original instance (${this.instanceId}) was restored but the series RRULE was already trimmed and the new event was not created. The series may require manual repair.`);
|
|
298
|
+
}
|
|
299
|
+
} catch (_restoreError) {
|
|
300
|
+
$.export("$summary", `Partial failure: the original instance (${this.instanceId}) was deleted but the split could not be completed and automatic restoration failed. Manual intervention required.`);
|
|
301
|
+
throw splitError;
|
|
302
|
+
}
|
|
303
|
+
throw splitError;
|
|
304
|
+
}
|
|
258
305
|
},
|
|
259
306
|
};
|
package/common/constants.mjs
CHANGED
|
@@ -89,8 +89,44 @@ const WEBHOOK_SUBSCRIPTION_EXPIRATION_TIME_MILLISECONDS = 24 * 60 * 60 * 1000;
|
|
|
89
89
|
const WEBHOOK_SUBSCRIPTION_RENEWAL_SECONDS =
|
|
90
90
|
(WEBHOOK_SUBSCRIPTION_EXPIRATION_TIME_MILLISECONDS * 0.95) / 1000;
|
|
91
91
|
|
|
92
|
+
const DAYS_OF_WEEK = [
|
|
93
|
+
{
|
|
94
|
+
label: "Sunday",
|
|
95
|
+
value: "SU",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
label: "Monday",
|
|
99
|
+
value: "MO",
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
label: "Tuesday",
|
|
103
|
+
value: "TU",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
label: "Wednesday",
|
|
107
|
+
value: "WE",
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
label: "Thursday",
|
|
111
|
+
value: "TH",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
label: "Friday",
|
|
115
|
+
value: "FR",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
label: "Saturday",
|
|
119
|
+
value: "SA",
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
label: "Weekdays",
|
|
123
|
+
value: "MO,TU,WE,TH,FR",
|
|
124
|
+
},
|
|
125
|
+
];
|
|
126
|
+
|
|
92
127
|
export default {
|
|
93
128
|
API,
|
|
94
129
|
REPEAT_FREQUENCIES,
|
|
95
130
|
WEBHOOK_SUBSCRIPTION_RENEWAL_SECONDS,
|
|
131
|
+
DAYS_OF_WEEK,
|
|
96
132
|
};
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_calendar-event-cancelled",
|
|
7
7
|
name: "New Cancelled Event",
|
|
8
8
|
description: "Emit new event when a Google Calendar event is cancelled or deleted",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.14",
|
|
10
10
|
type: "source",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
props: {
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
key: "google_calendar-new-event-search",
|
|
6
6
|
name: "New Event Matching a Search",
|
|
7
7
|
description: "Emit new event when a Google Calendar event is created that matches a search",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.14",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
type: "source",
|
|
9
9
|
name: "New Created or Updated Event (Instant)",
|
|
10
10
|
description: "Emit new event when a Google Calendar events is created or updated (does not emit cancelled events)",
|
|
11
|
-
version: "0.1.
|
|
11
|
+
version: "0.1.18",
|
|
12
12
|
dedupe: "unique",
|
|
13
13
|
props: {
|
|
14
14
|
googleCalendar,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_calendar-upcoming-event-alert",
|
|
7
7
|
name: "New Upcoming Event Alert",
|
|
8
8
|
description: "Emit new event based on a time interval before an upcoming event in the calendar.",
|
|
9
|
-
version: "0.1.
|
|
9
|
+
version: "0.1.3",
|
|
10
10
|
type: "source",
|
|
11
11
|
props: {
|
|
12
12
|
googleCalendar,
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
key: "google_calendar-upcoming-event-alert-polling",
|
|
7
7
|
name: "New Upcoming Event Alert (Polling)",
|
|
8
8
|
description: "Emit new event based on a time interval before an upcoming event in the calendar. [See the documentation](https://developers.google.com/calendar/api/v3/reference/events/list)",
|
|
9
|
-
version: "0.0.
|
|
9
|
+
version: "0.0.4",
|
|
10
10
|
type: "source",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
props: {
|