@pipedream/google_calendar 0.8.0 → 0.8.2

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.
@@ -5,7 +5,7 @@ export default {
5
5
  key: "google_calendar-list-event-instances",
6
6
  name: "List Event Instances",
7
7
  description: "Retrieve instances of a recurring event. [See the documentation](https://developers.google.com/calendar/api/v3/reference/events/instances)",
8
- version: "0.0.1",
8
+ version: "0.0.2",
9
9
  type: "action",
10
10
  annotations: {
11
11
  destructiveHint: false,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "google_calendar-list-events",
7
7
  name: "List Events",
8
8
  description: "Retrieve a list of event from the Google Calendar. [See the documentation](https://developers.google.com/calendar/api/v3/reference/events/list)",
9
- version: "0.0.10",
9
+ version: "0.0.12",
10
10
  annotations: {
11
11
  destructiveHint: false,
12
12
  openWorldHint: true,
@@ -148,6 +148,12 @@ export default {
148
148
  events.length = this.maxResults;
149
149
  }
150
150
 
151
+ for (const event of events) {
152
+ if (!event.summary) {
153
+ event.summary = `Event ID: ${event.id}`;
154
+ }
155
+ }
156
+
151
157
  $.export("$summary", `Successfully retrieved ${events.length} event${events.length === 1
152
158
  ? ""
153
159
  : "s"}`);
@@ -1,10 +1,11 @@
1
+ import utils from "../../common/utils.mjs";
1
2
  import googleCalendar from "../../google_calendar.app.mjs";
2
3
 
3
4
  export default {
4
5
  key: "google_calendar-query-free-busy-calendars",
5
6
  name: "Retrieve Free/Busy Calendar Details",
6
7
  description: "Retrieve free/busy calendar details from Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Freebusy.html#query)",
7
- version: "0.1.10",
8
+ version: "0.2.0",
8
9
  annotations: {
9
10
  destructiveHint: false,
10
11
  openWorldHint: true,
@@ -18,8 +19,12 @@ export default {
18
19
  googleCalendar,
19
20
  "calendarId",
20
21
  ],
22
+ type: "string[]",
23
+ default: [
24
+ "primary",
25
+ ],
21
26
  optional: false,
22
- description: "Select a calendar to retrieve free/busy details",
27
+ description: "Select calendars to retrieve free/busy details",
23
28
  },
24
29
  timeMin: {
25
30
  propDefinition: [
@@ -49,11 +54,9 @@ export default {
49
54
  timeMin: this.timeMin,
50
55
  timeMax: this.timeMax,
51
56
  timeZone: this.timeZone,
52
- items: [
53
- {
54
- id: this.calendarId,
55
- },
56
- ],
57
+ items: utils.parseObject(this.calendarId)?.map((id) => ({
58
+ id,
59
+ })),
57
60
  },
58
61
  });
59
62
 
package/common/utils.mjs CHANGED
@@ -18,4 +18,28 @@ export default {
18
18
  };
19
19
  }, {});
20
20
  },
21
+ parseObject(obj) {
22
+ if (!obj) return undefined;
23
+
24
+ if (Array.isArray(obj)) {
25
+ return obj.map((item) => {
26
+ if (typeof item === "string") {
27
+ try {
28
+ return JSON.parse(item);
29
+ } catch (e) {
30
+ return item;
31
+ }
32
+ }
33
+ return item;
34
+ });
35
+ }
36
+ if (typeof obj === "string") {
37
+ try {
38
+ return JSON.parse(obj);
39
+ } catch (e) {
40
+ return obj;
41
+ }
42
+ }
43
+ return obj;
44
+ },
21
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/google_calendar",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "description": "Pipedream Google_calendar Components",
5
5
  "main": "google_calendar.app.mjs",
6
6
  "keywords": [