@pipedream/google_calendar 0.3.6 → 0.3.8

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.
@@ -0,0 +1,162 @@
1
+ import googleCalendar from "../../google_calendar.app.mjs";
2
+
3
+ export default {
4
+ key: "google_calendar-list-events",
5
+ name: "List Events",
6
+ description: "Retrieve a list of event from the Google Calendar. [See the docs here](https://developers.google.com/calendar/api/v3/reference/events/list)",
7
+ version: "0.0.1",
8
+ type: "action",
9
+ props: {
10
+ googleCalendar,
11
+ calendarId: {
12
+ propDefinition: [
13
+ googleCalendar,
14
+ "calendarId",
15
+ ],
16
+ },
17
+ iCalUID: {
18
+ propDefinition: [
19
+ googleCalendar,
20
+ "iCalUID",
21
+ ],
22
+ },
23
+ maxAttendees: {
24
+ propDefinition: [
25
+ googleCalendar,
26
+ "maxAttendees",
27
+ ],
28
+ },
29
+ maxResults: {
30
+ propDefinition: [
31
+ googleCalendar,
32
+ "maxResults",
33
+ ],
34
+ },
35
+ orderBy: {
36
+ propDefinition: [
37
+ googleCalendar,
38
+ "orderBy",
39
+ ],
40
+ default: "",
41
+ },
42
+ pageToken: {
43
+ propDefinition: [
44
+ googleCalendar,
45
+ "pageToken",
46
+ ],
47
+ },
48
+ privateExtendedProperty: {
49
+ propDefinition: [
50
+ googleCalendar,
51
+ "privateExtendedProperty",
52
+ ],
53
+ },
54
+ q: {
55
+ propDefinition: [
56
+ googleCalendar,
57
+ "q",
58
+ ],
59
+ },
60
+ sharedExtendedProperty: {
61
+ propDefinition: [
62
+ googleCalendar,
63
+ "sharedExtendedProperty",
64
+ ],
65
+ },
66
+ showDeleted: {
67
+ propDefinition: [
68
+ googleCalendar,
69
+ "showDeleted",
70
+ ],
71
+ },
72
+ showHiddenInvitations: {
73
+ propDefinition: [
74
+ googleCalendar,
75
+ "showHiddenInvitations",
76
+ ],
77
+ },
78
+ singleEvents: {
79
+ propDefinition: [
80
+ googleCalendar,
81
+ "singleEvents",
82
+ ],
83
+ },
84
+ syncToken: {
85
+ propDefinition: [
86
+ googleCalendar,
87
+ "syncToken",
88
+ ],
89
+ },
90
+ timeMax: {
91
+ propDefinition: [
92
+ googleCalendar,
93
+ "timeMax",
94
+ ],
95
+ },
96
+ timeMin: {
97
+ propDefinition: [
98
+ googleCalendar,
99
+ "timeMin",
100
+ ],
101
+ },
102
+ timeZone: {
103
+ propDefinition: [
104
+ googleCalendar,
105
+ "timeZone",
106
+ ],
107
+ },
108
+ updatedMin: {
109
+ propDefinition: [
110
+ googleCalendar,
111
+ "updatedMin",
112
+ ],
113
+ },
114
+ },
115
+ methods: {
116
+ filterEmptyValues(obj) {
117
+ if (!obj) {
118
+ return obj;
119
+ }
120
+ return Object.entries(obj)
121
+ .reduce((reduction,
122
+ [
123
+ key,
124
+ value,
125
+ ]) => {
126
+ if (value === undefined || value === null) {
127
+ return reduction;
128
+ }
129
+ return {
130
+ ...reduction,
131
+ [key]: value,
132
+ };
133
+ }, {});
134
+ },
135
+ },
136
+ async run({ $ }) {
137
+ const args = this.filterEmptyValues({
138
+ calendarId: this.calendarId,
139
+ iCalUID: this.iCalUID,
140
+ maxAttendees: this.maxAttendees,
141
+ maxResults: this.maxResults,
142
+ orderBy: this.orderBy || undefined,
143
+ pageToken: this.pageToken,
144
+ privateExtendedProperty: this.privateExtendedProperty,
145
+ q: this.q,
146
+ sharedExtendedProperty: this.sharedExtendedProperty,
147
+ showDeleted: this.showDeleted,
148
+ showHiddenInvitations: this.showHiddenInvitations,
149
+ singleEvents: this.singleEvents,
150
+ syncToken: this.syncToken,
151
+ timeMax: this.timeMax,
152
+ timeMin: this.timeMin,
153
+ timeZone: this.timeZone,
154
+ updatedMin: this.updatedMin,
155
+ });
156
+ const response = await this.googleCalendar.listEvents(args);
157
+
158
+ $.export("$summary", `Successfully retrieved ${response.items.length} event(s)`);
159
+
160
+ return response;
161
+ },
162
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/google_calendar",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "Pipedream Google_calendar Components",
5
5
  "main": "google_calendar.app.mjs",
6
6
  "keywords": [
@@ -1,4 +1,5 @@
1
1
  import googleCalendar from "../google_calendar.app.mjs";
2
+ import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
2
3
 
3
4
  export default {
4
5
  props: {
@@ -12,7 +13,7 @@ export default {
12
13
  timer: {
13
14
  type: "$.interface.timer",
14
15
  default: {
15
- intervalSeconds: 15 * 60,
16
+ intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
16
17
  },
17
18
  },
18
19
  },
@@ -5,7 +5,7 @@ export default {
5
5
  key: "google_calendar-event-cancelled",
6
6
  name: "Event Cancelled",
7
7
  description: "Emits when an event is cancelled or deleted",
8
- version: "0.1.1",
8
+ version: "0.1.2",
9
9
  type: "source",
10
10
  dedupe: "unique", // Dedupe events based on the Google Calendar event ID
11
11
  methods: {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "google_calendar-event-ended",
6
6
  name: "Event Ended",
7
7
  description: "Emits when an event ends",
8
- version: "0.1.1",
8
+ version: "0.1.2",
9
9
  type: "source",
10
10
  dedupe: "unique", // Dedupe events based on the Google Calendar event ID
11
11
  methods: {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "google_calendar-event-start",
6
6
  name: "Event Start",
7
7
  description: "Emits a specified time before an event starts",
8
- version: "0.1.1",
8
+ version: "0.1.2",
9
9
  type: "source",
10
10
  dedupe: "unique", // Dedupe events based on the Google Calendar event ID
11
11
  methods: {
@@ -1,10 +1,11 @@
1
1
  import googleCalendar from "../../google_calendar.app.mjs";
2
+ import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
2
3
 
3
4
  export default {
4
5
  key: "google_calendar-new-calendar",
5
6
  name: "New Calendar",
6
7
  description: "Emit an event when a calendar is created.",
7
- version: "0.1.1",
8
+ version: "0.1.2",
8
9
  type: "source",
9
10
  props: {
10
11
  db: "$.service.db",
@@ -12,7 +13,7 @@ export default {
12
13
  timer: {
13
14
  type: "$.interface.timer",
14
15
  default: {
15
- intervalSeconds: 15 * 60,
16
+ intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
16
17
  },
17
18
  },
18
19
  },
@@ -5,7 +5,7 @@ export default {
5
5
  key: "google_calendar-new-event",
6
6
  name: "New Event",
7
7
  description: "Emits when an event is created",
8
- version: "0.1.1",
8
+ version: "0.1.2",
9
9
  type: "source",
10
10
  dedupe: "unique", // Dedupe events based on the Google Calendar event ID
11
11
  methods: {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "google_calendar-new-event-search",
6
6
  name: "Event Search",
7
7
  description: "Emit when an event is created that matches a search",
8
- version: "0.1.1",
8
+ version: "0.1.2",
9
9
  type: "source",
10
10
  dedupe: "unique", // Dedupe events based on the Google Calendar event ID
11
11
  props: {
@@ -5,7 +5,7 @@ export default {
5
5
  key: "google_calendar-new-or-updated-event",
6
6
  name: "New or Updated Event",
7
7
  description: "Emits when an event is created or updated (except when it's cancelled)",
8
- version: "0.1.1",
8
+ version: "0.1.2",
9
9
  type: "source",
10
10
  dedupe: "unique", // Dedupe events based on the Google Calendar event ID
11
11
  methods: {
@@ -1,12 +1,13 @@
1
1
  import { v4 as uuid } from "uuid";
2
2
  import googleCalendar from "../../google_calendar.app.mjs";
3
+ import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
3
4
 
4
5
  export default {
5
6
  key: "google_calendar-new-or-updated-event-instant",
6
7
  type: "source",
7
8
  name: "New or Updated Event (Instant)",
8
9
  description: "Emit new calendar events when an event is created or updated (does not emit cancelled events)",
9
- version: "0.1.4",
10
+ version: "0.1.5",
10
11
  dedupe: "unique",
11
12
  props: {
12
13
  googleCalendar,
@@ -33,7 +34,7 @@ export default {
33
34
  description: "The Google Calendar API requires occasional renewal of push notification subscriptions. **This runs in the background, so you should not need to modify this schedule**.",
34
35
  type: "$.interface.timer",
35
36
  static: {
36
- intervalSeconds: 60 * 60 * 23,
37
+ intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
37
38
  },
38
39
  },
39
40
  },