@activepieces/piece-google-calendar 0.9.3 → 0.9.5
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 +7 -15
- package/src/index.js +106 -81
- package/src/index.d.ts +0 -6
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/add-attendees.action.d.ts +0 -12
- package/src/lib/actions/add-attendees.action.d.ts.map +0 -1
- package/src/lib/actions/add-attendees.action.js +0 -53
- package/src/lib/actions/add-attendees.action.js.map +0 -1
- package/src/lib/actions/add-calendar-to-calendarlist.d.ts +0 -7
- package/src/lib/actions/add-calendar-to-calendarlist.d.ts.map +0 -1
- package/src/lib/actions/add-calendar-to-calendarlist.js +0 -34
- package/src/lib/actions/add-calendar-to-calendarlist.js.map +0 -1
- package/src/lib/actions/create-event.d.ts +0 -25
- package/src/lib/actions/create-event.d.ts.map +0 -1
- package/src/lib/actions/create-event.js +0 -148
- package/src/lib/actions/create-event.js.map +0 -1
- package/src/lib/actions/create-quick-event.d.ts +0 -12
- package/src/lib/actions/create-quick-event.d.ts.map +0 -1
- package/src/lib/actions/create-quick-event.js +0 -68
- package/src/lib/actions/create-quick-event.js.map +0 -1
- package/src/lib/actions/delete-event.action.d.ts +0 -11
- package/src/lib/actions/delete-event.action.d.ts.map +0 -1
- package/src/lib/actions/delete-event.action.js +0 -36
- package/src/lib/actions/delete-event.action.js.map +0 -1
- package/src/lib/actions/find-busy-free-periods.d.ts +0 -12
- package/src/lib/actions/find-busy-free-periods.d.ts.map +0 -1
- package/src/lib/actions/find-busy-free-periods.js +0 -79
- package/src/lib/actions/find-busy-free-periods.js.map +0 -1
- package/src/lib/actions/get-event-by-id.d.ts +0 -13
- package/src/lib/actions/get-event-by-id.d.ts.map +0 -1
- package/src/lib/actions/get-event-by-id.js +0 -94
- package/src/lib/actions/get-event-by-id.js.map +0 -1
- package/src/lib/actions/get-events.d.ts +0 -15
- package/src/lib/actions/get-events.d.ts.map +0 -1
- package/src/lib/actions/get-events.js +0 -100
- package/src/lib/actions/get-events.js.map +0 -1
- package/src/lib/actions/update-event.action.d.ts +0 -24
- package/src/lib/actions/update-event.action.d.ts.map +0 -1
- package/src/lib/actions/update-event.action.js +0 -113
- package/src/lib/actions/update-event.action.js.map +0 -1
- package/src/lib/auth.d.ts +0 -11
- package/src/lib/auth.d.ts.map +0 -1
- package/src/lib/auth.js +0 -86
- package/src/lib/auth.js.map +0 -1
- package/src/lib/common/helper.d.ts +0 -26
- package/src/lib/common/helper.d.ts.map +0 -1
- package/src/lib/common/helper.js +0 -269
- package/src/lib/common/helper.js.map +0 -1
- package/src/lib/common/index.d.ts +0 -20
- package/src/lib/common/index.d.ts.map +0 -1
- package/src/lib/common/index.js +0 -99
- package/src/lib/common/index.js.map +0 -1
- package/src/lib/common/types.d.ts +0 -240
- package/src/lib/common/types.d.ts.map +0 -1
- package/src/lib/common/types.js +0 -17
- package/src/lib/common/types.js.map +0 -1
- package/src/lib/triggers/calendar-event.d.ts +0 -39
- package/src/lib/triggers/calendar-event.d.ts.map +0 -1
- package/src/lib/triggers/calendar-event.js +0 -147
- package/src/lib/triggers/calendar-event.js.map +0 -1
- package/src/lib/triggers/event-cancelled.d.ts +0 -71
- package/src/lib/triggers/event-cancelled.d.ts.map +0 -1
- package/src/lib/triggers/event-cancelled.js +0 -168
- package/src/lib/triggers/event-cancelled.js.map +0 -1
- package/src/lib/triggers/event-ends.d.ts +0 -67
- package/src/lib/triggers/event-ends.d.ts.map +0 -1
- package/src/lib/triggers/event-ends.js +0 -169
- package/src/lib/triggers/event-ends.js.map +0 -1
- package/src/lib/triggers/event-start-time-before.d.ts +0 -75
- package/src/lib/triggers/event-start-time-before.d.ts.map +0 -1
- package/src/lib/triggers/event-start-time-before.js +0 -163
- package/src/lib/triggers/event-start-time-before.js.map +0 -1
- package/src/lib/triggers/new-calendar.d.ts +0 -31
- package/src/lib/triggers/new-calendar.d.ts.map +0 -1
- package/src/lib/triggers/new-calendar.js +0 -154
- package/src/lib/triggers/new-calendar.js.map +0 -1
- package/src/lib/triggers/new-event-matching-search.d.ts +0 -47
- package/src/lib/triggers/new-event-matching-search.d.ts.map +0 -1
- package/src/lib/triggers/new-event-matching-search.js +0 -187
- package/src/lib/triggers/new-event-matching-search.js.map +0 -1
- package/src/lib/triggers/new-event.d.ts +0 -47
- package/src/lib/triggers/new-event.d.ts.map +0 -1
- package/src/lib/triggers/new-event.js +0 -228
- package/src/lib/triggers/new-event.js.map +0 -1
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.eventEnds = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_framework_2 = require("@activepieces/pieces-framework");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
-
const pieces_common_2 = require("@activepieces/pieces-common");
|
|
10
|
-
const polling = {
|
|
11
|
-
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
12
|
-
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue, lastFetchEpochMS }) {
|
|
13
|
-
var _b, _c, _d, _e, _f, _g;
|
|
14
|
-
if (lastFetchEpochMS === 0) {
|
|
15
|
-
return [];
|
|
16
|
-
}
|
|
17
|
-
const { calendar_id: calendarId, specific_event, event_id } = propsValue;
|
|
18
|
-
if (!calendarId) {
|
|
19
|
-
return [];
|
|
20
|
-
}
|
|
21
|
-
if (specific_event && !event_id) {
|
|
22
|
-
return [];
|
|
23
|
-
}
|
|
24
|
-
let events = [];
|
|
25
|
-
if (specific_event && event_id) {
|
|
26
|
-
const eventRequest = {
|
|
27
|
-
method: pieces_common_2.HttpMethod.GET,
|
|
28
|
-
url: `${common_1.googleCalendarCommon.baseUrl}/calendars/${calendarId}/events/${event_id}`,
|
|
29
|
-
authentication: {
|
|
30
|
-
type: pieces_common_2.AuthenticationType.BEARER_TOKEN,
|
|
31
|
-
token: yield (0, common_1.getAccessToken)(auth),
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
try {
|
|
35
|
-
const eventResponse = yield pieces_common_2.httpClient.sendRequest(eventRequest);
|
|
36
|
-
const event = eventResponse.body;
|
|
37
|
-
const endTimeString = (_c = (_b = event.end) === null || _b === void 0 ? void 0 : _b.dateTime) !== null && _c !== void 0 ? _c : (_d = event.end) === null || _d === void 0 ? void 0 : _d.date;
|
|
38
|
-
if (endTimeString) {
|
|
39
|
-
const endTime = new Date(endTimeString).getTime();
|
|
40
|
-
if (endTime > lastFetchEpochMS) {
|
|
41
|
-
events = [event];
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
console.error('Error fetching specific event:', error);
|
|
47
|
-
return [];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
const request = {
|
|
52
|
-
method: pieces_common_2.HttpMethod.GET,
|
|
53
|
-
url: `${common_1.googleCalendarCommon.baseUrl}/calendars/${calendarId}/events`,
|
|
54
|
-
authentication: {
|
|
55
|
-
type: pieces_common_2.AuthenticationType.BEARER_TOKEN,
|
|
56
|
-
token: yield (0, common_1.getAccessToken)(auth),
|
|
57
|
-
},
|
|
58
|
-
queryParams: {
|
|
59
|
-
singleEvents: 'true',
|
|
60
|
-
orderBy: 'startTime',
|
|
61
|
-
timeMin: new Date(lastFetchEpochMS).toISOString(),
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
const response = yield pieces_common_2.httpClient.sendRequest(request);
|
|
65
|
-
events = response.body.items;
|
|
66
|
-
}
|
|
67
|
-
const endedEvents = [];
|
|
68
|
-
const now = Date.now();
|
|
69
|
-
for (const event of events) {
|
|
70
|
-
const endTimeString = (_f = (_e = event.end) === null || _e === void 0 ? void 0 : _e.dateTime) !== null && _f !== void 0 ? _f : (_g = event.end) === null || _g === void 0 ? void 0 : _g.date;
|
|
71
|
-
if (!endTimeString)
|
|
72
|
-
continue;
|
|
73
|
-
const endTime = new Date(endTimeString).getTime();
|
|
74
|
-
if (endTime > lastFetchEpochMS && endTime <= now) {
|
|
75
|
-
endedEvents.push({
|
|
76
|
-
epochMilliSeconds: endTime,
|
|
77
|
-
data: event,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return endedEvents;
|
|
82
|
-
}),
|
|
83
|
-
};
|
|
84
|
-
exports.eventEnds = (0, pieces_framework_1.createTrigger)({
|
|
85
|
-
auth: common_1.googleCalendarAuth,
|
|
86
|
-
name: 'event_ends',
|
|
87
|
-
displayName: 'Event Ends',
|
|
88
|
-
description: 'Fires when an event ends.',
|
|
89
|
-
aiMetadata: {
|
|
90
|
-
description: 'Fires once an event in the selected calendar reaches its end time, detected by polling. Each fired item is the event that just ended. Can watch all events in the calendar or be scoped to a single specific event.',
|
|
91
|
-
},
|
|
92
|
-
props: {
|
|
93
|
-
calendar_id: common_1.googleCalendarCommon.calendarDropdown('writer'),
|
|
94
|
-
specific_event: pieces_framework_1.Property.Checkbox({
|
|
95
|
-
displayName: 'Target Specific Event',
|
|
96
|
-
description: 'Enable to monitor a specific event instead of all events in the calendar.',
|
|
97
|
-
required: false,
|
|
98
|
-
defaultValue: false,
|
|
99
|
-
}),
|
|
100
|
-
event_id: common_1.googleCalendarCommon.eventDropdown(false),
|
|
101
|
-
},
|
|
102
|
-
type: pieces_framework_2.TriggerStrategy.POLLING,
|
|
103
|
-
sampleData: {
|
|
104
|
-
kind: 'calendar#event',
|
|
105
|
-
etag: '"3419997894982000"',
|
|
106
|
-
id: 'sample_event_id_67890',
|
|
107
|
-
status: 'confirmed',
|
|
108
|
-
htmlLink: 'https://www.google.com/calendar/event?eid=c2FtcGxlX2V2ZW50X2lkXzY3ODkw',
|
|
109
|
-
created: '2025-08-14T09:00:00.000Z',
|
|
110
|
-
updated: '2025-08-14T09:00:00.000Z',
|
|
111
|
-
summary: 'Project Deadline',
|
|
112
|
-
creator: { email: 'manager@example.com' },
|
|
113
|
-
organizer: {
|
|
114
|
-
email: 'manager@example.com',
|
|
115
|
-
self: true,
|
|
116
|
-
},
|
|
117
|
-
start: {
|
|
118
|
-
dateTime: '2025-08-14T14:30:00+05:30',
|
|
119
|
-
timeZone: 'Asia/Kolkata',
|
|
120
|
-
},
|
|
121
|
-
end: {
|
|
122
|
-
dateTime: '2025-08-14T15:30:00+05:30',
|
|
123
|
-
timeZone: 'Asia/Kolkata',
|
|
124
|
-
},
|
|
125
|
-
iCalUID: 'sample_event_id_67890@google.com',
|
|
126
|
-
sequence: 0,
|
|
127
|
-
reminders: { useDefault: true },
|
|
128
|
-
eventType: 'default',
|
|
129
|
-
},
|
|
130
|
-
onEnable(context) {
|
|
131
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
132
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
133
|
-
auth: context.auth,
|
|
134
|
-
store: context.store,
|
|
135
|
-
propsValue: context.propsValue,
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
},
|
|
139
|
-
onDisable(context) {
|
|
140
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
141
|
-
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
142
|
-
auth: context.auth,
|
|
143
|
-
store: context.store,
|
|
144
|
-
propsValue: context.propsValue,
|
|
145
|
-
});
|
|
146
|
-
});
|
|
147
|
-
},
|
|
148
|
-
run(context) {
|
|
149
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
150
|
-
return yield pieces_common_1.pollingHelper.poll(polling, {
|
|
151
|
-
auth: context.auth,
|
|
152
|
-
store: context.store,
|
|
153
|
-
propsValue: context.propsValue,
|
|
154
|
-
files: context.files,
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
},
|
|
158
|
-
test(context) {
|
|
159
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
160
|
-
return yield pieces_common_1.pollingHelper.test(polling, {
|
|
161
|
-
auth: context.auth,
|
|
162
|
-
store: context.store,
|
|
163
|
-
propsValue: context.propsValue,
|
|
164
|
-
files: context.files,
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
},
|
|
168
|
-
});
|
|
169
|
-
//# sourceMappingURL=event-ends.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-ends.js","sourceRoot":"","sources":["../../../../src/lib/triggers/event-ends.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,qEAAiE;AACjE,sCAAqF;AAErF,+DAIqC;AACrC,+DAKqC;AAMrC,MAAM,OAAO,GAOT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAA+C,EAAE,oDAA1C,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE;;QAClD,IAAI,gBAAgB,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC;QAEzE,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAI,cAAc,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAI,MAAM,GAA0B,EAAE,CAAC;QAEvC,IAAI,cAAc,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,YAAY,GAAgB;gBAChC,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,6BAAoB,CAAC,OAAO,cAAc,UAAU,WAAW,QAAQ,EAAE;gBACjF,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,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EAAE,OAAO,CAAC,KAAK;aACrB,CAAC,CAAC;QACL,CAAC;KAAA;IAEK,IAAI,CAAC,OAAO;;YAChB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE;gBACvC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const eventStartTimeBefore: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
-
}>)[], {
|
|
6
|
-
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
8
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
-
}>)[]>;
|
|
10
|
-
specific_event: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
11
|
-
event_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
12
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
13
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
14
|
-
}>)[]> | import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
15
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
16
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
17
|
-
}>)[]>;
|
|
18
|
-
time_value: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
19
|
-
time_unit: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
20
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
21
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
22
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
23
|
-
}>)[], {
|
|
24
|
-
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
25
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
26
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
27
|
-
}>)[]>;
|
|
28
|
-
specific_event: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
29
|
-
event_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
30
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
31
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
32
|
-
}>)[]> | import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
33
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
34
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
35
|
-
}>)[]>;
|
|
36
|
-
time_value: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
37
|
-
time_unit: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
38
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
39
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
40
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
41
|
-
}>)[], {
|
|
42
|
-
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
43
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
44
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
45
|
-
}>)[]>;
|
|
46
|
-
specific_event: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
47
|
-
event_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
48
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
49
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
50
|
-
}>)[]> | import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
51
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
52
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
53
|
-
}>)[]>;
|
|
54
|
-
time_value: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
55
|
-
time_unit: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
56
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
57
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
58
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
59
|
-
}>)[], {
|
|
60
|
-
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
61
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
62
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
63
|
-
}>)[]>;
|
|
64
|
-
specific_event: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
65
|
-
event_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
66
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
67
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
68
|
-
}>)[]> | import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
69
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
70
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
71
|
-
}>)[]>;
|
|
72
|
-
time_value: import("@activepieces/pieces-framework").NumberProperty<true>;
|
|
73
|
-
time_unit: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
74
|
-
}>;
|
|
75
|
-
//# sourceMappingURL=event-start-time-before.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-start-time-before.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/event-start-time-before.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AA2HjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0E/B,CAAC"}
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.eventStartTimeBefore = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_framework_2 = require("@activepieces/pieces-framework");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
-
const pieces_common_2 = require("@activepieces/pieces-common");
|
|
10
|
-
const polling = {
|
|
11
|
-
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
12
|
-
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue }) {
|
|
13
|
-
var _b, _c, _d, _e;
|
|
14
|
-
const { calendar_id, specific_event, event_id, time_value, time_unit } = propsValue;
|
|
15
|
-
if (!calendar_id || !time_value || !time_unit) {
|
|
16
|
-
return [];
|
|
17
|
-
}
|
|
18
|
-
if (specific_event && !event_id) {
|
|
19
|
-
return [];
|
|
20
|
-
}
|
|
21
|
-
let offset_ms = time_value * 60 * 1000;
|
|
22
|
-
if (time_unit === 'hours') {
|
|
23
|
-
offset_ms = time_value * 60 * 60 * 1000;
|
|
24
|
-
}
|
|
25
|
-
else if (time_unit === 'days') {
|
|
26
|
-
offset_ms = time_value * 24 * 60 * 60 * 1000;
|
|
27
|
-
}
|
|
28
|
-
const now = Date.now();
|
|
29
|
-
const pollingIntervalMs = 5 * 60 * 1000;
|
|
30
|
-
const timeMin = new Date(now + offset_ms).toISOString();
|
|
31
|
-
const timeMax = new Date(now + offset_ms + pollingIntervalMs).toISOString();
|
|
32
|
-
let events = [];
|
|
33
|
-
if (specific_event && event_id) {
|
|
34
|
-
const eventRequest = {
|
|
35
|
-
method: pieces_common_2.HttpMethod.GET,
|
|
36
|
-
url: `${common_1.googleCalendarCommon.baseUrl}/calendars/${calendar_id}/events/${event_id}`,
|
|
37
|
-
authentication: {
|
|
38
|
-
type: pieces_common_2.AuthenticationType.BEARER_TOKEN,
|
|
39
|
-
token: yield (0, common_1.getAccessToken)(auth),
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
try {
|
|
43
|
-
const eventResponse = yield pieces_common_2.httpClient.sendRequest(eventRequest);
|
|
44
|
-
const event = eventResponse.body;
|
|
45
|
-
// Check if this specific event falls within our time window
|
|
46
|
-
const eventStartTime = new Date((_e = (_c = (_b = event.start) === null || _b === void 0 ? void 0 : _b.dateTime) !== null && _c !== void 0 ? _c : (_d = event.start) === null || _d === void 0 ? void 0 : _d.date) !== null && _e !== void 0 ? _e : 0).getTime();
|
|
47
|
-
const triggerTime = eventStartTime - offset_ms;
|
|
48
|
-
if (triggerTime >= now && triggerTime <= now + pollingIntervalMs) {
|
|
49
|
-
events = [event];
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
console.error('Error fetching specific event:', error);
|
|
54
|
-
return [];
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
const request = {
|
|
59
|
-
method: pieces_common_2.HttpMethod.GET,
|
|
60
|
-
url: `${common_1.googleCalendarCommon.baseUrl}/calendars/${calendar_id}/events`,
|
|
61
|
-
authentication: {
|
|
62
|
-
type: pieces_common_2.AuthenticationType.BEARER_TOKEN,
|
|
63
|
-
token: yield (0, common_1.getAccessToken)(auth),
|
|
64
|
-
},
|
|
65
|
-
queryParams: {
|
|
66
|
-
singleEvents: 'true',
|
|
67
|
-
orderBy: 'startTime',
|
|
68
|
-
timeMin: timeMin,
|
|
69
|
-
timeMax: timeMax,
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
const response = yield pieces_common_2.httpClient.sendRequest(request);
|
|
73
|
-
events = response.body.items;
|
|
74
|
-
}
|
|
75
|
-
return events.map((event) => {
|
|
76
|
-
var _a, _b, _c, _d;
|
|
77
|
-
const startTime = new Date((_d = (_b = (_a = event.start) === null || _a === void 0 ? void 0 : _a.dateTime) !== null && _b !== void 0 ? _b : (_c = event.start) === null || _c === void 0 ? void 0 : _c.date) !== null && _d !== void 0 ? _d : 0).getTime();
|
|
78
|
-
const triggerTime = startTime - offset_ms;
|
|
79
|
-
return {
|
|
80
|
-
epochMilliSeconds: triggerTime,
|
|
81
|
-
data: event,
|
|
82
|
-
};
|
|
83
|
-
});
|
|
84
|
-
}),
|
|
85
|
-
};
|
|
86
|
-
exports.eventStartTimeBefore = (0, pieces_framework_1.createTrigger)({
|
|
87
|
-
auth: common_1.googleCalendarAuth,
|
|
88
|
-
name: 'event_starts_in',
|
|
89
|
-
displayName: 'Event Start (Time Before)',
|
|
90
|
-
description: 'Fires at a specified amount of time before an event starts (e.g., a reminder).',
|
|
91
|
-
aiMetadata: {
|
|
92
|
-
description: 'Fires a configurable lead time (in minutes, hours, or days) before an event in the selected calendar begins, acting as a pre-event reminder. Each fired item is the upcoming event. Can watch all events or a single specific event.',
|
|
93
|
-
},
|
|
94
|
-
props: {
|
|
95
|
-
calendar_id: common_1.googleCalendarCommon.calendarDropdown('writer'),
|
|
96
|
-
specific_event: pieces_framework_1.Property.Checkbox({
|
|
97
|
-
displayName: 'Target Specific Event',
|
|
98
|
-
description: 'Enable to monitor a specific event instead of all events in the calendar.',
|
|
99
|
-
required: false,
|
|
100
|
-
defaultValue: false,
|
|
101
|
-
}),
|
|
102
|
-
event_id: common_1.googleCalendarCommon.eventDropdown(false),
|
|
103
|
-
time_value: pieces_framework_1.Property.Number({
|
|
104
|
-
displayName: 'Time Before',
|
|
105
|
-
description: 'The amount of time before the event starts.',
|
|
106
|
-
required: true,
|
|
107
|
-
defaultValue: 15,
|
|
108
|
-
}),
|
|
109
|
-
time_unit: pieces_framework_1.Property.StaticDropdown({
|
|
110
|
-
displayName: 'Time Unit',
|
|
111
|
-
required: true,
|
|
112
|
-
options: {
|
|
113
|
-
options: [
|
|
114
|
-
{ label: 'Minutes', value: 'minutes' },
|
|
115
|
-
{ label: 'Hours', value: 'hours' },
|
|
116
|
-
{ label: 'Days', value: 'days' },
|
|
117
|
-
],
|
|
118
|
-
},
|
|
119
|
-
defaultValue: 'minutes',
|
|
120
|
-
}),
|
|
121
|
-
},
|
|
122
|
-
type: pieces_framework_2.TriggerStrategy.POLLING,
|
|
123
|
-
sampleData: {},
|
|
124
|
-
onEnable(context) {
|
|
125
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
126
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
127
|
-
auth: context.auth,
|
|
128
|
-
store: context.store,
|
|
129
|
-
propsValue: context.propsValue,
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
},
|
|
133
|
-
onDisable(context) {
|
|
134
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
135
|
-
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
136
|
-
auth: context.auth,
|
|
137
|
-
store: context.store,
|
|
138
|
-
propsValue: context.propsValue,
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
},
|
|
142
|
-
run(context) {
|
|
143
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
144
|
-
return yield pieces_common_1.pollingHelper.poll(polling, {
|
|
145
|
-
auth: context.auth,
|
|
146
|
-
store: context.store,
|
|
147
|
-
propsValue: context.propsValue,
|
|
148
|
-
files: context.files,
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
},
|
|
152
|
-
test(context) {
|
|
153
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
154
|
-
return yield pieces_common_1.pollingHelper.test(polling, {
|
|
155
|
-
auth: context.auth,
|
|
156
|
-
store: context.store,
|
|
157
|
-
propsValue: context.propsValue,
|
|
158
|
-
files: context.files,
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
},
|
|
162
|
-
});
|
|
163
|
-
//# sourceMappingURL=event-start-time-before.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-start-time-before.js","sourceRoot":"","sources":["../../../../src/lib/triggers/event-start-time-before.ts"],"names":[],"mappings":";;;;AAAA,qEAKwC;AACxC,qEAAiE;AACjE,sCAAqF;AAErF,+DAIqC;AACrC,+DAKqC;AAMrC,MAAM,OAAO,GAST;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAA6B,EAAE,oDAAxB,EAAE,IAAI,EAAE,UAAU,EAAE;;QAChC,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,GACpE,UAAU,CAAC;QAEb,IAAI,CAAC,WAAW,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,EAAE,CAAC;YAC9C,OAAO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BACjC;aACF;YACD,YAAY,EAAE,SAAS;SACxB,CAAC;KACH;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,UAAU,EAAE,EAAE;IAER,QAAQ,CAAC,OAAO;;YACpB,MAAM,6BAAa,CAAC,QAAQ,CAAC,OAAO,EAAE;gBACpC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;aAC/B,CAAC,CAAC;QACL,CAAC;KAAA;IAEK,SAAS,CAAC,OAAO;;YACrB,MAAM,6BAAa,CAAC,SAAS,CAAC,OAAO,EAAE;gBACrC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;aAC/B,CAAC,CAAC;QACL,CAAC;KAAA;IAEK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE;gBACvC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB,CAAC,CAAC;QACL,CAAC;KAAA;IAEK,IAAI,CAAC,OAAO;;YAChB,OAAO,MAAM,6BAAa,CAAC,IAAI,CAAC,OAAO,EAAE;gBACvC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const newCalendar: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
-
}>)[], {
|
|
6
|
-
access_role_filter: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, false>;
|
|
7
|
-
calendar_name_filter: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
-
exclude_shared: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
9
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
10
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
11
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
12
|
-
}>)[], {
|
|
13
|
-
access_role_filter: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, false>;
|
|
14
|
-
calendar_name_filter: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
15
|
-
exclude_shared: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
16
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
17
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
18
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
19
|
-
}>)[], {
|
|
20
|
-
access_role_filter: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, false>;
|
|
21
|
-
calendar_name_filter: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
22
|
-
exclude_shared: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
23
|
-
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
24
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
25
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
26
|
-
}>)[], {
|
|
27
|
-
access_role_filter: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, false>;
|
|
28
|
-
calendar_name_filter: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
29
|
-
exclude_shared: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
30
|
-
}>;
|
|
31
|
-
//# sourceMappingURL=new-calendar.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-calendar.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-calendar.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AA2EjE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6HtB,CAAC"}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.newCalendar = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_framework_2 = require("@activepieces/pieces-framework");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
-
const helper_1 = require("../common/helper");
|
|
10
|
-
const polling = {
|
|
11
|
-
strategy: pieces_common_1.DedupeStrategy.LAST_ITEM,
|
|
12
|
-
items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, store, propsValue }) {
|
|
13
|
-
const { access_role_filter, calendar_name_filter, exclude_shared } = propsValue;
|
|
14
|
-
const currentCalendars = yield (0, helper_1.getCalendars)(auth);
|
|
15
|
-
let filteredCalendars = currentCalendars;
|
|
16
|
-
if (access_role_filter && access_role_filter.length > 0) {
|
|
17
|
-
filteredCalendars = filteredCalendars.filter((cal) => access_role_filter.includes(cal.accessRole));
|
|
18
|
-
}
|
|
19
|
-
if (calendar_name_filter && calendar_name_filter.trim()) {
|
|
20
|
-
const searchTerm = calendar_name_filter.toLowerCase().trim();
|
|
21
|
-
filteredCalendars = filteredCalendars.filter((cal) => {
|
|
22
|
-
var _a, _b;
|
|
23
|
-
return ((_a = cal.summary) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTerm)) ||
|
|
24
|
-
((_b = cal.description) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes(searchTerm));
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
if (exclude_shared) {
|
|
28
|
-
filteredCalendars = filteredCalendars.filter((cal) => cal.accessRole === 'owner' || cal.primary);
|
|
29
|
-
}
|
|
30
|
-
const currentCalendarIds = filteredCalendars.map((cal) => cal.id);
|
|
31
|
-
const oldCalendarIds = (yield store.get('calendars')) || [];
|
|
32
|
-
const oldCalendarIdsSet = new Set(oldCalendarIds);
|
|
33
|
-
const newCalendars = filteredCalendars.filter((cal) => !oldCalendarIdsSet.has(cal.id));
|
|
34
|
-
yield store.put('calendars', currentCalendarIds);
|
|
35
|
-
return newCalendars.map((cal) => ({
|
|
36
|
-
id: cal.id,
|
|
37
|
-
data: Object.assign(Object.assign({}, cal), { isOwned: cal.accessRole === 'owner' || cal.primary, isShared: cal.accessRole !== 'owner' && !cal.primary, calendarType: cal.primary
|
|
38
|
-
? 'primary'
|
|
39
|
-
: cal.accessRole === 'owner'
|
|
40
|
-
? 'owned'
|
|
41
|
-
: 'shared' }),
|
|
42
|
-
}));
|
|
43
|
-
}),
|
|
44
|
-
};
|
|
45
|
-
exports.newCalendar = (0, pieces_framework_1.createTrigger)({
|
|
46
|
-
auth: common_1.googleCalendarAuth,
|
|
47
|
-
name: 'new_calendar',
|
|
48
|
-
displayName: 'New Calendar',
|
|
49
|
-
description: 'Fires when a new calendar is created or becomes accessible.',
|
|
50
|
-
aiMetadata: {
|
|
51
|
-
description: 'Fires when a calendar newly appears in the connected account\'s calendar list, whether created or shared in, detected by polling. Each fired item is the new calendar. Can be filtered by access role, a name/description text match, and an option to exclude shared calendars.',
|
|
52
|
-
},
|
|
53
|
-
props: {
|
|
54
|
-
access_role_filter: pieces_framework_1.Property.StaticMultiSelectDropdown({
|
|
55
|
-
displayName: 'Access Role Filter',
|
|
56
|
-
description: 'Only trigger for calendars with specific access roles (optional)',
|
|
57
|
-
required: false,
|
|
58
|
-
options: {
|
|
59
|
-
options: [
|
|
60
|
-
{ label: 'Owner', value: 'owner' },
|
|
61
|
-
{ label: 'Writer', value: 'writer' },
|
|
62
|
-
{ label: 'Reader', value: 'reader' },
|
|
63
|
-
{ label: 'Free/Busy Reader', value: 'freeBusyReader' },
|
|
64
|
-
],
|
|
65
|
-
},
|
|
66
|
-
}),
|
|
67
|
-
calendar_name_filter: pieces_framework_1.Property.ShortText({
|
|
68
|
-
displayName: 'Calendar Name Filter',
|
|
69
|
-
description: 'Only trigger for calendars containing this text in name or description (optional)',
|
|
70
|
-
required: false,
|
|
71
|
-
}),
|
|
72
|
-
exclude_shared: pieces_framework_1.Property.Checkbox({
|
|
73
|
-
displayName: 'Exclude Shared Calendars',
|
|
74
|
-
description: 'Only trigger for calendars you own, not shared calendars',
|
|
75
|
-
required: false,
|
|
76
|
-
defaultValue: false,
|
|
77
|
-
}),
|
|
78
|
-
},
|
|
79
|
-
type: pieces_framework_2.TriggerStrategy.POLLING,
|
|
80
|
-
sampleData: {
|
|
81
|
-
id: 'sample_calendar_id@group.calendar.google.com',
|
|
82
|
-
summary: 'New Project Team Calendar',
|
|
83
|
-
description: 'A shared calendar for the new project team.',
|
|
84
|
-
timeZone: 'Asia/Kolkata',
|
|
85
|
-
backgroundColor: '#9fe1e7',
|
|
86
|
-
foregroundColor: '#000000',
|
|
87
|
-
accessRole: 'owner',
|
|
88
|
-
isOwned: true,
|
|
89
|
-
isShared: false,
|
|
90
|
-
calendarType: 'owned',
|
|
91
|
-
primary: false,
|
|
92
|
-
},
|
|
93
|
-
onEnable(context) {
|
|
94
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
95
|
-
const calendars = yield (0, helper_1.getCalendars)(context.auth);
|
|
96
|
-
const { access_role_filter, calendar_name_filter, exclude_shared } = context.propsValue;
|
|
97
|
-
let filteredCalendars = calendars;
|
|
98
|
-
if (access_role_filter && access_role_filter.length > 0) {
|
|
99
|
-
filteredCalendars = filteredCalendars.filter((cal) => access_role_filter.includes(cal.accessRole));
|
|
100
|
-
}
|
|
101
|
-
if (calendar_name_filter && calendar_name_filter.trim()) {
|
|
102
|
-
const searchTerm = calendar_name_filter.toLowerCase().trim();
|
|
103
|
-
filteredCalendars = filteredCalendars.filter((cal) => {
|
|
104
|
-
var _a, _b;
|
|
105
|
-
return ((_a = cal.summary) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTerm)) ||
|
|
106
|
-
((_b = cal.description) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes(searchTerm));
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
if (exclude_shared) {
|
|
110
|
-
filteredCalendars = filteredCalendars.filter((cal) => cal.accessRole === 'owner' || cal.primary);
|
|
111
|
-
}
|
|
112
|
-
yield context.store.put('calendars', filteredCalendars.map((cal) => cal.id));
|
|
113
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
114
|
-
auth: context.auth,
|
|
115
|
-
store: context.store,
|
|
116
|
-
propsValue: context.propsValue,
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
},
|
|
120
|
-
onDisable(context) {
|
|
121
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
122
|
-
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
123
|
-
auth: context.auth,
|
|
124
|
-
store: context.store,
|
|
125
|
-
propsValue: context.propsValue,
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
},
|
|
129
|
-
run(context) {
|
|
130
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
131
|
-
return yield pieces_common_1.pollingHelper.poll(polling, {
|
|
132
|
-
auth: context.auth,
|
|
133
|
-
store: context.store,
|
|
134
|
-
propsValue: context.propsValue,
|
|
135
|
-
files: context.files,
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
},
|
|
139
|
-
test(context) {
|
|
140
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
141
|
-
const calendars = yield (0, helper_1.getCalendars)(context.auth);
|
|
142
|
-
const recentCalendars = calendars.slice(-1);
|
|
143
|
-
return recentCalendars.map((cal) => ({
|
|
144
|
-
id: cal.id,
|
|
145
|
-
data: Object.assign(Object.assign({}, cal), { isOwned: cal.accessRole === 'owner' || cal.primary, isShared: cal.accessRole !== 'owner' && !cal.primary, calendarType: cal.primary
|
|
146
|
-
? 'primary'
|
|
147
|
-
: cal.accessRole === 'owner'
|
|
148
|
-
? 'owned'
|
|
149
|
-
: 'shared' }),
|
|
150
|
-
}));
|
|
151
|
-
});
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
//# sourceMappingURL=new-calendar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"new-calendar.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-calendar.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,qEAAiE;AACjE,sCAA+C;AAC/C,+DAIqC;AACrC,6CAAgD;AAGhD,MAAM,OAAO,GAOT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;I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