@pipedream/google_calendar 0.3.4 → 0.3.6

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,20 @@
1
+ # Overview
2
+
3
+ The Google Calendar API gives developers access to Google Calendar data,
4
+ allowing them to create their own applications that can read, write, and update
5
+ calendar data. With the API, users can integrate their own calendar
6
+ applications with Google Calendar, giving them the ability to manage their
7
+ calendars in one place. The API also provides the ability to search for events
8
+ and create new events.
9
+
10
+ Possible applications that could be built using the Google Calendar API
11
+ include:
12
+
13
+ - A calendar application that integrates with Google Calendar, allowing users
14
+ to manage their calendars in one place.
15
+ - A calendar application that allows users to search for events and create new
16
+ events.
17
+ - A to-do list application that integrates with Google Calendar, allowing users
18
+ to see their tasks and events in one place.
19
+ - A reminder application that uses Google Calendar data to remind users of
20
+ upcoming events.
@@ -2,9 +2,9 @@ import googleCalendar from "../../google_calendar.app.mjs";
2
2
 
3
3
  export default {
4
4
  key: "google_calendar-get-calendar",
5
- name: "Retreive Calendar Details",
6
- description: "Retreive Calendar details of a Google Calendar. [See the docs here](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Calendars.html#get)",
7
- version: "0.1.0",
5
+ name: "Retrieve Calendar Details",
6
+ description: "Retrieve Calendar details of a Google Calendar. [See the docs here](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Calendars.html#get)",
7
+ version: "0.1.1",
8
8
  type: "action",
9
9
  props: {
10
10
  googleCalendar,
@@ -20,7 +20,7 @@ export default {
20
20
  calendarId: this.calendarId,
21
21
  });
22
22
 
23
- $.export("$summary", `Successfully retreived calendar ${response.id}`);
23
+ $.export("$summary", `Successfully retrieved calendar ${response.id}`);
24
24
 
25
25
  return response;
26
26
  },
@@ -2,9 +2,9 @@ import googleCalendar from "../../google_calendar.app.mjs";
2
2
 
3
3
  export default {
4
4
  key: "google_calendar-get-event",
5
- name: "Retreive Event Details",
6
- description: "Retreive event details from the Google Calendar. [See the docs here](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#get)",
7
- version: "0.1.0",
5
+ name: "Retrieve Event Details",
6
+ description: "Retrieve event details from the Google Calendar. [See the docs here](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#get)",
7
+ version: "0.1.1",
8
8
  type: "action",
9
9
  props: {
10
10
  googleCalendar,
@@ -30,7 +30,7 @@ export default {
30
30
  eventId: this.eventId,
31
31
  });
32
32
 
33
- $.export("$summary", `Successfully retreived event ${response.id}`);
33
+ $.export("$summary", `Successfully retrieved event ${response.id}`);
34
34
 
35
35
  return response;
36
36
  },
