Skip to content

Commit c7bc976

Browse files
committed
update list-events
1 parent 54291be commit c7bc976

File tree

3 files changed

+52
-10
lines changed

3 files changed

+52
-10
lines changed

components/microsoft_outlook_calendar/actions/list-events/list-events.mjs

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "microsoft_outlook_calendar-list-events",
55
name: "List Events",
66
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)",
7-
version: "0.0.3",
7+
version: "0.0.4",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,
@@ -32,16 +32,51 @@ export default {
3232
description: "The maximum number of results to return",
3333
optional: true,
3434
},
35+
includeRecurring: {
36+
type: "boolean",
37+
label: "Include Recurring",
38+
description: "Whether to include recurring events",
39+
optional: true,
40+
reloadProps: true,
41+
},
3542
},
36-
async run({ $ }) {
37-
const { value = [] } = await this.microsoftOutlook.listCalendarEvents({
38-
$,
39-
params: {
40-
"$orderby": this.orderBy,
41-
"$filter": this.filter,
42-
"$top": this.maxResults,
43+
additionalProps() {
44+
if (!this.includeRecurring) {
45+
return {};
46+
}
47+
return {
48+
startDateTime: {
49+
type: "string",
50+
label: "Start Date Time",
51+
description: "The start date and time of the time range, represented in ISO 8601 format. For example, `2019-11-08T19:00:00-08:00`",
52+
},
53+
endDateTime: {
54+
type: "string",
55+
label: "End Date Time",
56+
description: "The end date and time of the time range, represented in ISO 8601 format. For example, `2019-11-08T20:00:00-08:00`",
4357
},
44-
});
58+
};
59+
},
60+
async run({ $ }) {
61+
const params = {
62+
"$orderby": this.orderBy,
63+
"$filter": this.filter,
64+
"$top": this.maxResults,
65+
};
66+
67+
const { value = [] } = !this.includeRecurring
68+
? await this.microsoftOutlook.listCalendarEvents({
69+
$,
70+
params,
71+
})
72+
: await this.microsoftOutlook.listCalendarView({
73+
$,
74+
params: {
75+
...params,
76+
startDateTime: this.startDateTime,
77+
endDateTime: this.endDateTime,
78+
},
79+
});
4580

4681
$.export("$summary", `Successfully retrieved ${value.length} event${value.length === 1
4782
? ""

components/microsoft_outlook_calendar/microsoft_outlook_calendar.app.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,12 @@ export default {
180180
...args,
181181
});
182182
},
183+
async listCalendarView(args = {}) {
184+
return this._makeRequest({
185+
method: "GET",
186+
path: "/me/calendar/calendarView",
187+
...args,
188+
});
189+
},
183190
},
184191
};

components/microsoft_outlook_calendar/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/microsoft_outlook_calendar",
3-
"version": "0.3.2",
3+
"version": "0.3.3",
44
"description": "Pipedream Microsoft Outlook Calendar Components",
55
"main": "microsoft_outlook_calendar.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)