@pipedream/google_calendar 0.3.16 → 0.3.18

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.
@@ -39,6 +39,12 @@ export default {
39
39
  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.",
40
40
  optional: isUpdate,
41
41
  },
42
+ recurrence: {
43
+ label: "Recurrence",
44
+ type: "string[]",
45
+ description: "Recurrence rule(s) for the event. For example, `FREQ=DAILY;INTERVAL=2` means once every two days, `RRULE:FREQ=YEARLY` means annually.\nYou can combine multiple recurrence rules. [See the documentation](https://developers.google.com/calendar/api/concepts/events-calendars#recurrence_rule)",
46
+ optional: true,
47
+ },
42
48
  timeZone: {
43
49
  propDefinition: [
44
50
  googleCalendar,
@@ -6,7 +6,7 @@ export default {
6
6
  key: "google_calendar-create-event",
7
7
  name: "Create Event",
8
8
  description: "Create an event to the Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#insert)",
9
- version: "0.1.7",
9
+ version: "0.1.8",
10
10
  type: "action",
11
11
  props: {
12
12
  googleCalendar,
@@ -49,6 +49,7 @@ export default {
49
49
  date: this.eventEndDate,
50
50
  timeZone,
51
51
  }),
52
+ recurrence: this.recurrence,
52
53
  attendees,
53
54
  },
54
55
  };
@@ -5,7 +5,7 @@ export default {
5
5
  key: "google_calendar-update-event",
6
6
  name: "Update Event",
7
7
  description: "Update an event from Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#update)",
8
- version: "0.0.3",
8
+ version: "0.0.4",
9
9
  type: "action",
10
10
  props: {
11
11
  googleCalendar,
@@ -57,6 +57,7 @@ export default {
57
57
  date: this.eventEndDate || currentEvent.end.dateTime,
58
58
  timeZone: timeZone || currentEvent.end.timeZone,
59
59
  }),
60
+ recurrence: this.recurrence,
60
61
  attendees,
61
62
  },
62
63
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipedream/google_calendar",
3
- "version": "0.3.16",
3
+ "version": "0.3.18",
4
4
  "description": "Pipedream Google_calendar Components",
5
5
  "main": "google_calendar.app.mjs",
6
6
  "keywords": [
@@ -2,25 +2,14 @@ import googleCalendar from "../../google_calendar.app.mjs";
2
2
  import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
3
3
 
4
4
  export default {
5
- props: ({ useCalendarId }) => {
6
- const props = {
7
- googleCalendar,
8
- timer: {
9
- type: "$.interface.timer",
10
- default: {
11
- intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
12
- },
5
+ props: {
6
+ googleCalendar,
7
+ timer: {
8
+ type: "$.interface.timer",
9
+ default: {
10
+ intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
13
11
  },
14
- };
15
- if (useCalendarId) {
16
- props.calendarId = {
17
- propDefinition: [
18
- googleCalendar,
19
- "calendarId",
20
- ],
21
- };
22
- }
23
- return props;
12
+ },
24
13
  },
25
14
  hooks: {
26
15
  async activate() {
@@ -5,13 +5,17 @@ export default {
5
5
  key: "google_calendar-event-cancelled",
6
6
  name: "New Cancelled Event",
7
7
  description: "Emit new event when a Google Calendar event is cancelled or deleted",
8
- version: "0.1.4",
8
+ version: "0.1.5",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  props: {
12
- ...common.props({
13
- useCalendarId: true,
14
- }),
12
+ ...common.props,
13
+ calendarId: {
14
+ propDefinition: [
15
+ common.props.googleCalendar,
16
+ "calendarId",
17
+ ],
18
+ },
15
19
  },
16
20
  methods: {
17
21
  ...common.methods,
@@ -5,13 +5,17 @@ export default {
5
5
  key: "google_calendar-event-ended",
6
6
  name: "New Ended Event",
7
7
  description: "Emit new event when a Google Calendar event ends",
8
- version: "0.1.4",
8
+ version: "0.1.5",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  props: {
12
- ...common.props({
13
- useCalendarId: true,
14
- }),
12
+ ...common.props,
13
+ calendarId: {
14
+ propDefinition: [
15
+ common.props.googleCalendar,
16
+ "calendarId",
17
+ ],
18
+ },
15
19
  },
16
20
  methods: {
17
21
  ...common.methods,
@@ -6,23 +6,41 @@ export default {
6
6
  key: "google_calendar-event-start",
7
7
  name: "New Event Start",
8
8
  description: "Emit new event when the specified time before the Google Calendar event starts",
9
- version: "0.1.5",
9
+ version: "0.1.6",
10
10
  type: "source",
11
11
  dedupe: "unique",
12
12
  props: {
13
- ...common.props({
14
- useCalendarId: true,
15
- }),
13
+ ...common.props,
14
+ calendarId: {
15
+ propDefinition: [
16
+ common.props.googleCalendar,
17
+ "calendarId",
18
+ ],
19
+ },
20
+ minutesBefore: {
21
+ type: "integer",
22
+ label: "Minutes Before",
23
+ description: "Emit the event this many minutes before the event starts",
24
+ default: 5,
25
+ },
16
26
  },
17
27
  methods: {
18
28
  ...common.methods,
29
+ getMillisecondsBefore() {
30
+ return +this.minutesBefore * 60 * 1000;
31
+ },
19
32
  getConfig({
20
- intervalMs, now,
33
+ now, intervalMs,
21
34
  }) {
22
- const timeMin = now.toISOString();
35
+ const {
36
+ getMillisecondsBefore,
37
+ calendarId,
38
+ } = this;
39
+
40
+ const timeMin = new Date(now.getTime() - getMillisecondsBefore()).toISOString();
23
41
  const timeMax = new Date(now.getTime() + intervalMs).toISOString();
24
42
  return {
25
- calendarId: this.calendarId,
43
+ calendarId,
26
44
  timeMax,
27
45
  timeMin,
28
46
  singleEvents: true,
@@ -30,12 +48,12 @@ export default {
30
48
  };
31
49
  },
32
50
  isRelevant(event, {
33
- intervalMs, now,
51
+ now, intervalMs,
34
52
  }) {
35
- const eventStart = event?.start?.dateTime;
36
- const start = new Date(eventStart);
53
+ const start = new Date(event?.start?.dateTime);
37
54
  const msFromStart = start.getTime() - now.getTime();
38
- return eventStart && msFromStart > 0 && msFromStart < intervalMs;
55
+ return msFromStart > 0
56
+ && msFromStart < (this.getMillisecondsBefore() + intervalMs);
39
57
  },
40
58
  },
41
59
  sampleEmit,
@@ -4,12 +4,10 @@ export default {
4
4
  key: "google_calendar-new-calendar",
5
5
  name: "New Calendar Created",
6
6
  description: "Emit new event when a calendar is created.",
7
- version: "0.1.4",
7
+ version: "0.1.5",
8
8
  type: "source",
9
9
  props: {
10
- ...common.props({
11
- useCalendarId: false,
12
- }),
10
+ ...common.props,
13
11
  db: "$.service.db",
14
12
  },
15
13
  hooks: {
@@ -5,13 +5,17 @@ export default {
5
5
  key: "google_calendar-new-event",
6
6
  name: "New Event Created",
7
7
  description: "Emit new event when a Google Calendar event is created",
8
- version: "0.1.4",
8
+ version: "0.1.5",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  props: {
12
- ...common.props({
13
- useCalendarId: true,
14
- }),
12
+ ...common.props,
13
+ calendarId: {
14
+ propDefinition: [
15
+ common.props.googleCalendar,
16
+ "calendarId",
17
+ ],
18
+ },
15
19
  },
16
20
  methods: {
17
21
  ...common.methods,
@@ -5,16 +5,20 @@ export default {
5
5
  key: "google_calendar-new-event-search",
6
6
  name: "New Event Matching a Search",
7
7
  description: "Emit new event when a Google Calendar event is created that matches a search",
8
- version: "0.1.4",
8
+ version: "0.1.5",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  props: {
12
- ...common.props({
13
- useCalendarId: true,
14
- }),
12
+ ...common.props,
13
+ calendarId: {
14
+ propDefinition: [
15
+ common.props.googleCalendar,
16
+ "calendarId",
17
+ ],
18
+ },
15
19
  q: {
16
20
  propDefinition: [
17
- common.props({}).googleCalendar,
21
+ common.props.googleCalendar,
18
22
  "q",
19
23
  ],
20
24
  },
@@ -5,13 +5,17 @@ export default {
5
5
  key: "google_calendar-new-or-updated-event",
6
6
  name: "New Created or Updated Event",
7
7
  description: "Emit new event when a Google Calendar events is created or updated (does not emit cancelled events)",
8
- version: "0.1.4",
8
+ version: "0.1.5",
9
9
  type: "source",
10
10
  dedupe: "unique",
11
11
  props: {
12
- ...common.props({
13
- useCalendarId: true,
14
- }),
12
+ ...common.props,
13
+ calendarId: {
14
+ propDefinition: [
15
+ common.props.googleCalendar,
16
+ "calendarId",
17
+ ],
18
+ },
15
19
  },
16
20
  methods: {
17
21
  ...common.methods,