@pipedream/microsoft_outlook 0.0.9 → 1.0.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.
package/README.md CHANGED
@@ -3,7 +3,6 @@
3
3
  With the Microsoft Outlook API, you can build a wide range of applications and
4
4
  services that work with Outlook. Here are some examples:
5
5
 
6
- - A service that helps you manage your calendar and schedule appointments
7
6
  - A service that helps you keep track of your to-do list and get things done
8
7
  - A service that helps you monitor your email and respond to messages
9
8
  - A service that helps you find and connect with people in your network
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
3
3
  export default {
4
4
  type: "action",
5
5
  key: "microsoft_outlook-create-contact",
6
- version: "0.0.4",
6
+ version: "0.0.5",
7
7
  name: "Create Contact",
8
8
  description: "Add a contact to the root Contacts folder, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-post-contacts)",
9
9
  props: {
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
3
3
  export default {
4
4
  type: "action",
5
5
  key: "microsoft_outlook-create-draft-email",
6
- version: "0.0.4",
6
+ version: "0.0.5",
7
7
  name: "Create Draft Email",
8
8
  description: "Create a draft email, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-post-messages)",
9
9
  props: {
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
3
3
  export default {
4
4
  type: "action",
5
5
  key: "microsoft_outlook-find-contacts",
6
- version: "0.0.4",
6
+ version: "0.0.5",
7
7
  name: "Find Contacts",
8
8
  description: "Finds contacts with given search string",
9
9
  props: {
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
3
3
  export default {
4
4
  type: "action",
5
5
  key: "microsoft_outlook-list-contacts",
6
- version: "0.0.4",
6
+ version: "0.0.5",
7
7
  name: "List Contacts",
8
8
  description: "Get a contact collection from the default contacts folder, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-list-contacts)",
9
9
  props: {
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
3
3
  export default {
4
4
  type: "action",
5
5
  key: "microsoft_outlook-send-email",
6
- version: "0.0.5",
6
+ version: "0.0.6",
7
7
  name: "Send Email",
8
8
  description: "Send an email to one or multiple recipients, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-sendmail)",
9
9
  props: {
@@ -3,7 +3,7 @@ import microsoftOutlook from "../../microsoft_outlook.app.mjs";
3
3
  export default {
4
4
  type: "action",
5
5
  key: "microsoft_outlook-update-contact",
6
- version: "0.0.4",
6
+ version: "0.0.5",
7
7
  name: "Update Contact",
8
8
  description: "Add a contact to the root Contacts folder, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-post-contacts)",
9
9
  props: {
@@ -41,18 +41,6 @@ export default {
41
41
  type: "string[]",
42
42
  optional: true,
43
43
  },
44
- timeZone: {
45
- label: "Time Zone",
46
- description: "Time zone of the event in supported time zones, [See the docs](https://docs.microsoft.com/en-us/graph/api/outlookuser-supportedtimezones)",
47
- type: "string",
48
- async options() {
49
- const timeZonesResponse = await this.getSupportedTimeZones();
50
- return timeZonesResponse.value.map((tz) => ({
51
- label: tz.displayName,
52
- value: tz.alias,
53
- }));
54
- },
55
- },
56
44
  contact: {
57
45
  label: "Contact",
58
46
  description: "The contact to be updated",
@@ -65,16 +53,6 @@ export default {
65
53
  }));
66
54
  },
67
55
  },
68
- start: {
69
- label: "Start",
70
- description: "Start date-time (yyyy-MM-ddThh:mm:ss) e.g. '2022-04-15T11:20:00'",
71
- type: "string",
72
- },
73
- end: {
74
- label: "End",
75
- description: "End date-time (yyyy-MM-ddThh:mm:ss) e.g. '2022-04-15T13:30:00'",
76
- type: "string",
77
- },
78
56
  givenName: {
79
57
  label: "Given name",
80
58
  description: "Given name of the contact",
@@ -99,23 +77,6 @@ export default {
99
77
  type: "string[]",
100
78
  optional: true,
101
79
  },
102
- attendees: {
103
- label: "Attendees",
104
- description: "Array of email addresses",
105
- type: "string[]",
106
- },
107
- location: {
108
- label: "Location",
109
- description: "Location of the event",
110
- type: "string",
111
- optional: true,
112
- },
113
- isOnlineMeeting: {
114
- label: "Is Online Meeting",
115
- description: "If it is online meeting or not",
116
- type: "boolean",
117
- optional: true,
118
- },
119
80
  expand: {
120
81
  label: "Expand",
121
82
  description: "Additional properties",
@@ -208,26 +169,6 @@ export default {
208
169
  };
209
170
  return message;
210
171
  },
211
- async getSupportedTimeZones() {
212
- return await this._makeRequest({
213
- method: "GET",
214
- path: "/me/outlook/supportedTimeZones",
215
- });
216
- },
217
- async createCalendarEvent({ ...args } = {}) {
218
- return await this._makeRequest({
219
- method: "POST",
220
- path: "/me/events",
221
- ...args,
222
- });
223
- },
224
- async listCalendarEvents({ ...args } = {}) {
225
- return await this._makeRequest({
226
- method: "GET",
227
- path: "/me/events",
228
- ...args,
229
- });
230
- },
231
172
  async sendEmail({ ...args } = {}) {
232
173
  return await this._makeRequest({
233
174
  method: "POST",
@@ -293,16 +234,6 @@ export default {
293
234
  ...args,
294
235
  });
295
236
  },
296
- async getCalendarEvent({
297
- eventId,
298
- ...args
299
- } = {}) {
300
- return await this._makeRequest({
301
- method: "GET",
302
- path: `/me/events/${eventId}`,
303
- ...args,
304
- });
305
- },
306
237
  async getContact({
307
238
  contactId,
308
239
  ...args
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/microsoft_outlook",
3
- "version": "0.0.9",
3
+ "version": "1.0.0",
4
4
  "description": "Pipedream Microsoft Outlook Components",
5
5
  "main": "microsoft_outlook.app.mjs",
6
6
  "keywords": [
@@ -5,7 +5,7 @@ export default {
5
5
  key: "microsoft_outlook-new-contact",
6
6
  name: "New Contact Event (Instant)",
7
7
  description: "Emit new event when a new Contact is created",
8
- version: "0.0.5",
8
+ version: "0.0.6",
9
9
  type: "source",
10
10
  hooks: {
11
11
  ...common.hooks,
@@ -5,7 +5,7 @@ export default {
5
5
  key: "microsoft_outlook-new-email",
6
6
  name: "New Email Event (Instant)",
7
7
  description: "Emit new event when an email received",
8
- version: "0.0.5",
8
+ version: "0.0.6",
9
9
  type: "source",
10
10
  hooks: {
11
11
  ...common.hooks,
@@ -1,111 +0,0 @@
1
- import microsoftOutlook from "../../microsoft_outlook.app.mjs";
2
-
3
- export default {
4
- type: "action",
5
- key: "microsoft_outlook-create-calendar-event",
6
- version: "0.0.4",
7
- name: "Create Calendar Event",
8
- description: "Create an event in the user's default calendar, [See the docs](https://docs.microsoft.com/en-us/graph/api/user-post-events)",
9
- props: {
10
- microsoftOutlook,
11
- subject: {
12
- label: "Subject",
13
- description: "Subject of the event",
14
- type: "string",
15
- },
16
- contentType: {
17
- propDefinition: [
18
- microsoftOutlook,
19
- "contentType",
20
- ],
21
- },
22
- content: {
23
- propDefinition: [
24
- microsoftOutlook,
25
- "content",
26
- ],
27
- description: "Content",
28
- },
29
- timeZone: {
30
- propDefinition: [
31
- microsoftOutlook,
32
- "timeZone",
33
- ],
34
- },
35
- start: {
36
- propDefinition: [
37
- microsoftOutlook,
38
- "start",
39
- ],
40
- },
41
- end: {
42
- propDefinition: [
43
- microsoftOutlook,
44
- "end",
45
- ],
46
- },
47
- attendees: {
48
- propDefinition: [
49
- microsoftOutlook,
50
- "attendees",
51
- ],
52
- },
53
- location: {
54
- propDefinition: [
55
- microsoftOutlook,
56
- "location",
57
- ],
58
- },
59
- isOnlineMeeting: {
60
- propDefinition: [
61
- microsoftOutlook,
62
- "isOnlineMeeting",
63
- ],
64
- },
65
- expand: {
66
- propDefinition: [
67
- microsoftOutlook,
68
- "expand",
69
- ],
70
- description: "Additional event details, [See object definition](https://docs.microsoft.com/en-us/graph/api/resources/event)",
71
- },
72
- },
73
- async run({ $ }) {
74
- //RegExp to check time strings(yyyy-MM-ddThh:mm:ss)
75
- const re = /^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)$/;
76
- if (!re.test(this.start) || !re.test(this.start)) {
77
- throw new Error("Please provide both start and end props in 'yyyy-MM-ddThh:mm:ss'");
78
- }
79
- const data = {
80
- subject: this.subject,
81
- body: {
82
- contentType: this.contentType ?? "HTML",
83
- content: this.content,
84
- },
85
- start: {
86
- dateTime: this.start,
87
- timeZone: this.timeZone,
88
- },
89
- end: {
90
- dateTime: this.end,
91
- timeZone: this.timeZone,
92
- },
93
- location: {
94
- displayName: this.location,
95
- },
96
- attendees: this.attendees.map((at) => ({
97
- emailAddress: {
98
- address: at,
99
- },
100
- })),
101
- isOnlineMeeting: this.isOnlineMeeting,
102
- ...this.expand,
103
- };
104
- const response = await this.microsoftOutlook.createCalendarEvent({
105
- $,
106
- data,
107
- });
108
- $.export("$summary", "Calendar event has been created.");
109
- return response;
110
- },
111
- };
@@ -1,56 +0,0 @@
1
- import common from "../common.mjs";
2
-
3
- export default {
4
- ...common,
5
- key: "microsoft_outlook-new-calendar-event",
6
- name: "New Calendar Event (Instant)",
7
- description: "Emit new event when a new Calendar event is created",
8
- version: "0.0.5",
9
- type: "source",
10
- hooks: {
11
- ...common.hooks,
12
- async activate() {
13
- await this.activate({
14
- changeType: "created",
15
- resource: "/me/events",
16
- });
17
- },
18
- async deactivate() {
19
- await this.deactivate();
20
- },
21
- },
22
- methods: {
23
- ...common.methods,
24
- async getSampleEvents({ pageSize }) {
25
- return this.microsoftOutlook.listCalendarEvents({
26
- params: {
27
- $top: pageSize,
28
- $orderby: "createdDateTime desc",
29
- },
30
- });
31
- },
32
- emitEvent(item) {
33
- this.$emit({
34
- message: item,
35
- }, this.generateMeta(item));
36
- },
37
- generateMeta(item) {
38
- return {
39
- id: item.id,
40
- summary: `New calendar event (ID:${item.id})`,
41
- ts: Date.parse(item.createdDateTime),
42
- };
43
- },
44
- },
45
- async run(event) {
46
- await this.run({
47
- event,
48
- emitFn: async ({ resourceId } = {}) => {
49
- const item = await this.microsoftOutlook.getCalendarEvent({
50
- eventId: resourceId,
51
- });
52
- this.emitEvent(item);
53
- },
54
- });
55
- },
56
- };
@@ -1,92 +0,0 @@
1
- import common from "../common.mjs";
2
- import taskScheduler from "../../../pipedream/sources/new-scheduled-tasks/new-scheduled-tasks.mjs";
3
-
4
- export default {
5
- ...common,
6
- key: "microsoft_outlook-new-upcoming-event",
7
- name: "New Upcoming Calendar Event",
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.1",
10
- type: "source",
11
- props: {
12
- ...common.props,
13
- pipedream: taskScheduler.props.pipedream,
14
- },
15
- hooks: {
16
- ...common.hooks,
17
- async activate() {
18
- await this.activate({
19
- changeType: "updated",
20
- resource: "/me/events",
21
- });
22
- },
23
- async deactivate() {
24
- await this.deactivate();
25
- },
26
- },
27
- methods: {
28
- ...taskScheduler.methods,
29
- ...common.methods,
30
- _hasDeployed() {
31
- const result = this.db.get("hasDeployed");
32
- this.db.set("hasDeployed", true);
33
- return result;
34
- },
35
- subtractMinutes(date, minutes) {
36
- return date.getTime() - minutes * 60000;
37
- },
38
- async getSampleEvents({ pageSize }) {
39
- return this.microsoftOutlook.listCalendarEvents({
40
- params: {
41
- $top: pageSize,
42
- $orderby: "lastModifiedDateTime desc",
43
- },
44
- });
45
- },
46
- emitEvent(item) {
47
- this.$emit({
48
- message: item,
49
- }, this.generateMeta(item));
50
- },
51
- generateMeta(item) {
52
- return {
53
- id: item.id,
54
- summary: `Upcoming event - ${item.subject}`,
55
- ts: +Date.parse(item.createdDateTime),
56
- };
57
- },
58
- },
59
- async run(event) {
60
- if (event.$channel === this.selfChannel()) {
61
- const item = await this.microsoftOutlook.getCalendarEvent({
62
- eventId: event.eventId,
63
- });
64
- // checking if the event was modified after this scheduling
65
- if (item.lastModifiedDateTime === event.lastModifiedControl) {
66
- this.emitEvent(item);
67
- }
68
- return;
69
- }
70
- await this.run({
71
- event,
72
- emitFn: async ({ resourceId } = {}) => {
73
- if (!this._hasDeployed()) {
74
- await this.selfSubscribe();
75
- }
76
- const item = await this.microsoftOutlook.getCalendarEvent({
77
- eventId: resourceId,
78
- });
79
- if (event.$channel !== this.selfChannel()) {
80
- const startTime = new Date(item.start.dateTime || item.start.date);
81
- const reminderMinutesBeforeStart = item.reminderMinutesBeforeStart || 15;
82
- const later = new Date(this.subtractMinutes(startTime, reminderMinutesBeforeStart));
83
- const newEvent = {
84
- lastModifiedControl: item.lastModifiedDateTime,
85
- eventId: resourceId,
86
- };
87
- this.emitScheduleEvent(newEvent, later);
88
- }
89
- },
90
- });
91
- },
92
- };
@@ -1,56 +0,0 @@
1
- import common from "../common.mjs";
2
-
3
- export default {
4
- ...common,
5
- key: "microsoft_outlook-updated-calendar-event",
6
- name: "New Calendar Event Update (Instant)",
7
- description: "Emit new event when a Calendar event is updated",
8
- version: "0.0.5",
9
- type: "source",
10
- hooks: {
11
- ...common.hooks,
12
- async activate() {
13
- await this.activate({
14
- changeType: "updated",
15
- resource: "/me/events",
16
- });
17
- },
18
- async deactivate() {
19
- await this.deactivate();
20
- },
21
- },
22
- methods: {
23
- ...common.methods,
24
- async getSampleEvents({ pageSize }) {
25
- return this.microsoftOutlook.listCalendarEvents({
26
- params: {
27
- $top: pageSize,
28
- $orderby: "lastModifiedDateTime desc",
29
- },
30
- });
31
- },
32
- emitEvent(item) {
33
- this.$emit({
34
- message: item,
35
- }, this.generateMeta(item));
36
- },
37
- generateMeta(item) {
38
- return {
39
- id: item.id,
40
- summary: `Calendar event updated (ID:${item.id})`,
41
- ts: Date.parse(item.createdDateTime),
42
- };
43
- },
44
- },
45
- async run(event) {
46
- await this.run({
47
- event,
48
- emitFn: async ({ resourceId } = {}) => {
49
- const item = await this.microsoftOutlook.getCalendarEvent({
50
- eventId: resourceId,
51
- });
52
- this.emitEvent(item);
53
- },
54
- });
55
- },
56
- };