- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.5k
Outlook Calendar - use listCalendarView #18822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
c7bc976
              48aa81a
              ca025ec
              168ab58
              bdaf87a
              ed042b1
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|  | @@ -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, | ||||||||||
|  | @@ -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
    
   There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Breaking change: default behavior now filters out recurring events. The filtering logic changes the default behavior when  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  -    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
 
        Suggested change
       
 🤖 Prompt for AI Agents | ||||||||||
|  | ||||||||||
| $.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; | ||||||||||
| }, | ||||||||||
| }; | ||||||||||
This file was deleted.
| 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, | ||
| }, | ||
| }; | 
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.