@pipedream/microsoft_outlook_calendar 8.1.0 → 8.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.
@@ -9,7 +9,7 @@ import {
9
9
  export default {
10
10
  type: "action",
11
11
  key: "microsoft_outlook_calendar-create-calendar-event",
12
- version: "0.0.14",
12
+ version: "0.0.15",
13
13
  annotations: {
14
14
  destructiveHint: false,
15
15
  openWorldHint: true,
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook_calendar.app.mjs";
3
3
  export default {
4
4
  type: "action",
5
5
  key: "microsoft_outlook_calendar-delete-calendar-event",
6
- version: "0.0.9",
6
+ version: "0.0.10",
7
7
  annotations: {
8
8
  destructiveHint: true,
9
9
  openWorldHint: true,
@@ -4,7 +4,7 @@ import { ConfigurationError } from "@pipedream/platform";
4
4
  export default {
5
5
  type: "action",
6
6
  key: "microsoft_outlook_calendar-delete-recurring-event-instance",
7
- version: "0.0.6",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: true,
10
10
  openWorldHint: true,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "microsoft_outlook_calendar-find-meeting-times",
7
7
  name: "Find Meeting Times",
8
8
  description: "Suggest meeting times and locations based on organizer and attendee availability. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-findmeetingtimes?view=graph-rest-1.0)",
9
- version: "0.0.1",
9
+ version: "0.0.2",
10
10
  type: "action",
11
11
  annotations: {
12
12
  destructiveHint: false,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "microsoft_outlook_calendar-get-current-user",
5
5
  name: "Get Current User",
6
6
  description: "Returns the authenticated Microsoft user's ID, display name, email, and principal name via Microsoft Graph. Call this first when the user says 'my calendar', 'my events', or needs to identify themselves as organizer/attendee. Use `id` or `mail` to filter results from **List Events** or set the organizer in **Create Calendar Event**. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-get).",
7
- version: "0.0.2",
7
+ version: "0.0.3",
8
8
  type: "action",
9
9
  annotations: {
10
10
  destructiveHint: false,
@@ -0,0 +1,54 @@
1
+ import microsoftOutlook from "../../microsoft_outlook_calendar.app.mjs";
2
+
3
+ export default {
4
+ type: "action",
5
+ key: "microsoft_outlook_calendar-get-event",
6
+ name: "Get Event",
7
+ description: "Retrieve a calendar event by its Microsoft Graph event ID. Pass the `id` from **List Events** when you need full details (for example `body`, `attendees`, or `recurrence`) that list responses may omit or truncate. [See the documentation](https://learn.microsoft.com/en-us/graph/api/event-get?view=graph-rest-1.0&tabs=http)",
8
+ version: "0.0.2",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: true,
13
+ },
14
+ props: {
15
+ microsoftOutlook,
16
+ eventId: {
17
+ propDefinition: [
18
+ microsoftOutlook,
19
+ "eventId",
20
+ ],
21
+ description: "The Microsoft Graph event ID — the `id` field on each object returned by **List Events** (including occurrences from calendar view when **Include Recurring** is enabled).",
22
+ },
23
+ select: {
24
+ type: "string",
25
+ label: "Properties to return ($select)",
26
+ description: "Optional. Comma-separated Microsoft Graph [event](https://learn.microsoft.com/en-us/graph/api/resources/event) property names (for example `subject,body,bodyPreview,start,end,attendees,organizer,location`). When empty, the API returns its default property set.",
27
+ optional: true,
28
+ },
29
+ },
30
+ async run({ $ }) {
31
+ const normalizedSelect = this.select?.trim()
32
+ ? this.select.split(",")
33
+ .map((p) => p.trim())
34
+ .filter(Boolean)
35
+ .join(",")
36
+ : "";
37
+
38
+ const params = normalizedSelect
39
+ ? {
40
+ $select: normalizedSelect,
41
+ }
42
+ : {};
43
+
44
+ const event = await this.microsoftOutlook.getCalendarEvent({
45
+ $,
46
+ eventId: this.eventId,
47
+ params,
48
+ });
49
+
50
+ const label = event?.subject ?? this.eventId;
51
+ $.export("$summary", `Successfully retrieved event "${label}"`);
52
+ return event;
53
+ },
54
+ };
@@ -8,7 +8,7 @@ export default {
8
8
  key: "microsoft_outlook_calendar-get-schedule",
9
9
  name: "Get Free/Busy Schedule",
10
10
  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)",
11
- version: "0.0.11",
11
+ version: "0.0.12",
12
12
  annotations: {
13
13
  destructiveHint: false,
14
14
  openWorldHint: true,
@@ -1,11 +1,13 @@
1
1
  import { ConfigurationError } from "@pipedream/platform";
2
2
  import microsoftOutlook from "../../microsoft_outlook_calendar.app.mjs";
3
3
 
4
+ const PAGE_SIZE = 100;
5
+
4
6
  export default {
5
7
  key: "microsoft_outlook_calendar-list-events",
6
8
  name: "List Events",
7
9
  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)",
8
- version: "0.0.12",
10
+ version: "0.1.0",
9
11
  annotations: {
10
12
  destructiveHint: false,
11
13
  openWorldHint: true,
@@ -17,7 +19,7 @@ export default {
17
19
  filter: {
18
20
  type: "string",
19
21
  label: "Filter",
20
- description: "Filters results. For example, `contains(subject, 'meet for lunch?')` will include events whose title contains meet for lunch?’. [See documentation](https://learn.microsoft.com/en-us/graph/filter-query-parameter) for the full list of operations.",
22
+ description: "Filters results using OData syntax. For example, `contains(subject, 'meet for lunch?')` will include events whose title contains 'meet for lunch?'. [See documentation](https://learn.microsoft.com/en-us/graph/filter-query-parameter) for the full list of operations. Note: filtering on the `recurrence` property is not supported by the API.",
21
23
  optional: true,
22
24
  },
23
25
  orderBy: {
@@ -32,55 +34,117 @@ export default {
32
34
  label: "Max Results",
33
35
  description: "The maximum number of results to return",
34
36
  optional: true,
37
+ min: 0,
35
38
  },
36
39
  includeRecurring: {
37
40
  type: "boolean",
38
41
  label: "Include Recurring",
39
- description: "Must set to true to include recurring events in results. When true, you must also provide `Start Date Time` and `End Date Time`. Set to false to return only non-recurring events.",
42
+ description: "When `true`, uses the calendar view endpoint which expands each occurrence of a recurring event into its own individual result. Requires `Start Date Time` and `End Date Time`. When `false` or unset, the events endpoint is used instead, which returns recurring series as a single master entry — these are excluded from the results. `Start Date Time` and `End Date Time` can still be used to filter by date range.",
40
43
  optional: true,
41
44
  },
42
45
  startDateTime: {
43
46
  type: "string",
44
47
  label: "Start Date Time",
45
- description: "Required when `Include Recurring` is true. The start date and time of the time range in ISO 8601 format (e.g. `2019-11-08T19:00:00-08:00`).",
48
+ description: "Filter events that start at or after this date and time, in ISO 8601 format (e.g. `2019-11-08T19:00:00-08:00`). Required when `Include Recurring` is `true`. When `Include Recurring` is `false` or unset, this adds a `start/dateTime ge` filter to the events endpoint.",
46
49
  optional: true,
47
50
  },
48
51
  endDateTime: {
49
52
  type: "string",
50
53
  label: "End Date Time",
51
- description: "Required when `Include Recurring` is true. The end date and time of the time range in ISO 8601 format (e.g. `2019-11-08T20:00:00-08:00`).",
54
+ description: "Filter events that end at or before this date and time, in ISO 8601 format (e.g. `2019-11-08T20:00:00-08:00`). Required when `Include Recurring` is `true`. When `Include Recurring` is `false` or unset, this adds an `end/dateTime le` filter to the events endpoint.",
52
55
  optional: true,
53
56
  },
54
57
  },
55
58
  async run({ $ }) {
59
+ const {
60
+ includeRecurring, startDateTime, endDateTime, maxResults,
61
+ } = this;
62
+
63
+ if (includeRecurring && (!startDateTime || !endDateTime)) {
64
+ throw new ConfigurationError("`Start Date Time` and `End Date Time` are required when `Include Recurring` is true");
65
+ }
66
+
67
+ if (maxResults < 0) {
68
+ throw new ConfigurationError(`\`Max Results\` is set to "${maxResults}" but must be a positive integer`);
69
+ }
70
+
71
+ if (includeRecurring) {
72
+ const params = {
73
+ "$orderby": this.orderBy,
74
+ "$filter": this.filter,
75
+ "$top": PAGE_SIZE,
76
+ startDateTime,
77
+ endDateTime,
78
+ };
79
+
80
+ const events = [];
81
+ let nextLink = null;
82
+
83
+ do {
84
+ const response = nextLink
85
+ ? await this.microsoftOutlook.listCalendarEventsPage({
86
+ $,
87
+ url: nextLink,
88
+ })
89
+ : await this.microsoftOutlook.listCalendarView({
90
+ $,
91
+ params,
92
+ });
93
+
94
+ for (const event of (response.value ?? [])) {
95
+ events.push(event);
96
+ if (maxResults && events.length >= maxResults) break;
97
+ }
98
+
99
+ nextLink = (maxResults && events.length >= maxResults)
100
+ ? null
101
+ : response["@odata.nextLink"];
102
+ } while (nextLink);
103
+
104
+ $.export("$summary", `Successfully retrieved ${events.length} event${events.length === 1
105
+ ? ""
106
+ : "s"}`);
107
+ return events;
108
+ }
109
+
110
+ const filterParts = [];
111
+ if (this.filter) filterParts.push(`(${this.filter})`);
112
+ if (startDateTime) filterParts.push(`start/dateTime ge '${startDateTime}'`);
113
+ if (endDateTime) filterParts.push(`end/dateTime le '${endDateTime}'`);
114
+
56
115
  const params = {
57
116
  "$orderby": this.orderBy,
58
- "$filter": this.filter,
59
- "$top": this.maxResults,
117
+ "$filter": filterParts.length
118
+ ? filterParts.join(" and ")
119
+ : undefined,
120
+ "$top": PAGE_SIZE,
60
121
  };
61
122
 
62
- const { includeRecurring } = this;
63
- if (includeRecurring && (!this.startDateTime || !this.endDateTime)) {
64
- throw new ConfigurationError("`Start Date Time` and `End Date Time` are required when `Include Recurring` is true");
65
- }
123
+ const events = [];
124
+ let nextLink = null;
125
+
126
+ do {
127
+ const response = nextLink
128
+ ? await this.microsoftOutlook.listCalendarEventsPage({
129
+ $,
130
+ url: nextLink,
131
+ })
132
+ : await this.microsoftOutlook.listCalendarEvents({
133
+ $,
134
+ params,
135
+ });
136
+
137
+ for (const event of (response.value ?? [])) {
138
+ if (!event.recurrence) {
139
+ events.push(event);
140
+ if (maxResults && events.length >= maxResults) break;
141
+ }
142
+ }
66
143
 
67
- const { value = [] } = !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
- });
80
-
81
- const events = !includeRecurring
82
- ? value.filter((event) => !event.recurrence)
83
- : value;
144
+ nextLink = (maxResults && events.length >= maxResults)
145
+ ? null
146
+ : response["@odata.nextLink"];
147
+ } while (nextLink);
84
148
 
85
149
  $.export("$summary", `Successfully retrieved ${events.length} event${events.length === 1
86
150
  ? ""
@@ -4,7 +4,7 @@ export default {
4
4
  key: "microsoft_outlook_calendar-search-contacts",
5
5
  name: "Search Contacts",
6
6
  description: "Search for contacts by name from your saved contacts list and retrieve their email addresses. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-contacts)",
7
- version: "0.0.5",
7
+ version: "0.0.6",
8
8
  type: "action",
9
9
  annotations: {
10
10
  destructiveHint: false,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "microsoft_outlook_calendar-search-people",
5
5
  name: "Search People",
6
6
  description: "Retrieve a collection of person objects ordered by their relevance to the user, based on communication and collaboration patterns and business relationships. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-people)",
7
- version: "0.0.5",
7
+ version: "0.0.6",
8
8
  type: "action",
9
9
  annotations: {
10
10
  destructiveHint: false,
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook_calendar.app.mjs";
3
3
  export default {
4
4
  type: "action",
5
5
  key: "microsoft_outlook_calendar-update-calendar-event",
6
- version: "0.0.9",
6
+ version: "0.0.10",
7
7
  annotations: {
8
8
  destructiveHint: true,
9
9
  openWorldHint: true,
@@ -4,7 +4,7 @@ import { ConfigurationError } from "@pipedream/platform";
4
4
  export default {
5
5
  type: "action",
6
6
  key: "microsoft_outlook_calendar-update-recurring-event-instance",
7
- version: "0.0.6",
7
+ version: "0.0.7",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -245,6 +245,10 @@ export default {
245
245
  .query(pickBy(params))
246
246
  .get();
247
247
  },
248
+ async listCalendarEventsPage({ url } = {}) {
249
+ return await this.client().api(url)
250
+ .get();
251
+ },
248
252
  async getCalendarEvent({
249
253
  eventId, params = {},
250
254
  } = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/microsoft_outlook_calendar",
3
- "version": "8.1.0",
3
+ "version": "8.2.1",
4
4
  "description": "Pipedream Microsoft Outlook Calendar Components",
5
5
  "main": "microsoft_outlook_calendar.app.mjs",
6
6
  "keywords": [
@@ -5,7 +5,7 @@ export default {
5
5
  key: "microsoft_outlook_calendar-new-calendar-event",
6
6
  name: "New Calendar Event (Instant)",
7
7
  description: "Emit new event when a new Calendar event is created",
8
- version: "0.0.14",
8
+ version: "0.0.15",
9
9
  type: "source",
10
10
  hooks: {
11
11
  ...common.hooks,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "microsoft_outlook_calendar-new-upcoming-event",
7
7
  name: "New Upcoming Calendar Event",
8
8
  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.",
9
- version: "0.0.10",
9
+ version: "0.0.11",
10
10
  type: "source",
11
11
  props: {
12
12
  ...common.props,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "microsoft_outlook_calendar-new-upcoming-event-polling",
6
6
  name: "New Upcoming Calendar Event (Polling)",
7
7
  description: "Emit new event based on a time interval before an upcoming calendar event. [See the documentation](https://docs.microsoft.com/en-us/graph/api/user-list-events)",
8
- version: "0.0.6",
8
+ version: "0.0.7",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  props: {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "microsoft_outlook_calendar-updated-calendar-event",
6
6
  name: "New Calendar Event Update (Instant)",
7
7
  description: "Emit new event when a Calendar event is updated",
8
- version: "0.0.14",
8
+ version: "0.0.15",
9
9
  type: "source",
10
10
  hooks: {
11
11
  ...common.hooks,