@@ -3,8 +3,8 @@ import googleCalendar from "../../google_calendar.app.mjs";
3
3
  export default {
4
4
  key: "google_calendar-list-calendar",
5
5
  name: "List calendars from user account",
6
- description: "Retreive calendars from the user account. [See the docs here](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Calendarlist.html#list)",
7
- version: "0.1.0",
6
+ description: "Retrieve calendars from the user account. [See the docs here](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Calendarlist.html#list)",
7
+ version: "0.1.1",
8
8
  type: "action",
9
9
  props: {
10
10
  googleCalendar,
@@ -2,9 +2,9 @@ import googleCalendar from "../../google_calendar.app.mjs";
2
2
 
3
3
  export default {
4
4
  key: "google_calendar-query-free-busy-calendars",
5
- name: "Retreive Free/Busy Calendar Details",
6
- description: "Retreive Free/Busy Calendar Details from the user account. [See the docs here](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Freebusy.html#query)",
7
- version: "0.1.0",
5
+ name: "Retrieve Free/Busy Calendar Details",
6
+ description: "Retrieve Free/Busy Calendar Details from the user account. [See the docs here](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Freebusy.html#query)",
7
+ version: "0.1.1",
8
8
  type: "action",
9
9
  props: {
10
10
  googleCalendar,
@@ -27,7 +27,7 @@ export default {
27
27
  },
28
28
  });
29
29
 
30
- $.export("$summary", "Successfully retreived free/busy calendar info");
30
+ $.export("$summary", "Successfully retrieved free/busy calendar info");
31
31
 
32
32
  return response;
33
33
  },
@@ -0,0 +1,137 @@
1
+ import googleCalendar from "../../google_calendar.app.mjs";
2
+
3
+ export default {
4
+ key: "google_calendar-update-event",
5
+ name: "Update Event",
6
+ description: "Update an event to the Google Calendar. [See the docs here](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#update)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ googleCalendar,
11
+ calendarId: {
12
+ propDefinition: [
13
+ googleCalendar,
14
+ "calendarId",
15
+ ],
16
+ },
17
+ eventId: {
18
+ propDefinition: [
19
+ googleCalendar,
20
+ "eventId",
21
+ (c) => ({
22
+ calendarId: c.calendarId,
23
+ }),
24
+ ],
25
+ },
26
+ summary: {
27
+ label: "Event Title",
28
+ type: "string",
29
+ description: "Enter static text (e.g., `hello world`) for the event name",
30
+ optional: true,
31
+ },
32
+ location: {
33
+ label: "Event Venue",
34
+ type: "string",
35
+ description: "Enter static text (e.g., `hello world`) for the event venue",
36
+ optional: true,
37
+ },
38
+ description: {
39
+ label: "Event Description",
40
+ type: "string",
41
+ description: "Enter detailed event description",
42
+ optional: true,
43
+ },
44
+ attendees: {
45
+ label: "Attendees",
46
+ type: "string[]",
47
+ description: "Enter the EmailId of the attendees",
48
+ optional: true,
49
+ },
50
+ eventStartDate: {
51
+ label: "Event Date",
52
+ type: "string",
53
+ description: "For all-day events, enter the Event day in the format 'yyyy-mm-dd'. For events with time, format according to [RFC3339](https://www.rfc-editor.org/rfc/rfc3339.html#section-1): 'yyyy-mm-ddThh:mm:ss+01:00'. A time zone offset is required unless a time zone is explicitly specified in timeZone.",
54
+ },
55
+ eventEndDate: {
56
+ label: "Event End Date",
57
+ type: "string",
58
+ description: "For all-day events, enter the Event day in the format 'yyyy-mm-dd'. For events with time, format according to [RFC3339](https://www.rfc-editor.org/rfc/rfc3339.html#section-1): 'yyyy-mm-ddThh:mm:ss+01:00'. A time zone offset is required unless a time zone is explicitly specified in timeZone.",
59
+ },
60
+ sendUpdates: {
61
+ label: "Send Updates",
62
+ type: "string",
63
+ description: "Whether to send notifications about the creation of the new event.",
64
+ optional: true,
65
+ options: [
66
+ "all",
67
+ "externalOnly",
68
+ "none",
69
+ ],
70
+ },
71
+ timeZone: {
72
+ propDefinition: [
73
+ googleCalendar,
74
+ "timeZone",
75
+ ],
76
+ },
77
+ },
78
+ async run({ $ }) {
79
+ /**
80
+ * Based on the IINA Time Zone DB
81
+ * http://www.iana.org/time-zones
82
+ */
83
+ const { value: timeZone } = this.timeZone ?? await this.googleCalendar.getSettings({
84
+ setting: "timezone",
85
+ });
86
+
87
+ /**
88
+ * Format for the attendees
89
+ *
90
+ * [
91
+ * { "email": "lpage@example.com",},
92
+ * { "email": "sbrin@example.com",},
93
+ * ]
94
+ */
95
+
96
+ let attendees = [];
97
+
98
+ if (this.attendees && Array.isArray(this.attendees)) {
99
+ attendees = this.attendees.map((email) => ({
100
+ email,
101
+ }));
102
+ }
103
+
104
+ const response = await this.googleCalendar.updateEvent({
105
+ calendarId: this.calendarId,
106
+ eventId: this.eventId,
107
+ requestBody: {
108
+ summary: this.summary,
109
+ location: this.location,
110
+ description: this.description,
111
+ start: {
112
+ date: this.eventStartDate.length <= 10
113
+ ? this.eventStartDate
114
+ : undefined,
115
+ dateTime: this.eventStartDate.length > 10
116
+ ? this.eventStartDate
117
+ : undefined,
118
+ timeZone,
119
+ },
120
+ end: {
121
+ date: this.eventEndDate.length <= 10
122
+ ? this.eventEndDate
123
+ : undefined,
124
+ dateTime: this.eventEndDate.length > 10
125
+ ? this.eventEndDate
126
+ : undefined,
127
+ timeZone,
128
+ },
129
+ attendees,
130
+ },
131
+ });
132
+
133
+ $.export("$summary", `Successfully updated event ${response.id}`);
134
+
135
+ return response;
136
+ },
137
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/google_calendar",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "Pipedream Google_calendar Components",
5
5
  "main": "google_calendar.app.mjs",
6
6
  "keywords": [