@pipedream/google_calendar 0.3.16 → 0.3.17
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/package.json +1 -1
- package/sources/common/common.mjs +7 -18
- package/sources/event-cancelled/event-cancelled.mjs +8 -4
- package/sources/event-ended/event-ended.mjs +8 -4
- package/sources/event-start/event-start.mjs +29 -11
- package/sources/new-calendar/new-calendar.mjs +2 -4
- package/sources/new-event/new-event.mjs +8 -4
- package/sources/new-event-search/new-event-search.mjs +9 -5
- package/sources/new-or-updated-event/new-or-updated-event.mjs +8 -4
package/package.json
CHANGED
|
@@ -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:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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.
|
|
8
|
+
version: "0.1.5",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
|
-
...common.props
|
|
13
|
-
|
|
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.
|
|
8
|
+
version: "0.1.5",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
|
-
...common.props
|
|
13
|
-
|
|
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.
|
|
9
|
+
version: "0.1.6",
|
|
10
10
|
type: "source",
|
|
11
11
|
dedupe: "unique",
|
|
12
12
|
props: {
|
|
13
|
-
...common.props
|
|
14
|
-
|
|
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
|
-
|
|
33
|
+
now, intervalMs,
|
|
21
34
|
}) {
|
|
22
|
-
const
|
|
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
|
|
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
|
-
|
|
51
|
+
now, intervalMs,
|
|
34
52
|
}) {
|
|
35
|
-
const
|
|
36
|
-
const start = new Date(eventStart);
|
|
53
|
+
const start = new Date(event?.start?.dateTime);
|
|
37
54
|
const msFromStart = start.getTime() - now.getTime();
|
|
38
|
-
return
|
|
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.
|
|
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.
|
|
8
|
+
version: "0.1.5",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
|
-
...common.props
|
|
13
|
-
|
|
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.
|
|
8
|
+
version: "0.1.5",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
|
-
...common.props
|
|
13
|
-
|
|
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
|
|
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.
|
|
8
|
+
version: "0.1.5",
|
|
9
9
|
type: "source",
|
|
10
10
|
dedupe: "unique",
|
|
11
11
|
props: {
|
|
12
|
-
...common.props
|
|
13
|
-
|
|
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,
|