@activepieces/piece-google-calendar 0.9.3 → 0.9.4
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
package/src/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { googleCalendarAuth, getAccessToken, GoogleCalendarAuthValue, createGoogleClient } from './lib/common';
|
|
2
|
-
export declare const googleCalendar: import("@activepieces/pieces-framework").Piece<(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
|
-
//# sourceMappingURL=index.d.ts.map
|
package/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE/G,eAAO,MAAM,cAAc;;;MAqDzB,CAAC"}
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAEwC;AACxC,iDAAqD;AACrD,6DAAyD;AACzD,yEAA4E;AAC5E,2EAAsE;AACtE,yDAAqD;AACrD,2EAAsE;AACtE,yCA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+0,0 @@
|
|
|
1
|
-
export declare const addAttendeesToEventAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
-
}>)[], {
|
|
5
|
-
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
-
}>)[]>;
|
|
9
|
-
eventId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
-
attendees: import("@activepieces/pieces-framework").ArrayProperty<true>;
|
|
11
|
-
}>;
|
|
12
|
-
//# sourceMappingURL=add-attendees.action.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-attendees.action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/add-attendees.action.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,yBAAyB;;;;;;;;;;EAiDpC,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addAttendeesToEventAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const googleapis_1 = require("googleapis");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
exports.addAttendeesToEventAction = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: common_1.googleCalendarAuth,
|
|
10
|
-
name: 'google-calendar-add-attendees',
|
|
11
|
-
displayName: 'Add Attendees to Event',
|
|
12
|
-
description: 'Add one or more person to existing event.',
|
|
13
|
-
audience: 'both',
|
|
14
|
-
aiMetadata: { description: 'Adds one or more guests (by email) to an existing Google Calendar event, identified by calendar and event ID, preserving the current attendee list. Use to invite people to an event that already exists rather than recreating it. Not idempotent: re-running appends the same emails again, producing duplicate attendee entries.', idempotent: false },
|
|
15
|
-
props: {
|
|
16
|
-
calendar_id: common_1.googleCalendarCommon.calendarDropdown('writer'),
|
|
17
|
-
eventId: pieces_framework_1.Property.ShortText({
|
|
18
|
-
displayName: 'Event ID',
|
|
19
|
-
required: true,
|
|
20
|
-
}),
|
|
21
|
-
attendees: pieces_framework_1.Property.Array({
|
|
22
|
-
displayName: 'Attendees',
|
|
23
|
-
description: 'Emails of the attendees (guests)',
|
|
24
|
-
required: true,
|
|
25
|
-
}),
|
|
26
|
-
},
|
|
27
|
-
run(context) {
|
|
28
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
var _a;
|
|
30
|
-
const { calendar_id, eventId } = context.propsValue;
|
|
31
|
-
const attendeesInput = context.propsValue.attendees;
|
|
32
|
-
const authClient = yield (0, common_1.createGoogleClient)(context.auth);
|
|
33
|
-
const calendar = googleapis_1.google.calendar({ version: 'v3', auth: authClient });
|
|
34
|
-
// Note that each patch request consumes three quota units;
|
|
35
|
-
// prefer using a get followed by an update
|
|
36
|
-
const currentEvent = yield calendar.events.get({
|
|
37
|
-
calendarId: calendar_id,
|
|
38
|
-
eventId: eventId,
|
|
39
|
-
});
|
|
40
|
-
const currentAttendees = (_a = currentEvent.data.attendees) !== null && _a !== void 0 ? _a : [];
|
|
41
|
-
const attendeeFormattedList = [];
|
|
42
|
-
attendeeFormattedList.push(...currentAttendees);
|
|
43
|
-
attendeeFormattedList.push(...attendeesInput.map((email) => ({ email })));
|
|
44
|
-
const response = yield calendar.events.update({
|
|
45
|
-
calendarId: calendar_id,
|
|
46
|
-
eventId,
|
|
47
|
-
requestBody: Object.assign(Object.assign({}, currentEvent.data), { attendees: attendeeFormattedList }),
|
|
48
|
-
});
|
|
49
|
-
return response.data;
|
|
50
|
-
});
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
//# sourceMappingURL=add-attendees.action.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-attendees.action.js","sourceRoot":"","sources":["../../../../src/lib/actions/add-attendees.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,2CAAiD;AACjD,sCAAyF;AAE5E,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,2BAAkB;IACxB,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,2CAA2C;IACxD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,qUAAqU,EAAE,UAAU,EAAE,KAAK,EAAE;IACrX,KAAK,EAAE;QACL,WAAW,EAAE,6BAAoB,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QAC5D,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,UAAU;YACvB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACxB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACpD,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,SAAqB,CAAC;YAEhE,MAAM,UAAU,GAAG,MAAM,IAAA,2BAAkB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC1D,MAAM,QAAQ,GAAG,mBAAM,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAEtE,2DAA2D;YAC3D,2CAA2C;YAC3C,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC;gBAC7C,UAAU,EAAE,WAAW;gBACvB,OAAO,EAAE,OAAO;aACjB,CAAC,CAAC;YACH,MAAM,gBAAgB,GAAG,MAAA,YAAY,CAAC,IAAI,CAAC,SAAS,mCAAI,EAAE,CAAC;YAE3D,MAAM,qBAAqB,GAAuC,EAAE,CAAC;YACrE,qBAAqB,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAC;YAChD,qBAAqB,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;YAE1E,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;gBAC5C,UAAU,EAAE,WAAY;gBACxB,OAAO;gBACP,WAAW,kCACN,YAAY,CAAC,IAAI,KACpB,SAAS,EAAE,qBAAqB,GACjC;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const addCalendarToCalendarlist: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
-
}>)[], {
|
|
5
|
-
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=add-calendar-to-calendarlist.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-calendar-to-calendarlist.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/add-calendar-to-calendarlist.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,yBAAyB;;;;;EA4BpC,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addCalendarToCalendarlist = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const googleapis_1 = require("googleapis");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
exports.addCalendarToCalendarlist = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: common_1.googleCalendarAuth,
|
|
10
|
-
name: 'addCalendarToCalendarlist',
|
|
11
|
-
displayName: 'Add Calendar to calendarList',
|
|
12
|
-
description: "Adds other people's calendars to your calendarList",
|
|
13
|
-
props: {
|
|
14
|
-
id: pieces_framework_1.Property.ShortText({
|
|
15
|
-
displayName: "Calendar Id",
|
|
16
|
-
description: "Find calendar id by going to calendar settings",
|
|
17
|
-
required: true
|
|
18
|
-
})
|
|
19
|
-
},
|
|
20
|
-
run(context) {
|
|
21
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
const id = context.propsValue.id;
|
|
23
|
-
const authClient = yield (0, common_1.createGoogleClient)(context.auth);
|
|
24
|
-
const calendar = googleapis_1.google.calendar({ version: 'v3', auth: authClient });
|
|
25
|
-
const response = yield calendar.calendarList.insert({
|
|
26
|
-
requestBody: {
|
|
27
|
-
id: id
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
return response.data;
|
|
31
|
-
});
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=add-calendar-to-calendarlist.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-calendar-to-calendarlist.js","sourceRoot":"","sources":["../../../../src/lib/actions/add-calendar-to-calendarlist.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,2CAAoC;AACpC,sCAAyF;AAE5E,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,2BAAkB;IACxB,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,8BAA8B;IAC3C,WAAW,EAAE,oDAAoD;IACjE,KAAK,EAAE;QACL,EAAE,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACrB,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,gDAAgD;YAC7D,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YAEf,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YAEjC,MAAM,UAAU,GAAG,MAAM,IAAA,2BAAkB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAE1D,MAAM,QAAQ,GAAG,mBAAM,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAC,CAAC,CAAC;YAErE,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC;gBAClD,WAAW,EAAE;oBACX,EAAE,EAAE,EAAE;iBACP;aACF,CAAC,CAAA;YAEF,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare const createEvent: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
-
}>)[], {
|
|
5
|
-
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
-
}>)[]>;
|
|
9
|
-
title: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
-
start_date_time: import("@activepieces/pieces-framework").DateTimeProperty<true>;
|
|
11
|
-
end_date_time: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
12
|
-
location: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
13
|
-
description: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
14
|
-
colorId: import("@activepieces/pieces-framework").DropdownProperty<string, false, (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
|
-
attendees: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
19
|
-
guests_can_modify: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
20
|
-
guests_can_invite_others: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
21
|
-
guests_can_see_other_guests: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
22
|
-
send_notifications: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
23
|
-
create_meet_link: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
24
|
-
}>;
|
|
25
|
-
//# sourceMappingURL=create-event.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-event.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-event.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;EA8JtB,CAAC"}
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createEvent = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const common_1 = require("../common");
|
|
7
|
-
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
8
|
-
const googleapis_1 = require("googleapis");
|
|
9
|
-
const crypto_1 = require("crypto");
|
|
10
|
-
exports.createEvent = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: common_1.googleCalendarAuth,
|
|
12
|
-
name: 'create_google_calendar_event',
|
|
13
|
-
description: 'Add Event',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: { description: 'Creates a Google Calendar event with structured fields (title, start/end times, location, description, attendees, color, guest permissions) and can optionally attach a Google Meet link. Use this when you have explicit event details; choose Create Quick Event instead when working from a single natural-language phrase. Requires a title and start time (end defaults to 30 minutes after start). Not idempotent: each call creates a new event.', idempotent: false },
|
|
16
|
-
displayName: 'Create Event',
|
|
17
|
-
props: {
|
|
18
|
-
calendar_id: common_1.googleCalendarCommon.calendarDropdown('writer'),
|
|
19
|
-
title: pieces_framework_1.Property.ShortText({
|
|
20
|
-
displayName: 'Title of the event',
|
|
21
|
-
required: true,
|
|
22
|
-
}),
|
|
23
|
-
start_date_time: pieces_framework_1.Property.DateTime({
|
|
24
|
-
displayName: 'Start date time of the event',
|
|
25
|
-
required: true,
|
|
26
|
-
}),
|
|
27
|
-
end_date_time: pieces_framework_1.Property.DateTime({
|
|
28
|
-
displayName: 'End date time of the event',
|
|
29
|
-
description: "By default it'll be 30 min post start time",
|
|
30
|
-
required: false,
|
|
31
|
-
}),
|
|
32
|
-
location: pieces_framework_1.Property.ShortText({
|
|
33
|
-
displayName: 'Location',
|
|
34
|
-
required: false,
|
|
35
|
-
}),
|
|
36
|
-
/*attachment: Property.ShortText({
|
|
37
|
-
displayName: 'Attachment',
|
|
38
|
-
description: 'URL of the file to be attached',
|
|
39
|
-
required: false,
|
|
40
|
-
}),*/
|
|
41
|
-
description: pieces_framework_1.Property.LongText({
|
|
42
|
-
displayName: 'Description',
|
|
43
|
-
description: 'Description of the event. You can use HTML tags here.',
|
|
44
|
-
required: false,
|
|
45
|
-
}),
|
|
46
|
-
colorId: common_1.googleCalendarCommon.colorId,
|
|
47
|
-
attendees: pieces_framework_1.Property.Array({
|
|
48
|
-
displayName: 'Attendees',
|
|
49
|
-
description: 'Emails of the attendees (guests)',
|
|
50
|
-
required: false,
|
|
51
|
-
}),
|
|
52
|
-
guests_can_modify: pieces_framework_1.Property.Checkbox({
|
|
53
|
-
displayName: 'Guests can modify',
|
|
54
|
-
defaultValue: false,
|
|
55
|
-
required: false,
|
|
56
|
-
}),
|
|
57
|
-
guests_can_invite_others: pieces_framework_1.Property.Checkbox({
|
|
58
|
-
displayName: 'Guests can invite others',
|
|
59
|
-
defaultValue: false,
|
|
60
|
-
required: false,
|
|
61
|
-
}),
|
|
62
|
-
guests_can_see_other_guests: pieces_framework_1.Property.Checkbox({
|
|
63
|
-
displayName: 'Guests can see other guests',
|
|
64
|
-
defaultValue: false,
|
|
65
|
-
required: false,
|
|
66
|
-
}),
|
|
67
|
-
send_notifications: pieces_framework_1.Property.StaticDropdown({
|
|
68
|
-
displayName: 'Send Notifications',
|
|
69
|
-
defaultValue: 'all',
|
|
70
|
-
options: {
|
|
71
|
-
options: [
|
|
72
|
-
{ label: 'Yes, to everyone', value: 'all' },
|
|
73
|
-
{
|
|
74
|
-
label: 'To non-Google Calendar guests only',
|
|
75
|
-
value: 'externalOnly',
|
|
76
|
-
},
|
|
77
|
-
{ label: 'To no one', value: 'none' },
|
|
78
|
-
],
|
|
79
|
-
},
|
|
80
|
-
required: true,
|
|
81
|
-
}),
|
|
82
|
-
create_meet_link: pieces_framework_1.Property.Checkbox({
|
|
83
|
-
displayName: 'Create Google Meet Link',
|
|
84
|
-
description: 'Automatically create a Google Meet video conference link for this event',
|
|
85
|
-
defaultValue: false,
|
|
86
|
-
required: false,
|
|
87
|
-
}),
|
|
88
|
-
},
|
|
89
|
-
run(configValue) {
|
|
90
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
91
|
-
// docs: https://developers.google.com/calendar/api/v3/reference/events/insert
|
|
92
|
-
const { calendar_id: calendarId, title: summary, start_date_time, end_date_time, location, description, colorId, guests_can_modify: guestsCanModify, guests_can_invite_others: guestsCanInviteOthers, guests_can_see_other_guests: guestsCanSeeOtherGuests, create_meet_link: createMeetLink, } = configValue.propsValue;
|
|
93
|
-
const start = {
|
|
94
|
-
dateTime: (0, dayjs_1.default)(start_date_time).format('YYYY-MM-DDTHH:mm:ss.sssZ'),
|
|
95
|
-
};
|
|
96
|
-
const endTime = end_date_time
|
|
97
|
-
? end_date_time
|
|
98
|
-
: (0, dayjs_1.default)(start_date_time).add(30, 'm');
|
|
99
|
-
const end = {
|
|
100
|
-
dateTime: (0, dayjs_1.default)(endTime).format('YYYY-MM-DDTHH:mm:ss.sssZ'),
|
|
101
|
-
};
|
|
102
|
-
/*const attachment = {
|
|
103
|
-
fileUrl: configValue.propsValue.attachment,
|
|
104
|
-
};*/
|
|
105
|
-
const attendeesArray = configValue.propsValue.attendees;
|
|
106
|
-
const sendNotifications = configValue.propsValue.send_notifications;
|
|
107
|
-
const attendeesObject = [];
|
|
108
|
-
if (attendeesArray) {
|
|
109
|
-
for (const attendee of attendeesArray) {
|
|
110
|
-
attendeesObject.push({ email: attendee });
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
const authClient = yield (0, common_1.createGoogleClient)(configValue.auth);
|
|
114
|
-
const calendar = googleapis_1.google.calendar({ version: 'v3', auth: authClient });
|
|
115
|
-
const requestBody = {
|
|
116
|
-
summary,
|
|
117
|
-
start,
|
|
118
|
-
end,
|
|
119
|
-
colorId,
|
|
120
|
-
//attachments: configValue.propsValue.attachment ? [attachment] : [],
|
|
121
|
-
location: location !== null && location !== void 0 ? location : '',
|
|
122
|
-
description: description !== null && description !== void 0 ? description : '',
|
|
123
|
-
attendees: attendeesObject,
|
|
124
|
-
guestsCanInviteOthers,
|
|
125
|
-
guestsCanModify,
|
|
126
|
-
guestsCanSeeOtherGuests,
|
|
127
|
-
};
|
|
128
|
-
if (createMeetLink) {
|
|
129
|
-
requestBody.conferenceData = {
|
|
130
|
-
createRequest: {
|
|
131
|
-
conferenceSolutionKey: {
|
|
132
|
-
type: 'hangoutsMeet',
|
|
133
|
-
},
|
|
134
|
-
requestId: (0, crypto_1.randomUUID)(),
|
|
135
|
-
},
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
const response = yield calendar.events.insert({
|
|
139
|
-
calendarId,
|
|
140
|
-
sendUpdates: sendNotifications,
|
|
141
|
-
conferenceDataVersion: createMeetLink ? 1 : 0,
|
|
142
|
-
requestBody,
|
|
143
|
-
});
|
|
144
|
-
return response.data;
|
|
145
|
-
});
|
|
146
|
-
},
|
|
147
|
-
});
|
|
148
|
-
//# sourceMappingURL=create-event.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-event.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-event.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,sCAAyF;AACzF,0DAA0B;AAC1B,2CAAoC;AACpC,mCAAoC;AAEvB,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,2BAAkB;IACxB,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,WAAW;IACxB,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,ybAAyb,EAAE,UAAU,EAAE,KAAK,EAAE;IACze,WAAW,EAAE,cAA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AAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC7C,WAAW;aACZ,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const createQuickCalendarEvent: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
-
}>)[], {
|
|
5
|
-
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
-
}>)[]>;
|
|
9
|
-
text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
10
|
-
send_updates: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true> | import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
11
|
-
}>;
|
|
12
|
-
//# sourceMappingURL=create-quick-event.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-quick-event.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-quick-event.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,wBAAwB;;;;;;;;;;EA0DnC,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createQuickCalendarEvent = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
exports.createQuickCalendarEvent = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: common_1.googleCalendarAuth,
|
|
10
|
-
name: 'create_quick_event',
|
|
11
|
-
description: 'Add Quick Calendar Event',
|
|
12
|
-
audience: 'both',
|
|
13
|
-
aiMetadata: { description: 'Creates a calendar event from a single natural-language phrase (e.g. "Lunch with Sam tomorrow at 1pm") via Google\'s quickAdd parsing, letting Google infer the time, title, and date. Use when you have free-form text rather than structured fields; prefer Create Event when you have explicit start/end times or attendees. Not idempotent: each call creates a new event.', idempotent: false },
|
|
14
|
-
displayName: 'Create Quick Event',
|
|
15
|
-
props: {
|
|
16
|
-
calendar_id: common_1.googleCalendarCommon.calendarDropdown('writer'),
|
|
17
|
-
text: pieces_framework_1.Property.LongText({
|
|
18
|
-
displayName: 'Summary',
|
|
19
|
-
description: 'The text describing the event to be created',
|
|
20
|
-
required: true,
|
|
21
|
-
}),
|
|
22
|
-
send_updates: pieces_framework_1.Property.StaticDropdown({
|
|
23
|
-
displayName: 'Send Updates',
|
|
24
|
-
description: 'Guests who should receive notifications about the creation of the new event.',
|
|
25
|
-
required: false,
|
|
26
|
-
options: {
|
|
27
|
-
disabled: false,
|
|
28
|
-
options: [
|
|
29
|
-
{
|
|
30
|
-
label: 'All',
|
|
31
|
-
value: 'all',
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
label: 'External Only',
|
|
35
|
-
value: 'externalOnly',
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
label: 'none',
|
|
39
|
-
value: 'none',
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
},
|
|
43
|
-
}),
|
|
44
|
-
},
|
|
45
|
-
run(configValue) {
|
|
46
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
// docs: https://developers.google.com/calendar/api/v3/reference/events/quickAdd
|
|
48
|
-
const calendarId = configValue.propsValue['calendar_id'];
|
|
49
|
-
const url = `${common_1.googleCalendarCommon.baseUrl}/calendars/${calendarId}/events/quickAdd`;
|
|
50
|
-
const qParams = {
|
|
51
|
-
text: configValue.propsValue['text'],
|
|
52
|
-
sendUpdates: configValue.propsValue['send_updates'] || 'none',
|
|
53
|
-
};
|
|
54
|
-
const request = {
|
|
55
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
56
|
-
url,
|
|
57
|
-
body: {},
|
|
58
|
-
authentication: {
|
|
59
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
60
|
-
token: yield (0, common_1.getAccessToken)(configValue.auth),
|
|
61
|
-
},
|
|
62
|
-
queryParams: qParams,
|
|
63
|
-
};
|
|
64
|
-
return yield pieces_common_1.httpClient.sendRequest(request);
|
|
65
|
-
});
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=create-quick-event.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-quick-event.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-quick-event.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAKqC;AACrC,sCAAqF;AAExE,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,2BAAkB;IACxB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,0BAA0B;IACvC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,gXAAgX,EAAE,UAAU,EAAE,KAAK,EAAE;IACha,WAAW,EAAE,oBAAoB;IACjC,KAAK,EAAE;QACL,WAAW,EAAE,6BAAoB,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QAC5D,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,cAAc,CAAS;YAC5C,WAAW,EAAE,cAAc;YAC3B,WAAW,EACT,8EAA8E;YAChF,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,KAAK;wBACZ,KAAK,EAAE,KAAK;qBACb;oBACD;wBACE,KAAK,EAAE,eAAe;wBACtB,KAAK,EAAE,cAAc;qBACtB;oBACD;wBACE,KAAK,EAAE,MAAM;wBACb,KAAK,EAAE,MAAM;qBACd;iBACF;aACF;SACF,CAAC;KACH;IACK,GAAG,CAAC,WAAW;;YACnB,gFAAgF;YAChF,MAAM,UAAU,GAAG,WAAW,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;YACzD,MAAM,GAAG,GAAG,GAAG,6BAAoB,CAAC,OAAO,cAAc,UAAU,kBAAkB,CAAC;YACtF,MAAM,OAAO,GAA2B;gBACtC,IAAI,EAAE,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC;gBACpC,WAAW,EAAE,WAAW,CAAC,UAAU,CAAC,cAAc,CAAC,IAAI,MAAM;aAC9D,CAAC;YACF,MAAM,OAAO,GAAyC;gBACpD,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG;gBACH,IAAI,EAAE,EAAE;gBACR,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK,EAAE,MAAM,IAAA,uBAAc,EAAC,WAAW,CAAC,IAAI,CAAC;iBAC9C;gBACD,WAAW,EAAE,OAAO;aACrB,CAAC;YACF,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const deleteEventAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
-
}>)[], {
|
|
5
|
-
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
-
}>)[]>;
|
|
9
|
-
eventId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=delete-event.action.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-event.action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/delete-event.action.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB;;;;;;;;;EA6B5B,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deleteEventAction = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const googleapis_1 = require("googleapis");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
exports.deleteEventAction = (0, pieces_framework_1.createAction)({
|
|
9
|
-
displayName: 'Delete Event',
|
|
10
|
-
auth: common_1.googleCalendarAuth,
|
|
11
|
-
name: 'delete_event',
|
|
12
|
-
description: 'Deletes an event from Google Calendar.',
|
|
13
|
-
audience: 'both',
|
|
14
|
-
aiMetadata: { description: 'Permanently removes an event from a Google Calendar, identified by calendar and event ID. Use to cancel or delete an existing event. Requires the event ID and cannot be undone. Idempotent: once the event is deleted, repeating the call leaves it absent (a second call may report it as already gone).', idempotent: true },
|
|
15
|
-
props: {
|
|
16
|
-
calendar_id: common_1.googleCalendarCommon.calendarDropdown('writer'),
|
|
17
|
-
eventId: pieces_framework_1.Property.ShortText({
|
|
18
|
-
displayName: 'Event ID',
|
|
19
|
-
required: true,
|
|
20
|
-
}),
|
|
21
|
-
},
|
|
22
|
-
run(context) {
|
|
23
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
const authClient = yield (0, common_1.createGoogleClient)(context.auth);
|
|
25
|
-
const calendarId = context.propsValue.calendar_id;
|
|
26
|
-
const eventId = context.propsValue.eventId;
|
|
27
|
-
const calendar = googleapis_1.google.calendar({ version: 'v3', auth: authClient });
|
|
28
|
-
const response = yield calendar.events.delete({
|
|
29
|
-
calendarId,
|
|
30
|
-
eventId,
|
|
31
|
-
});
|
|
32
|
-
return response.data;
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=delete-event.action.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-event.action.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-event.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,2CAAoC;AACpC,sCAAyF;AAE5E,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,WAAW,EAAE,cAAc;IAC3B,IAAI,EAAE,2BAAkB;IACxB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,wCAAwC;IACrD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,4SAA4S,EAAE,UAAU,EAAE,IAAI,EAAE;IAC3V,KAAK,EAAE;QACL,WAAW,EAAE,6BAAoB,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QAC5D,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,UAAU;YACvB,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,UAAU,GAAG,MAAM,IAAA,2BAAkB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAE1D,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC;YAClD,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;YAE3C,MAAM,QAAQ,GAAG,mBAAM,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;YAEtE,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;gBAC5C,UAAU;gBACV,OAAO;aACR,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const findFreeBusy: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
-
}>)[], {
|
|
5
|
-
calendar_ids: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
-
}>)[]>;
|
|
9
|
-
start_date: import("@activepieces/pieces-framework").DateTimeProperty<true>;
|
|
10
|
-
end_date: import("@activepieces/pieces-framework").DateTimeProperty<true>;
|
|
11
|
-
}>;
|
|
12
|
-
//# sourceMappingURL=find-busy-free-periods.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find-busy-free-periods.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-busy-free-periods.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,YAAY;;;;;;;;;;EAyEvB,CAAC"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findFreeBusy = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const common_1 = require("../common");
|
|
8
|
-
const helper_1 = require("../common/helper");
|
|
9
|
-
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
10
|
-
exports.findFreeBusy = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: common_1.googleCalendarAuth,
|
|
12
|
-
name: 'google_calendar_find_busy_free_periods',
|
|
13
|
-
displayName: 'Find Busy/Free Periods in Calendar',
|
|
14
|
-
description: 'Finds free/busy calendar details from Google Calendar.',
|
|
15
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: { description: 'Queries one or more calendars for their busy time blocks within a given start/end window, without exposing event details. Use to check availability or find open slots before scheduling a meeting. Requires the calendars to check and a time range. Read-only and idempotent.', idempotent: true },
|
|
17
|
-
props: {
|
|
18
|
-
calendar_ids: pieces_framework_1.Property.MultiSelectDropdown({
|
|
19
|
-
auth: common_1.googleCalendarAuth,
|
|
20
|
-
displayName: 'Calendars',
|
|
21
|
-
description: 'Select the calendars to check for busy periods.',
|
|
22
|
-
required: true,
|
|
23
|
-
refreshers: [],
|
|
24
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
25
|
-
if (!auth) {
|
|
26
|
-
return {
|
|
27
|
-
disabled: true,
|
|
28
|
-
placeholder: 'Connect your account first',
|
|
29
|
-
options: [],
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const authProp = auth;
|
|
33
|
-
const calendars = yield (0, helper_1.getCalendars)(authProp);
|
|
34
|
-
return {
|
|
35
|
-
disabled: false,
|
|
36
|
-
options: calendars.map((calendar) => {
|
|
37
|
-
return {
|
|
38
|
-
label: calendar.summary,
|
|
39
|
-
value: calendar.id,
|
|
40
|
-
};
|
|
41
|
-
}),
|
|
42
|
-
};
|
|
43
|
-
}),
|
|
44
|
-
}),
|
|
45
|
-
start_date: pieces_framework_1.Property.DateTime({
|
|
46
|
-
displayName: 'Start Time',
|
|
47
|
-
description: 'The start of the time range to check.',
|
|
48
|
-
required: true,
|
|
49
|
-
}),
|
|
50
|
-
end_date: pieces_framework_1.Property.DateTime({
|
|
51
|
-
displayName: 'End Time',
|
|
52
|
-
description: 'The end of the time range to check.',
|
|
53
|
-
required: true,
|
|
54
|
-
}),
|
|
55
|
-
},
|
|
56
|
-
run(context) {
|
|
57
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
const { calendar_ids, start_date, end_date } = context.propsValue;
|
|
59
|
-
const access_token = yield (0, common_1.getAccessToken)(context.auth);
|
|
60
|
-
const requestBody = {
|
|
61
|
-
timeMin: (0, dayjs_1.default)(start_date).toISOString(),
|
|
62
|
-
timeMax: (0, dayjs_1.default)(end_date).toISOString(),
|
|
63
|
-
items: calendar_ids.map((id) => ({ id })),
|
|
64
|
-
};
|
|
65
|
-
const request = {
|
|
66
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
67
|
-
url: `${common_1.googleCalendarCommon.baseUrl}/freeBusy`,
|
|
68
|
-
body: requestBody,
|
|
69
|
-
authentication: {
|
|
70
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
71
|
-
token: access_token,
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
75
|
-
return response.body;
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
//# sourceMappingURL=find-busy-free-periods.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find-busy-free-periods.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-busy-free-periods.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAsG;AACtG,sCAA8G;AAC9G,6CAAgD;AAChD,0DAA0B;AAqBb,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,2BAAkB;IACxB,IAAI,EAAE,wCAAwC;IAC9C,WAAW,EAAE,oCAAoC;IACjD,WAAW,EAAE,wDAAwD;IACrE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,iRAAiR,EAAE,UAAU,EAAE,IAAI,EAAE;IAChU,KAAK,EAAE;QACL,YAAY,EAAE,2BAAQ,CAAC,mBAAmB,CAAC;YACzC,IAAI,EAAE,2BAAkB;YACxB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,iDAAiD;YAC9D,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,EAAE;YACd,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI,EAAE,CAAC;oBACV,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,4BAA4B;wBACzC,OAAO,EAAE,EAAE;qBACZ,CAAC;gBACJ,CAAC;gBACD,MAAM,QAAQ,GAAG,IAA+B,CAAC;gBACjD,MAAM,SAAS,GAAG,MAAM,IAAA,qBAAY,EAAC,QAAQ,CAAC,CAAC;gBAC/C,OAAO;oBACL,QAAQ,EAAE,KAAK;oBACf,OAAO,EAAE,SAAS,CAAC,GAAG,CAAC,C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AAO,CAAC,CAAC;YAGzE,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const getEventById: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
|
-
}>)[], {
|
|
5
|
-
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
6
|
-
serviceAccount: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
7
|
-
userEmail: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
-
}>)[]>;
|
|
9
|
-
event_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
10
|
-
max_attendees: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
11
|
-
time_zone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
12
|
-
}>;
|
|
13
|
-
//# sourceMappingURL=get-event-by-id.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-event-by-id.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-event-by-id.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY;;;;;;;;;;;EAkHvB,CAAC"}
|