@pipedream/microsoft_outlook_calendar 0.4.0 → 0.6.0

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.
@@ -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-create-calendar-event",
6
- version: "0.0.9",
6
+ version: "0.0.10",
7
7
  annotations: {
8
8
  destructiveHint: false,
9
9
  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.4",
6
+ version: "0.0.5",
7
7
  annotations: {
8
8
  destructiveHint: true,
9
9
  openWorldHint: true,
@@ -0,0 +1,59 @@
1
+ import microsoftOutlook from "../../microsoft_outlook_calendar.app.mjs";
2
+ import { ConfigurationError } from "@pipedream/platform";
3
+
4
+ export default {
5
+ type: "action",
6
+ key: "microsoft_outlook_calendar-delete-recurring-event-instance",
7
+ version: "0.0.2",
8
+ annotations: {
9
+ destructiveHint: true,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
13
+ name: "Delete Recurring Event Instance",
14
+ description: "Delete an individual instance of a recurring event in the user's default calendar. [See the documentation](https://learn.microsoft.com/en-us/graph/api/event-delete?view=graph-rest-1.0&tabs=http)",
15
+ props: {
16
+ microsoftOutlook,
17
+ recurringEventId: {
18
+ propDefinition: [
19
+ microsoftOutlook,
20
+ "recurringEventId",
21
+ ],
22
+ },
23
+ startDateTime: {
24
+ type: "string",
25
+ label: "Start Date Time",
26
+ description: "The start of the time range to find instances, in ISO 8601 format (e.g., `2024-01-01T00:00:00Z`)",
27
+ },
28
+ endDateTime: {
29
+ type: "string",
30
+ label: "End Date Time",
31
+ description: "The end of the time range to find instances, in ISO 8601 format (e.g., `2024-12-31T23:59:59Z`)",
32
+ },
33
+ instanceId: {
34
+ propDefinition: [
35
+ microsoftOutlook,
36
+ "instanceId",
37
+ (c) => ({
38
+ recurringEventId: c.recurringEventId,
39
+ startDateTime: c.startDateTime,
40
+ endDateTime: c.endDateTime,
41
+ }),
42
+ ],
43
+ },
44
+ },
45
+ async run({ $ }) {
46
+ if (new Date(this.startDateTime) >= new Date(this.endDateTime)) {
47
+ throw new ConfigurationError("`Start Date Time` must be before `End Date Time`");
48
+ }
49
+
50
+ const response = await this.microsoftOutlook.deleteCalendarEvent({
51
+ $,
52
+ eventId: this.instanceId,
53
+ });
54
+
55
+ $.export("$summary", `Successfully deleted recurring event instance with ID ${this.instanceId}`);
56
+
57
+ return response;
58
+ },
59
+ };
@@ -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.6",
11
+ version: "0.0.7",
12
12
  annotations: {
13
13
  destructiveHint: false,
14
14
  openWorldHint: true,
@@ -4,7 +4,7 @@ export default {
4
4
  key: "microsoft_outlook_calendar-list-events",
5
5
  name: "List Events",
6
6
  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.5",
7
+ version: "0.0.6",
8
8
  annotations: {
9
9
  destructiveHint: false,
10
10
  openWorldHint: true,
@@ -0,0 +1,71 @@
1
+ import microsoftOutlook from "../../microsoft_outlook_calendar.app.mjs";
2
+
3
+ export default {
4
+ key: "microsoft_outlook_calendar-search-contacts",
5
+ name: "Search Contacts",
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.1",
8
+ type: "action",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: true,
13
+ },
14
+ props: {
15
+ microsoftOutlook,
16
+ search: {
17
+ type: "string",
18
+ label: "Search Query",
19
+ description: "Search for contacts by name (e.g., 'John Doe'). Searches display name, given name, and surname.",
20
+ optional: true,
21
+ },
22
+ filter: {
23
+ type: "string",
24
+ label: "Filter",
25
+ description: "Filter contacts by email address using [OData syntax](https://learn.microsoft.com/en-us/azure/search/search-query-odata-syntax-reference). For example, `emailAddresses/any(a:a/address eq 'john@example.com')`. Note: $filter only works with the `address` sub-property of `emailAddresses`. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-contacts)",
26
+ optional: true,
27
+ },
28
+ expand: {
29
+ type: "string",
30
+ label: "Expand",
31
+ description: "Comma-separated list of relationships to expand and include in the response. See the [relationships table of the contact](https://learn.microsoft.com/en-us/graph/api/resources/contact?view=graph-rest-1.0#relationships) object for supported names.",
32
+ optional: true,
33
+ },
34
+ select: {
35
+ type: "string",
36
+ label: "Select",
37
+ description: "Comma-separated list of [properties](https://learn.microsoft.com/en-us/graph/api/resources/contact?view=graph-rest-1.0#properties) to include in the response.",
38
+ optional: true,
39
+ },
40
+ maxResults: {
41
+ type: "integer",
42
+ label: "Max Results",
43
+ description: "The maximum number of contacts to return",
44
+ optional: true,
45
+ },
46
+ },
47
+ async run({ $ }) {
48
+ const {
49
+ search,
50
+ filter,
51
+ expand,
52
+ select,
53
+ maxResults,
54
+ } = this;
55
+
56
+ const response = await this.microsoftOutlook.listContacts({
57
+ $,
58
+ params: {
59
+ "$top": maxResults,
60
+ "$filter": filter,
61
+ "$search": search,
62
+ "$expand": expand,
63
+ "$select": select,
64
+ },
65
+ });
66
+
67
+ $.export("$summary", `Successfully retrieved \`${response.value.length}\` contact(s)`);
68
+
69
+ return response;
70
+ },
71
+ };
@@ -0,0 +1,81 @@
1
+ import microsoftOutlook from "../../microsoft_outlook_calendar.app.mjs";
2
+
3
+ export default {
4
+ key: "microsoft_outlook_calendar-search-people",
5
+ name: "Search People",
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.1",
8
+ type: "action",
9
+ annotations: {
10
+ destructiveHint: false,
11
+ openWorldHint: true,
12
+ readOnlyHint: true,
13
+ },
14
+ props: {
15
+ microsoftOutlook,
16
+ search: {
17
+ type: "string",
18
+ label: "Search Query",
19
+ description: "Search for people by name or alias (e.g., 'Jane Smith'). Supports fuzzy matching. Note: Only works for the signed-in user's relevant people.",
20
+ optional: true,
21
+ },
22
+ filter: {
23
+ type: "string",
24
+ label: "Filter",
25
+ description: "Filter people using [OData syntax](https://learn.microsoft.com/en-us/azure/search/search-query-odata-syntax-reference). Limits response to people matching specified criteria. [See the documentation](https://learn.microsoft.com/en-us/graph/api/user-list-people)",
26
+ optional: true,
27
+ },
28
+ orderBy: {
29
+ type: "string",
30
+ label: "Order By",
31
+ description: "Changes the sort order of results. For example, `displayName` or `displayName desc`. Default ordering is by relevance to the user.",
32
+ optional: true,
33
+ },
34
+ select: {
35
+ type: "string",
36
+ label: "Select",
37
+ description: "Comma-separated list of [properties](https://learn.microsoft.com/en-us/graph/api/resources/person?view=graph-rest-1.0#properties) to include in the response. Recommended for performance optimization.",
38
+ optional: true,
39
+ },
40
+ skip: {
41
+ type: "integer",
42
+ label: "Skip",
43
+ description: "Skip the first N results. Note: Not supported with `$search`.",
44
+ optional: true,
45
+ },
46
+ maxResults: {
47
+ type: "integer",
48
+ label: "Max Results",
49
+ description: "The maximum number of people to return per page",
50
+ optional: true,
51
+ },
52
+ },
53
+ async run({ $ }) {
54
+ const {
55
+ search,
56
+ filter,
57
+ orderBy,
58
+ select,
59
+ skip,
60
+ maxResults,
61
+ } = this;
62
+
63
+ const response = await this.microsoftOutlook.listPeople({
64
+ $,
65
+ params: {
66
+ "$search": search,
67
+ "$filter": filter,
68
+ "$orderby": orderBy,
69
+ "$select": select,
70
+ "$skip": skip,
71
+ "$top": maxResults,
72
+ },
73
+ });
74
+
75
+ $.export("$summary", `Successfully retrieved \`${response.value.length}\` ${response.value.length === 1
76
+ ? "person"
77
+ : "people"}`);
78
+
79
+ return response;
80
+ },
81
+ };
@@ -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.4",
6
+ version: "0.0.5",
7
7
  annotations: {
8
8
  destructiveHint: true,
9
9
  openWorldHint: true,
@@ -0,0 +1,186 @@
1
+ import microsoftOutlook from "../../microsoft_outlook_calendar.app.mjs";
2
+ import { ConfigurationError } from "@pipedream/platform";
3
+
4
+ export default {
5
+ type: "action",
6
+ key: "microsoft_outlook_calendar-update-recurring-event-instance",
7
+ version: "0.0.2",
8
+ annotations: {
9
+ destructiveHint: false,
10
+ openWorldHint: true,
11
+ readOnlyHint: false,
12
+ },
13
+ name: "Update Recurring Event Instance",
14
+ description: "Update an individual instance of a recurring event in the user's default calendar. [See the documentation](https://learn.microsoft.com/en-us/graph/api/event-update?view=graph-rest-1.0&tabs=http)",
15
+ props: {
16
+ microsoftOutlook,
17
+ recurringEventId: {
18
+ propDefinition: [
19
+ microsoftOutlook,
20
+ "recurringEventId",
21
+ ],
22
+ },
23
+ startDateTime: {
24
+ type: "string",
25
+ label: "Start Date Time",
26
+ description: "The start of the time range to find instances, in ISO 8601 format (e.g., `2024-01-01T00:00:00Z`)",
27
+ },
28
+ endDateTime: {
29
+ type: "string",
30
+ label: "End Date Time",
31
+ description: "The end of the time range to find instances, in ISO 8601 format (e.g., `2024-12-31T23:59:59Z`)",
32
+ },
33
+ instanceId: {
34
+ propDefinition: [
35
+ microsoftOutlook,
36
+ "instanceId",
37
+ (c) => ({
38
+ recurringEventId: c.recurringEventId,
39
+ startDateTime: c.startDateTime,
40
+ endDateTime: c.endDateTime,
41
+ }),
42
+ ],
43
+ },
44
+ subject: {
45
+ label: "Subject",
46
+ description: "Subject of the event instance",
47
+ type: "string",
48
+ optional: true,
49
+ },
50
+ contentType: {
51
+ propDefinition: [
52
+ microsoftOutlook,
53
+ "contentType",
54
+ ],
55
+ optional: true,
56
+ },
57
+ content: {
58
+ propDefinition: [
59
+ microsoftOutlook,
60
+ "content",
61
+ ],
62
+ description: "Content",
63
+ optional: true,
64
+ },
65
+ timeZone: {
66
+ propDefinition: [
67
+ microsoftOutlook,
68
+ "timeZone",
69
+ ],
70
+ optional: true,
71
+ },
72
+ start: {
73
+ propDefinition: [
74
+ microsoftOutlook,
75
+ "start",
76
+ ],
77
+ description: "New start date-time for this instance (yyyy-MM-ddThh:mm:ss). Requires **Time Zone** to be set.",
78
+ optional: true,
79
+ },
80
+ end: {
81
+ propDefinition: [
82
+ microsoftOutlook,
83
+ "end",
84
+ ],
85
+ description: "New end date-time for this instance (yyyy-MM-ddThh:mm:ss). Requires **Time Zone** to be set.",
86
+ optional: true,
87
+ },
88
+ attendees: {
89
+ propDefinition: [
90
+ microsoftOutlook,
91
+ "attendees",
92
+ ],
93
+ optional: true,
94
+ },
95
+ location: {
96
+ propDefinition: [
97
+ microsoftOutlook,
98
+ "location",
99
+ ],
100
+ optional: true,
101
+ },
102
+ isOnlineMeeting: {
103
+ propDefinition: [
104
+ microsoftOutlook,
105
+ "isOnlineMeeting",
106
+ ],
107
+ optional: true,
108
+ },
109
+ expand: {
110
+ propDefinition: [
111
+ microsoftOutlook,
112
+ "expand",
113
+ ],
114
+ description: "Additional event details. [See object definition](https://docs.microsoft.com/en-us/graph/api/resources/event)",
115
+ optional: true,
116
+ },
117
+ },
118
+ async run({ $ }) {
119
+ if (new Date(this.startDateTime) >= new Date(this.endDateTime)) {
120
+ throw new ConfigurationError("`Start Date Time` must be before `End Date Time`");
121
+ }
122
+
123
+ const data = {
124
+ ...this.expand,
125
+ };
126
+
127
+ if (this.subject) {
128
+ data.subject = this.subject;
129
+ }
130
+
131
+ if (this.isOnlineMeeting !== undefined) {
132
+ data.isOnlineMeeting = this.isOnlineMeeting;
133
+ }
134
+
135
+ if (this.location) {
136
+ data.location = {
137
+ displayName: this.location,
138
+ };
139
+ }
140
+
141
+ if (this.content) {
142
+ data.body = {
143
+ contentType: this.contentType ?? "text",
144
+ content: this.content,
145
+ };
146
+ }
147
+
148
+ if ((this.start || this.end) && !this.timeZone) {
149
+ throw new ConfigurationError("Time Zone is required when updating start or end times");
150
+ }
151
+ if (this.start && this.timeZone) {
152
+ data.start = {
153
+ dateTime: this.start,
154
+ timeZone: this.timeZone,
155
+ };
156
+ }
157
+ if (this.end && this.timeZone) {
158
+ data.end = {
159
+ dateTime: this.end,
160
+ timeZone: this.timeZone,
161
+ };
162
+ }
163
+
164
+ if (this.attendees) {
165
+ data.attendees = this.attendees.map((at) => ({
166
+ emailAddress: {
167
+ address: at,
168
+ },
169
+ }));
170
+ }
171
+
172
+ if (!Object.keys(data).length) {
173
+ throw new ConfigurationError("At least one field must be provided to update the event instance");
174
+ }
175
+
176
+ const response = await this.microsoftOutlook.updateCalendarEvent({
177
+ $,
178
+ eventId: this.instanceId,
179
+ data,
180
+ });
181
+
182
+ $.export("$summary", `Successfully updated recurring event instance with ID ${response?.id ?? this.instanceId}`);
183
+
184
+ return response;
185
+ },
186
+ };
@@ -17,6 +17,45 @@ export default {
17
17
  }));
18
18
  },
19
19
  },
20
+ recurringEventId: {
21
+ label: "Recurring Event ID",
22
+ description: "The ID of the recurring event series",
23
+ type: "string",
24
+ async options() {
25
+ const { value: events } = await this.listCalendarEvents();
26
+
27
+ return events
28
+ .filter((event) => event.recurrence)
29
+ .map((event) => ({
30
+ label: event.subject,
31
+ value: event.id,
32
+ }));
33
+ },
34
+ },
35
+ instanceId: {
36
+ label: "Instance ID",
37
+ description: "The ID of the specific occurrence of the recurring event",
38
+ type: "string",
39
+ async options({
40
+ recurringEventId, startDateTime, endDateTime,
41
+ }) {
42
+ if (!recurringEventId || !startDateTime || !endDateTime) {
43
+ return [];
44
+ }
45
+ const { value: instances } = await this.listEventInstances({
46
+ eventId: recurringEventId,
47
+ params: {
48
+ startDateTime,
49
+ endDateTime,
50
+ },
51
+ });
52
+
53
+ return instances.map((instance) => ({
54
+ label: `${instance.subject} - ${instance.start?.dateTime}`,
55
+ value: instance.id,
56
+ }));
57
+ },
58
+ },
20
59
  contentType: {
21
60
  label: "Content Type",
22
61
  description: "Content type (default `text`)",
@@ -188,5 +227,28 @@ export default {
188
227
  ...args,
189
228
  });
190
229
  },
230
+ async listEventInstances({
231
+ eventId, ...args
232
+ }) {
233
+ return this._makeRequest({
234
+ method: "GET",
235
+ path: `/me/events/${eventId}/instances`,
236
+ ...args,
237
+ });
238
+ },
239
+ async listContacts(args = {}) {
240
+ return this._makeRequest({
241
+ method: "GET",
242
+ path: "/me/contacts",
243
+ ...args,
244
+ });
245
+ },
246
+ async listPeople(args = {}) {
247
+ return this._makeRequest({
248
+ method: "GET",
249
+ path: "/me/people",
250
+ ...args,
251
+ });
252
+ },
191
253
  },
192
254
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/microsoft_outlook_calendar",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
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.9",
8
+ version: "0.0.10",
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.5",
9
+ version: "0.0.6",
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.1",
8
+ version: "0.0.2",
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.9",
8
+ version: "0.0.10",
9
9
  type: "source",
10
10
  hooks: {
11
11
  ...common.hooks,