@pipedream/microsoft_outlook_calendar 0.0.1 → 0.1.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 ADDED
@@ -0,0 +1,5 @@
1
+ # Overview
2
+
3
+ With the Microsoft Outlook API, you can build a wide range of applications and
4
+ services that work with Outlook. The Microsoft Outlook Calendar app helps you
5
+ manage your calendar and schedule appointments.
@@ -0,0 +1,153 @@
1
+ import { axios } from "@pipedream/platform";
2
+
3
+ export default {
4
+ type: "app",
5
+ app: "microsoft_outlook_calendar",
6
+ propDefinitions: {
7
+ contentType: {
8
+ label: "Content Type",
9
+ description: "Content type (default `text`)",
10
+ type: "string",
11
+ optional: true,
12
+ options: [
13
+ "text",
14
+ "html",
15
+ ],
16
+ default: "text",
17
+ },
18
+ content: {
19
+ label: "Content",
20
+ description: "Content of the email in text or html format",
21
+ type: "string",
22
+ optional: true,
23
+ },
24
+ timeZone: {
25
+ label: "Time Zone",
26
+ description: "Time zone of the event in supported time zones, [See the docs](https://docs.microsoft.com/en-us/graph/api/outlookuser-supportedtimezones)",
27
+ type: "string",
28
+ async options() {
29
+ const timeZonesResponse = await this.getSupportedTimeZones();
30
+ return timeZonesResponse.value.map((tz) => ({
31
+ label: tz.displayName,
32
+ value: tz.alias,
33
+ }));
34
+ },
35
+ },
36
+ start: {
37
+ label: "Start",
38
+ description: "Start date-time (yyyy-MM-ddThh:mm:ss) e.g. '2022-04-15T11:20:00'",
39
+ type: "string",
40
+ },
41
+ end: {
42
+ label: "End",
43
+ description: "End date-time (yyyy-MM-ddThh:mm:ss) e.g. '2022-04-15T13:30:00'",
44
+ type: "string",
45
+ },
46
+ attendees: {
47
+ label: "Attendees",
48
+ description: "Array of email addresses",
49
+ type: "string[]",
50
+ },
51
+ location: {
52
+ label: "Location",
53
+ description: "Location of the event",
54
+ type: "string",
55
+ optional: true,
56
+ },
57
+ isOnlineMeeting: {
58
+ label: "Is Online Meeting",
59
+ description: "If it is online meeting or not",
60
+ type: "boolean",
61
+ optional: true,
62
+ },
63
+ expand: {
64
+ label: "Expand",
65
+ description: "Additional properties",
66
+ type: "object",
67
+ optional: true,
68
+ },
69
+ },
70
+ methods: {
71
+ _getUrl(path) {
72
+ return `https://graph.microsoft.com/v1.0${path}`;
73
+ },
74
+ _getHeaders() {
75
+ return {
76
+ "Authorization": `Bearer ${this.$auth.oauth_access_token}`,
77
+ "accept": "application/json",
78
+ "Content-Type": "application/json",
79
+ };
80
+ },
81
+ async _makeRequest({
82
+ $,
83
+ path,
84
+ headers,
85
+ ...otherConfig
86
+ } = {}) {
87
+ const config = {
88
+ url: this._getUrl(path),
89
+ headers: this._getHeaders(headers),
90
+ ...otherConfig,
91
+ };
92
+ return axios($ ?? this, config);
93
+ },
94
+ async createHook(args = {}) {
95
+ const response = await this._makeRequest({
96
+ method: "POST",
97
+ path: "/subscriptions",
98
+ ...args,
99
+ });
100
+ return response;
101
+ },
102
+ async renewHook({
103
+ hookId,
104
+ ...args
105
+ } = {}) {
106
+ return this._makeRequest({
107
+ method: "PATCH",
108
+ path: `/subscriptions/${hookId}`,
109
+ ...args,
110
+ });
111
+ },
112
+ async deleteHook({
113
+ hookId,
114
+ ...args
115
+ } = {}) {
116
+ return this._makeRequest({
117
+ method: "DELETE",
118
+ path: `/subscriptions/${hookId}`,
119
+ ...args,
120
+ });
121
+ },
122
+ async getSupportedTimeZones() {
123
+ return this._makeRequest({
124
+ method: "GET",
125
+ path: "/me/outlook/supportedTimeZones",
126
+ });
127
+ },
128
+ async createCalendarEvent(args = {}) {
129
+ return this._makeRequest({
130
+ method: "POST",
131
+ path: "/me/events",
132
+ ...args,
133
+ });
134
+ },
135
+ async listCalendarEvents(args = {}) {
136
+ return this._makeRequest({
137
+ method: "GET",
138
+ path: "/me/events",
139
+ ...args,
140
+ });
141
+ },
142
+ async getCalendarEvent({
143
+ eventId,
144
+ ...args
145
+ } = {}) {
146
+ return this._makeRequest({
147
+ method: "GET",
148
+ path: `/me/events/${eventId}`,
149
+ ...args,
150
+ });
151
+ },
152
+ },
153
+ };
package/package.json CHANGED
@@ -1,17 +1,19 @@
1
1
  {
2
2
  "name": "@pipedream/microsoft_outlook_calendar",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "Pipedream Microsoft Outlook Calendar Components",
5
- "main": "dist/app/microsoft_outlook_calendar.app.mjs",
5
+ "main": "microsoft_outlook_calendar.app.mjs",
6
6
  "keywords": [
7
7
  "pipedream",
8
- "microsoft_outlook_calendar"
9
- ],
10
- "files": [
11
- "dist"
8
+ "microsoft_outlook_calendar",
9
+ "microsoft",
10
+ "outlook"
12
11
  ],
13
12
  "homepage": "https://pipedream.com/apps/microsoft_outlook_calendar",
14
13
  "author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
14
+ "dependencies": {
15
+ "@pipedream/platform": "^1.5.1"
16
+ },
15
17
  "publishConfig": {
16
18
  "access": "public"
17
19
  }