Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook_calendar.app.mjs";
export default {
type: "action",
key: "microsoft_outlook_calendar-create-calendar-event",
version: "0.0.7",
version: "0.0.8",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook_calendar.app.mjs";
export default {
type: "action",
key: "microsoft_outlook_calendar-delete-calendar-event",
version: "0.0.2",
version: "0.0.3",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "microsoft_outlook_calendar-get-schedule",
name: "Get Free/Busy Schedule",
description: "Get the free/busy availability information for a collection of users, distributions lists, or resources (rooms or equipment) for a specified time period. [See the documentation](https://learn.microsoft.com/en-us/graph/api/calendar-getschedule)",
version: "0.0.4",
version: "0.0.5",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "microsoft_outlook_calendar-list-events",
name: "List Events",
description: "Get a list of event objects in the user's mailbox. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-events)",
version: "0.0.3",
version: "0.0.4",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down Expand Up @@ -32,21 +32,60 @@ export default {
description: "The maximum number of results to return",
optional: true,
},
includeRecurring: {
type: "boolean",
label: "Include Recurring",
description: "Whether to include recurring events",
optional: true,
reloadProps: true,
},
},
async run({ $ }) {
const { value = [] } = await this.microsoftOutlook.listCalendarEvents({
$,
params: {
"$orderby": this.orderBy,
"$filter": this.filter,
"$top": this.maxResults,
additionalProps() {
if (!this.includeRecurring) {
return {};
}
return {
startDateTime: {
type: "string",
label: "Start Date Time",
description: "The start date and time of the time range, represented in ISO 8601 format. For example, `2019-11-08T19:00:00-08:00`",
},
endDateTime: {
type: "string",
label: "End Date Time",
description: "The end date and time of the time range, represented in ISO 8601 format. For example, `2019-11-08T20:00:00-08:00`",
},
});
};
},
async run({ $ }) {
const params = {
"$orderby": this.orderBy,
"$filter": this.filter,
"$top": this.maxResults,
};

const { value = [] } = !this.includeRecurring
? await this.microsoftOutlook.listCalendarEvents({
$,
params,
})
: await this.microsoftOutlook.listCalendarView({
$,
params: {
...params,
startDateTime: this.startDateTime,
endDateTime: this.endDateTime,
},
});

const events = !this.includeRecurring
? value.filter((event) => !event.recurrence)
: value;
Comment on lines +81 to +83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Breaking change: default behavior now filters out recurring events.

The filtering logic changes the default behavior when includeRecurring is false or undefined. Previously, listCalendarEvents() would return recurring event definitions in the results. Now, line 82 filters them out by default, which breaks backwards compatibility.

The issue (#18789) requires this to be "backwards-compatible," meaning the default behavior should remain unchanged. Consider one of these approaches:

Option 1: Remove the filter when includeRecurring is false/undefined

-    const events = !this.includeRecurring
-      ? value.filter((event) => !event.recurrence)
-      : value;
+    const events = value;

Option 2: Use three states instead of two

-    includeRecurring: {
-      type: "boolean",
-      label: "Include Recurring",
-      description: "Whether to include recurring events",
+    includeRecurring: {
+      type: "string",
+      label: "Include Recurring",
+      description: "How to handle recurring events",
+      options: [
+        { label: "Default (recurring definitions only)", value: "default" },
+        { label: "Exclude recurring events", value: "exclude" },
+        { label: "Include recurring instances", value: "instances" },
+      ],
+      default: "default",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const events = !this.includeRecurring
? value.filter((event) => !event.recurrence)
: value;
const events = value;
🤖 Prompt for AI Agents
components/microsoft_outlook_calendar/actions/list-events/list-events.mjs around
lines 81 to 83: the current conditional treats undefined as falsy and therefore
filters out recurring events by default, breaking backwards compatibility;
change the condition so recurring events are only filtered when includeRecurring
is explicitly false (e.g., replace the check with this.includeRecurring ===
false), so the default (undefined) continues to include recurring event
definitions.


$.export("$summary", `Successfully retrieved ${value.length} event${value.length === 1
$.export("$summary", `Successfully retrieved ${events.length} event${events.length === 1
? ""
: "s"}`);

return value;
return events;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook_calendar.app.mjs";
export default {
type: "action",
key: "microsoft_outlook_calendar-update-calendar-event",
version: "0.0.2",
version: "0.0.3",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,12 @@ export default {
...args,
});
},
async listCalendarView(args = {}) {
return this._makeRequest({
method: "GET",
path: "/me/calendar/calendarView",
...args,
});
},
},
};
4 changes: 3 additions & 1 deletion components/microsoft_outlook_calendar/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/microsoft_outlook_calendar",
"version": "0.3.2",
"version": "0.3.3",
"description": "Pipedream Microsoft Outlook Calendar Components",
"main": "microsoft_outlook_calendar.app.mjs",
"keywords": [
Expand All @@ -15,6 +15,8 @@
"access": "public"
},
"dependencies": {
"@pipedream/microsoft_outlook": "^1.7.3",
"@pipedream/pipedream": "^0.4.2",
"@pipedream/platform": "^3.0.3"
}
}
10 changes: 0 additions & 10 deletions components/microsoft_outlook_calendar/sources/common.mjs

This file was deleted.

10 changes: 10 additions & 0 deletions components/microsoft_outlook_calendar/sources/common/common.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import microsoftOutlook from "../../microsoft_outlook_calendar.app.mjs";
import common from "@pipedream/microsoft_outlook/sources/common/common.mjs";

export default {
...common,
props: {
...common.props,
microsoftOutlook,
},
};
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import common from "../common.mjs";
import common from "../common/common.mjs";

export default {
...common,
key: "microsoft_outlook_calendar-new-calendar-event",
name: "New Calendar Event (Instant)",
description: "Emit new event when a new Calendar event is created",
version: "0.0.7",
version: "0.0.8",
type: "source",
hooks: {
...common.hooks,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import common from "../common.mjs";
import taskScheduler from "../../../pipedream/sources/new-scheduled-tasks/new-scheduled-tasks.mjs";
import common from "../common/common.mjs";
import taskScheduler from "@pipedream/pipedream/sources/new-scheduled-tasks/new-scheduled-tasks.mjs";

export default {
...common,
key: "microsoft_outlook_calendar-new-upcoming-event",
name: "New Upcoming Calendar Event",
description: "Emit new event when a Calendar event is upcoming, this source is using `reminderMinutesBeforeStart` property of the event to determine the time it should emit.",
version: "0.0.3",
version: "0.0.4",
type: "source",
props: {
...common.props,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import common from "../common.mjs";
import common from "../common/common.mjs";

export default {
...common,
key: "microsoft_outlook_calendar-updated-calendar-event",
name: "New Calendar Event Update (Instant)",
description: "Emit new event when a Calendar event is updated",
version: "0.0.7",
version: "0.0.8",
type: "source",
hooks: {
...common.hooks,
Expand Down
29 changes: 29 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading