@activepieces/piece-google-calendar 0.3.1 → 0.4.2
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 -5
- package/src/index.d.ts +2 -2
- package/src/index.js +29 -4
- package/src/index.js.map +1 -1
- package/src/lib/actions/create-event.d.ts +1 -1
- package/src/lib/actions/create-event.js +5 -3
- package/src/lib/actions/create-event.js.map +1 -1
- package/src/lib/actions/create-quick-event.d.ts +1 -1
- package/src/lib/actions/create-quick-event.js +12 -12
- package/src/lib/actions/create-quick-event.js.map +1 -1
- package/src/lib/actions/delete-event.action.d.ts +4 -0
- package/src/lib/actions/delete-event.action.js +37 -0
- package/src/lib/actions/delete-event.action.js.map +1 -0
- package/src/lib/actions/get-events.d.ts +6 -0
- package/src/lib/actions/get-events.js +83 -0
- package/src/lib/actions/get-events.js.map +1 -0
- package/src/lib/actions/update-event.ation.d.ts +7 -0
- package/src/lib/actions/update-event.ation.js +61 -0
- package/src/lib/actions/update-event.ation.js.map +1 -0
- package/src/lib/common/helper.d.ts +3 -3
- package/src/lib/common/helper.js +1 -1
- package/src/lib/common/helper.js.map +1 -1
- package/src/lib/common/index.js.map +1 -1
- package/src/lib/common/types.js.map +1 -1
- package/src/lib/triggers/calendar-event.d.ts +2 -2
- package/src/lib/triggers/calendar-event.js +33 -17
- package/src/lib/triggers/calendar-event.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-google-calendar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@sinclair/typebox": "0.26.8",
|
|
6
|
-
"axios": "^1.6.
|
|
6
|
+
"axios": "^1.6.3",
|
|
7
7
|
"dayjs": "1.11.9",
|
|
8
|
+
"googleapis": "129.0.0",
|
|
9
|
+
"googleapis-common": "7.0.1",
|
|
8
10
|
"is-base64": "1.1.0",
|
|
9
11
|
"lodash": "4.17.21",
|
|
10
12
|
"nanoid": "3.3.6",
|
|
11
13
|
"semver": "7.5.4",
|
|
12
|
-
"@activepieces/pieces-common": "0.2.
|
|
13
|
-
"@activepieces/pieces-framework": "0.7.
|
|
14
|
-
"@activepieces/shared": "0.10.
|
|
14
|
+
"@activepieces/pieces-common": "0.2.8",
|
|
15
|
+
"@activepieces/pieces-framework": "0.7.14",
|
|
16
|
+
"@activepieces/shared": "0.10.66",
|
|
15
17
|
"tslib": "2.6.2"
|
|
16
18
|
},
|
|
17
19
|
"main": "./src/index.js",
|
package/src/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const googleCalendarAuth: import("@activepieces/pieces-framework").OAuth2Property<
|
|
2
|
-
export declare const googleCalendar: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").OAuth2Property<
|
|
1
|
+
export declare const googleCalendarAuth: import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>;
|
|
2
|
+
export declare const googleCalendar: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
|
package/src/index.js
CHANGED
|
@@ -1,25 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.googleCalendar = exports.googleCalendarAuth = void 0;
|
|
4
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
4
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const create_event_1 = require("./lib/actions/create-event");
|
|
5
7
|
const create_quick_event_1 = require("./lib/actions/create-quick-event");
|
|
8
|
+
const delete_event_action_1 = require("./lib/actions/delete-event.action");
|
|
9
|
+
const get_events_1 = require("./lib/actions/get-events");
|
|
10
|
+
const update_event_ation_1 = require("./lib/actions/update-event.ation");
|
|
11
|
+
const common_1 = require("./lib/common");
|
|
6
12
|
const calendar_event_1 = require("./lib/triggers/calendar-event");
|
|
7
|
-
const create_event_1 = require("./lib/actions/create-event");
|
|
8
13
|
exports.googleCalendarAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
9
14
|
description: '',
|
|
10
15
|
authUrl: 'https://accounts.google.com/o/oauth2/auth',
|
|
11
16
|
tokenUrl: 'https://oauth2.googleapis.com/token',
|
|
12
17
|
required: true,
|
|
13
18
|
pkce: true,
|
|
14
|
-
scope: [
|
|
19
|
+
scope: [
|
|
20
|
+
'https://www.googleapis.com/auth/calendar.events',
|
|
21
|
+
'https://www.googleapis.com/auth/calendar.readonly',
|
|
22
|
+
],
|
|
15
23
|
});
|
|
16
24
|
exports.googleCalendar = (0, pieces_framework_1.createPiece)({
|
|
17
25
|
minimumSupportedRelease: '0.5.0',
|
|
18
26
|
logoUrl: 'https://cdn.activepieces.com/pieces/google-calendar.png',
|
|
19
27
|
displayName: 'Google Calendar',
|
|
20
|
-
authors: ['osamahaikal', 'bibhuty-did-this', 'MoShizzle'],
|
|
28
|
+
authors: ['osamahaikal', 'bibhuty-did-this', 'MoShizzle', 'PFernandez98'],
|
|
21
29
|
auth: exports.googleCalendarAuth,
|
|
22
|
-
actions: [
|
|
30
|
+
actions: [
|
|
31
|
+
create_quick_event_1.createQuickCalendarEvent,
|
|
32
|
+
create_event_1.createEvent,
|
|
33
|
+
get_events_1.getEvents,
|
|
34
|
+
update_event_ation_1.updateEventAction,
|
|
35
|
+
delete_event_action_1.deleteEventAction,
|
|
36
|
+
(0, pieces_common_1.createCustomApiCallAction)({
|
|
37
|
+
auth: exports.googleCalendarAuth,
|
|
38
|
+
baseUrl() {
|
|
39
|
+
return common_1.googleCalendarCommon.baseUrl;
|
|
40
|
+
},
|
|
41
|
+
authMapping: (auth) => {
|
|
42
|
+
return {
|
|
43
|
+
Authorization: `Bearer ${auth.access_token}`,
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
],
|
|
23
48
|
triggers: [calendar_event_1.calendarEventChanged],
|
|
24
49
|
});
|
|
25
50
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/google-calendar/src/index.ts"],"names":[],"mappings":";;;AAAA,+DAAwE;AACxE,qEAIwC;AACxC,6DAAyD;AACzD,yEAA4E;AAC5E,2EAAsE;AACtE,yDAAqD;AACrD,yEAAqE;AACrE,yCAAoD;AACpD,kEAAqE;AAExD,QAAA,kBAAkB,GAAG,4BAAS,CAAC,MAAM,CAAC;IACjD,WAAW,EAAE,EAAE;IACf,OAAO,EAAE,2CAA2C;IACpD,QAAQ,EAAE,qCAAqC;IAC/C,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,IAAI;IACV,KAAK,EAAE;QACL,iDAAiD;QACjD,mDAAmD;KACpD;CACF,CAAC,CAAC;AAEU,QAAA,cAAc,GAAG,IAAA,8BAAW,EAAC;IACxC,uBAAuB,EAAE,OAAO;IAChC,OAAO,EAAE,yDAAyD;IAClE,WAAW,EAAE,iBAAiB;IAC9B,OAAO,EAAE,CAAC,aAAa,EAAE,kBAAkB,EAAE,WAAW,EAAE,cAAc,CAAC;IACzE,IAAI,EAAE,0BAAkB;IACxB,OAAO,EAAE;QACP,6CAAwB;QACxB,0BAAW;QACX,sBAAS;QACT,sCAAiB;QACjB,uCAAiB;QACjB,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,0BAAkB;YACxB,OAAO;gBACL,OAAO,6BAAoB,CAAC,OAAO,CAAC;YACtC,CAAC;YACD,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE;gBACpB,OAAO;oBACL,aAAa,EAAE,UAAW,IAA4B,CAAC,YAAY,EAAE;iBACtE,CAAC;YACJ,CAAC;SACF,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,qCAAoB,CAAC;CACjC,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const createEvent: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<
|
|
1
|
+
export declare const createEvent: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
2
|
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
3
|
title: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
4
|
start_date_time: import("@activepieces/pieces-framework").DateTimeProperty<true>;
|
|
@@ -24,9 +24,9 @@ exports.createEvent = (0, pieces_framework_1.createAction)({
|
|
|
24
24
|
}),
|
|
25
25
|
end_date_time: pieces_framework_1.Property.DateTime({
|
|
26
26
|
displayName: 'End date time of the event',
|
|
27
|
-
description:
|
|
27
|
+
description: "By default it'll be 30 min post start time",
|
|
28
28
|
required: false,
|
|
29
|
-
})
|
|
29
|
+
}),
|
|
30
30
|
},
|
|
31
31
|
run(configValue) {
|
|
32
32
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -36,7 +36,9 @@ exports.createEvent = (0, pieces_framework_1.createAction)({
|
|
|
36
36
|
const start = {
|
|
37
37
|
dateTime: (0, dayjs_1.default)(start_date_time).format('YYYY-MM-DDTHH:mm:ss.sssZ'),
|
|
38
38
|
};
|
|
39
|
-
const endTime = end_date_time
|
|
39
|
+
const endTime = end_date_time
|
|
40
|
+
? end_date_time
|
|
41
|
+
: (0, dayjs_1.default)(start_date_time).add(30, 'm');
|
|
40
42
|
const end = {
|
|
41
43
|
dateTime: (0, dayjs_1.default)(endTime).format('YYYY-MM-DDTHH:mm:ss.sssZ'),
|
|
42
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-event.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"create-event.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-calendar/src/lib/actions/create-event.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAKqC;AACrC,sCAAiD;AACjD,0DAA0B;AAC1B,8BAA4C;AAE/B,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,sBAAkB;IACxB,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,cAAc;IAC3B,KAAK,EAAE;QACL,WAAW,EAAE,6BAAoB,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QAC5D,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACjC,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,aAAa,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC/B,WAAW,EAAE,4BAA4B;YACzC,WAAW,EAAE,4CAA4C;YACzD,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,WAAW;;YACnB,8EAA8E;YAC9E,MAAM,EACJ,WAAW,EAAE,UAAU,EACvB,KAAK,EAAE,OAAO,EACd,eAAe,EACf,aAAa,GACd,GAAG,WAAW,CAAC,UAAU,CAAC;YAC3B,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC;YACjD,MAAM,KAAK,GAAG;gBACZ,QAAQ,EAAE,IAAA,eAAK,EAAC,eAAe,CAAC,CAAC,MAAM,CAAC,0BAA0B,CAAC;aACpE,CAAC;YACF,MAAM,OAAO,GAAG,aAAa;gBAC3B,CAAC,CAAC,aAAa;gBACf,CAAC,CAAC,IAAA,eAAK,EAAC,eAAe,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YACxC,MAAM,GAAG,GAAG;gBACV,QAAQ,EAAE,IAAA,eAAK,EAAC,OAAO,CAAC,CAAC,MAAM,CAAC,0BAA0B,CAAC;aAC5D,CAAC;YACF,MAAM,GAAG,GAAG,GAAG,6BAAoB,CAAC,OAAO,cAAc,UAAU,SAAS,CAAC;YAC7E,MAAM,OAAO,GAAyC;gBACpD,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG;gBACH,IAAI,EAAE;oBACJ,OAAO;oBACP,KAAK;oBACL,GAAG;iBACJ;gBACD,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK;iBACN;aACF,CAAC;YACF,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const createQuickCalendarEvent: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<
|
|
1
|
+
export declare const createQuickCalendarEvent: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
2
|
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
3
|
text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
4
4
|
send_updates: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false> | import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
@@ -19,26 +19,26 @@ exports.createQuickCalendarEvent = (0, pieces_framework_1.createAction)({
|
|
|
19
19
|
required: true,
|
|
20
20
|
}),
|
|
21
21
|
send_updates: pieces_framework_1.Property.StaticDropdown({
|
|
22
|
-
displayName:
|
|
23
|
-
description:
|
|
22
|
+
displayName: 'Send Updates',
|
|
23
|
+
description: 'Guests who should receive notifications about the creation of the new event.',
|
|
24
24
|
required: false,
|
|
25
25
|
options: {
|
|
26
26
|
disabled: false,
|
|
27
27
|
options: [
|
|
28
28
|
{
|
|
29
|
-
label:
|
|
30
|
-
value:
|
|
29
|
+
label: 'All',
|
|
30
|
+
value: 'all',
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
label:
|
|
34
|
-
value:
|
|
33
|
+
label: 'External Only',
|
|
34
|
+
value: 'externalOnly',
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
label:
|
|
38
|
-
value:
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}
|
|
37
|
+
label: 'none',
|
|
38
|
+
value: 'none',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
42
|
}),
|
|
43
43
|
},
|
|
44
44
|
run(configValue) {
|
|
@@ -48,7 +48,7 @@ exports.createQuickCalendarEvent = (0, pieces_framework_1.createAction)({
|
|
|
48
48
|
const url = `${common_1.googleCalendarCommon.baseUrl}/calendars/${calendarId}/events/quickAdd`;
|
|
49
49
|
const qParams = {
|
|
50
50
|
text: configValue.propsValue['text'],
|
|
51
|
-
sendUpdates: configValue.propsValue['send_updates'] ||
|
|
51
|
+
sendUpdates: configValue.propsValue['send_updates'] || 'none',
|
|
52
52
|
};
|
|
53
53
|
const request = {
|
|
54
54
|
method: pieces_common_1.HttpMethod.POST,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-quick-event.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"create-quick-event.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-calendar/src/lib/actions/create-quick-event.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAKqC;AACrC,sCAAiD;AACjD,8BAA4C;AAE/B,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,sBAAkB;IACxB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,o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WAAW,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const deleteEventAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
|
+
eventId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
}>;
|
|
@@ -0,0 +1,37 @@
|
|
|
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 googleapis_common_1 = require("googleapis-common");
|
|
8
|
+
const index_1 = require("../../index");
|
|
9
|
+
const common_1 = require("../common");
|
|
10
|
+
exports.deleteEventAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
displayName: 'Delete Event',
|
|
12
|
+
auth: index_1.googleCalendarAuth,
|
|
13
|
+
name: 'delete_event',
|
|
14
|
+
description: 'Deletes an event from Google Calendar.',
|
|
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 = new googleapis_common_1.OAuth2Client();
|
|
25
|
+
authClient.setCredentials(context.auth);
|
|
26
|
+
const calendarId = context.propsValue.calendar_id;
|
|
27
|
+
const eventId = context.propsValue.eventId;
|
|
28
|
+
const calendar = googleapis_1.google.calendar({ version: 'v3', auth: authClient });
|
|
29
|
+
const response = yield calendar.events.delete({
|
|
30
|
+
calendarId,
|
|
31
|
+
eventId,
|
|
32
|
+
});
|
|
33
|
+
return response.data;
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=delete-event.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-event.action.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-calendar/src/lib/actions/delete-event.action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,2CAAoC;AACpC,yDAAiD;AACjD,uCAAiD;AACjD,sCAAiD;AAEpC,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,WAAW,EAAE,cAAc;IAC3B,IAAI,EAAE,0BAAkB;IACxB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,wCAAwC;IACrD,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,IAAI,gCAAY,EAAE,CAAC;YACtC,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAExC,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"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const getEvents: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
|
+
event_types: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, true>;
|
|
4
|
+
start_date: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
5
|
+
end_date: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEvents = 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 dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
9
|
+
const __1 = require("../../");
|
|
10
|
+
exports.getEvents = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: __1.googleCalendarAuth,
|
|
12
|
+
name: 'google_calendar_get_events',
|
|
13
|
+
description: 'Get Events',
|
|
14
|
+
displayName: 'Get all Events',
|
|
15
|
+
props: {
|
|
16
|
+
calendar_id: common_1.googleCalendarCommon.calendarDropdown('writer'),
|
|
17
|
+
event_types: pieces_framework_1.Property.StaticMultiSelectDropdown({
|
|
18
|
+
displayName: 'Event types',
|
|
19
|
+
description: 'Select event types',
|
|
20
|
+
required: true,
|
|
21
|
+
defaultValue: ['default', 'focusTime', 'outOfOffice'],
|
|
22
|
+
options: {
|
|
23
|
+
options: [
|
|
24
|
+
{
|
|
25
|
+
label: 'Default',
|
|
26
|
+
value: 'default',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: 'Out Of Office',
|
|
30
|
+
value: 'outOfOffice',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: 'Focus Time',
|
|
34
|
+
value: 'focusTime',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: 'Working Location',
|
|
38
|
+
value: 'workingLocation',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
start_date: pieces_framework_1.Property.DateTime({
|
|
44
|
+
displayName: 'Date from',
|
|
45
|
+
required: false,
|
|
46
|
+
}),
|
|
47
|
+
end_date: pieces_framework_1.Property.DateTime({
|
|
48
|
+
displayName: 'Date to',
|
|
49
|
+
required: false,
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
52
|
+
run(configValue) {
|
|
53
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
// docs: https://developers.google.com/calendar/api/v3/reference/events/list
|
|
55
|
+
const { calendar_id: calendarId, start_date, end_date, event_types, } = configValue.propsValue;
|
|
56
|
+
const { access_token: token } = configValue.auth;
|
|
57
|
+
const queryParams = { showDeleted: 'false' };
|
|
58
|
+
let url = `${common_1.googleCalendarCommon.baseUrl}/calendars/${calendarId}/events`;
|
|
59
|
+
// date range
|
|
60
|
+
if (start_date) {
|
|
61
|
+
queryParams['timeMin'] = (0, dayjs_1.default)(start_date).format('YYYY-MM-DDTHH:mm:ss.sssZ');
|
|
62
|
+
}
|
|
63
|
+
if (start_date && end_date) {
|
|
64
|
+
queryParams['timeMax'] = (0, dayjs_1.default)(end_date).format('YYYY-MM-DDTHH:mm:ss.sssZ');
|
|
65
|
+
}
|
|
66
|
+
// filter by event type
|
|
67
|
+
if (event_types.length > 0) {
|
|
68
|
+
url += `?${event_types.map((type) => `eventTypes=${type}`).join('&')}`;
|
|
69
|
+
}
|
|
70
|
+
const request = {
|
|
71
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
72
|
+
url,
|
|
73
|
+
queryParams,
|
|
74
|
+
authentication: {
|
|
75
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
76
|
+
token,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
return yield pieces_common_1.httpClient.sendRequest(request);
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
//# sourceMappingURL=get-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-events.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-calendar/src/lib/actions/get-events.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAKqC;AACrC,sCAAiD;AACjD,0DAA0B;AAC1B,8BAA4C;AAE/B,QAAA,SAAS,GAAG,IAAA,+BAAY,EAAC;IACpC,IAAI,EAAE,sBAAkB;IACxB,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,gBAAgB;IAC7B,KAAK,EAAE;QACL,WAAW,EAAE,6BAAoB,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QAC5D,WAAW,EAAE,2BAAQ,CAAC,yBAAyB,CAAC;YAC9C,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,aAAa,CAAC;YACrD,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,SAAS;wBAChB,KAAK,EAAE,SAAS;qBACjB;oBACD;wBACE,KAAK,EAAE,eAAe;wBACtB,KAAK,EAAE,aAAa;qBACrB;oBACD;wBACE,KAAK,EAAE,YAAY;wBACnB,KAAK,EAAE,WAAW;qBACnB;oBACD;wBACE,KAAK,EAAE,kBAA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WAAW;gBACX,cAAc,EAAE;oBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK;iBACN;aACF,CAAC;YACF,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const updateEventAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
|
+
eventId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
+
start_date_time: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
6
|
+
end_date_time: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateEventAction = 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 googleapis_common_1 = require("googleapis-common");
|
|
8
|
+
const index_1 = require("../../index");
|
|
9
|
+
const common_1 = require("../common");
|
|
10
|
+
exports.updateEventAction = (0, pieces_framework_1.createAction)({
|
|
11
|
+
displayName: 'Update Event',
|
|
12
|
+
auth: index_1.googleCalendarAuth,
|
|
13
|
+
name: 'update_event',
|
|
14
|
+
description: 'Updates an event in Google Calendar.',
|
|
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
|
+
title: pieces_framework_1.Property.ShortText({
|
|
22
|
+
displayName: 'Title of the event',
|
|
23
|
+
required: false,
|
|
24
|
+
}),
|
|
25
|
+
start_date_time: pieces_framework_1.Property.DateTime({
|
|
26
|
+
displayName: 'Start date time of the event',
|
|
27
|
+
required: false,
|
|
28
|
+
}),
|
|
29
|
+
end_date_time: pieces_framework_1.Property.DateTime({
|
|
30
|
+
displayName: 'End date time of the event',
|
|
31
|
+
required: false,
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
run(context) {
|
|
35
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const authClient = new googleapis_common_1.OAuth2Client();
|
|
37
|
+
authClient.setCredentials(context.auth);
|
|
38
|
+
const calendarId = context.propsValue.calendar_id;
|
|
39
|
+
const eventId = context.propsValue.eventId;
|
|
40
|
+
const summary = context.propsValue.title;
|
|
41
|
+
const start = context.propsValue.start_date_time;
|
|
42
|
+
const end = context.propsValue.end_date_time;
|
|
43
|
+
const calendar = googleapis_1.google.calendar({ version: 'v3', auth: authClient });
|
|
44
|
+
const response = yield calendar.events.update({
|
|
45
|
+
calendarId,
|
|
46
|
+
eventId,
|
|
47
|
+
requestBody: {
|
|
48
|
+
summary,
|
|
49
|
+
start: {
|
|
50
|
+
dateTime: start,
|
|
51
|
+
},
|
|
52
|
+
end: {
|
|
53
|
+
dateTime: end,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
return response.data;
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=update-event.ation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-event.ation.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-calendar/src/lib/actions/update-event.ation.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,2CAAoC;A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AAE,UAAU,EAAE,CAAC,CAAC;YAEtE,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;gBAC5C,UAAU;gBACV,OAAO;gBACP,WAAW,EAAE;oBACX,OAAO;oBACP,KAAK,EAAE;wBACL,QAAQ,EAAE,KAAK;qBAChB;oBACD,GAAG,EAAE;wBACH,QAAQ,EAAE,GAAG;qBACd;iBACF;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { OAuth2PropertyValue } from
|
|
2
|
-
import { GoogleWatchResponse, CalendarObject, GoogleCalendarEvent } from
|
|
1
|
+
import { OAuth2PropertyValue } from '@activepieces/pieces-framework';
|
|
2
|
+
import { GoogleWatchResponse, CalendarObject, GoogleCalendarEvent } from './types';
|
|
3
3
|
export declare function stopWatchEvent(body: GoogleWatchResponse, authProp: OAuth2PropertyValue): Promise<void>;
|
|
4
4
|
export declare function watchEvent(calendarId: string, webhookUrl: string, authProp: OAuth2PropertyValue): Promise<GoogleWatchResponse>;
|
|
5
|
-
export declare function getCalendars(authProp: OAuth2PropertyValue, minAccessRole?:
|
|
5
|
+
export declare function getCalendars(authProp: OAuth2PropertyValue, minAccessRole?: 'writer'): Promise<CalendarObject[]>;
|
|
6
6
|
export declare function getEvents(calendarId: string, authProp: OAuth2PropertyValue, minUpdated?: Date): Promise<GoogleCalendarEvent[]>;
|
|
7
7
|
export declare function getLatestEvent(calendarId: string, authProp: OAuth2PropertyValue): Promise<GoogleCalendarEvent>;
|
package/src/lib/common/helper.js
CHANGED
|
@@ -48,7 +48,7 @@ function getCalendars(authProp, minAccessRole) {
|
|
|
48
48
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
49
49
|
// docs: https://developers.google.com/calendar/api/v3/reference/calendarList/list
|
|
50
50
|
const queryParams = {
|
|
51
|
-
showDeleted:
|
|
51
|
+
showDeleted: 'false',
|
|
52
52
|
};
|
|
53
53
|
if (minAccessRole) {
|
|
54
54
|
queryParams['minAccessRole'] = minAccessRole;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-calendar/src/lib/common/helper.ts"],"names":[],"mappings":";;;;AACA,+DAKqC;AACrC,mCAAoC;AACpC,wBAAyC;AACzC,mCAOiB;AAEjB,SAAsB,cAAc,CAClC,IAAyB,EACzB,QAA6B;;QAE7B,MAAM,OAAO,GAAgB;YAC3B,MAAM,EAAE,0BAAU,CAAC,IAAI;YACvB,GAAG,EAAE,GAAG,uBAAoB,CAAC,OAAO,gBAAgB;YACpD,IAAI,EAAE;gBACJ,EAAE,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE;gBACZ,UAAU,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU;aAC7B;YACD,cAAc,EAAE;gBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;gBACrC,KAAK,EAAE,QAAQ,CAAC,YAAY;aAC7B;SACF,CAAC;QACF,MAAM,0BAAU,CAAC,WAAW,CAAM,OAAO,CAAC,CAAC;IAC7C,CAAC;CAAA;AAjBD,wCAiBC;AAED,SAAsB,UAAU,CAC9B,UAAkB,EAClB,UAAkB,EAClB,QAA6B;;QAE7B,MAAM,OAAO,GAAgB;YAC3B,MAAM,EAAE,0BAAU,CAAC,IAAI;YACvB,GAAG,EAAE,GAAG,uBAAoB,CAAC,OAAO,cAAc,UAAU,eAAe;YAC3E,IAAI,EAAE;gBACJ,EAAE,EAAE,IAAA,mBAAU,GAAE;gBAChB,IAAI,EAAE,uBAAe,CAAC,OAAO;gBAC7B,OAAO,EAAE,UAAU;aACpB;YACD,cAAc,EAAE;gBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;gBAC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,OAAO,EAAE,SAAS;YAClB,YAAY,EAAE,MAAM;YACpB,WAAW,EAAE,MAAM;SACpB,CAAC;QAEF,MAAM,OAAO,GAAgB;YAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,GAAG,EAAE,GAAG,uBAAoB,CAAC,OAAO,cAAc,UAAU,SAAS;YACrE,WAAW,EAAE,OAAO;YACpB,cAAc,EAAE;gBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;gBACrC,KAAK,EAAE,QAAQ,CAAC,YAAY;aAC7B;SACF,CAAC;QAEF,IAAI,SAAS,GAA0B,EAAE,CAAC;QAC1C,IAAI,SAAS,GAAG,EAAE,CAAC;QACnB,GAAG;YACD,OAAO,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC;YACjC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,0BAAU,CAAC,WAAW,CAChD,OAAO,CACR,CAAC;YACF,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;gBACxB,SAAS,GAAG,CAAC,GAAG,SAAS,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;aAC1C;YACD,SAAS,GAAG,GAAG,CAAC,aAAa,CAAC;SAC/B,QAAQ,SAAS,EAAE;QAEpB,OAAO,SAAS,CAAC;;CAClB;AA1CD,8BA0CC;AAED,SAAsB,cAAc,CAClC,UAAkB,EAClB,QAA6B;;QAE7B,MAAM,SAAS,GAAG,MAAM,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACxD,MAAM,gBAAgB,GAAG,SAAS,CAAC,GAAG,EAAG,CAAC,CAAC,2CAA2C;QACtF,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CAAA;AAPD,wCAOC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-calendar/src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA+E;AAC/E,qCAAwC;AAE3B,QAAA,oBAAoB,GAAG;IAClC,OAAO,EAAE,wCAAwC;IACjD,gBAAgB,EAAE,CAAC,aAAwB,EAAE,EAAE;QAC7C,OAAO,2BAAQ,CAAC,QAAQ,CAAS;YAC/B,WAAW,EAAE,UAAU;YACvB,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,CAAO,EAAE,IAAI,EAAE,EAAE,EAAE;gBAC1B,IAAI,CAAC,IAAI,EAAE;oBACT,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,mCAAmC;wBAChD,OAAO,EAAE,EAAE;qBACZ,CAAC;iBACH;gBACD,MAAM,QAAQ,GAAG,IAA2B,CAAC;gBAC7C,MAAM,SAAS,GAAG,MAAM,IAAA,qBAAY,EAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;gBAC9D,OAAO;oBACL,QAAQ,EAAE,KAAK;oBACf,OAAO,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;wBAClC,OAAO;4BACL,KAAK,EAAE,QAAQ,CAAC,OAAO;4BACvB,KAAK,EAAE,QAAQ,CAAC,EAAE;yBACnB,CAAC;oBACJ,CAAC,CAAC;iBACH,CAAC;YACJ,CAAC,CAAA;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-calendar/src/lib/common/types.ts"],"names":[],"mappings":";;;AAAA,IAAY,eAEX;AAFD,WAAY,eAAe;IACzB,uCAAoB,CAAA;AACtB,CAAC,EAFW,eAAe,+BAAf,eAAe,QAE1B;AAED,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC5B,6DAAuC,CAAA;IACvC,mEAA6C,CAAA;IAC7C,uDAAiC,CAAA;IACjC,6DAAuC,CAAA;IACvC,iDAA2B,CAAA;AAC7B,CAAC,EANW,kBAAkB,kCAAlB,kBAAkB,QAM7B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TriggerStrategy } from
|
|
2
|
-
export declare const calendarEventChanged: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const calendarEventChanged: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
3
3
|
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
4
4
|
}>;
|
|
@@ -20,13 +20,13 @@ const polling = {
|
|
|
20
20
|
yesterday.setDate(now.getDate() - 7);
|
|
21
21
|
minUpdated = yesterday;
|
|
22
22
|
}
|
|
23
|
-
const currentValues = (_a = yield (0, helper_1.getEvents)(calendarId, auth, minUpdated)) !== null && _a !== void 0 ? _a : [];
|
|
23
|
+
const currentValues = (_a = (yield (0, helper_1.getEvents)(calendarId, auth, minUpdated))) !== null && _a !== void 0 ? _a : [];
|
|
24
24
|
const items = currentValues.map((item) => ({
|
|
25
|
-
epochMilliSeconds:
|
|
25
|
+
epochMilliSeconds: new Date(item.updated).getTime(),
|
|
26
26
|
data: item,
|
|
27
27
|
}));
|
|
28
28
|
return items;
|
|
29
|
-
})
|
|
29
|
+
}),
|
|
30
30
|
};
|
|
31
31
|
exports.calendarEventChanged = (0, pieces_framework_1.createTrigger)({
|
|
32
32
|
// docs: https://developers.google.com/calendar/api/guides/push
|
|
@@ -39,21 +39,21 @@ exports.calendarEventChanged = (0, pieces_framework_1.createTrigger)({
|
|
|
39
39
|
},
|
|
40
40
|
sampleData: {
|
|
41
41
|
kind: 'calendar#event',
|
|
42
|
-
etag:
|
|
43
|
-
id:
|
|
42
|
+
etag: '3350849506974000',
|
|
43
|
+
id: '0nsfi5ttd2b17ac76ma2f37oi9',
|
|
44
44
|
htmlLink: 'https://www.google.com/calendar/event?eid=kgjb90uioj4klrgfmdsnjsjvlgkm',
|
|
45
45
|
summary: 'ap-event-test',
|
|
46
|
-
created:
|
|
47
|
-
updated:
|
|
46
|
+
created: '2023-02-03T11:36:36.000Z',
|
|
47
|
+
updated: '2023-02-03T11:45:53.487Z',
|
|
48
48
|
description: 'Sample description',
|
|
49
49
|
status: 'canceled',
|
|
50
50
|
creator: {
|
|
51
51
|
email: 'test@test.com',
|
|
52
|
-
self: true
|
|
52
|
+
self: true,
|
|
53
53
|
},
|
|
54
54
|
organizer: {
|
|
55
55
|
email: 'test@test.com',
|
|
56
|
-
self: true
|
|
56
|
+
self: true,
|
|
57
57
|
},
|
|
58
58
|
start: {
|
|
59
59
|
dateTime: '2023-02-02T22:30:00+03:00',
|
|
@@ -64,44 +64,60 @@ exports.calendarEventChanged = (0, pieces_framework_1.createTrigger)({
|
|
|
64
64
|
timeZone: 'Asia/Amman',
|
|
65
65
|
},
|
|
66
66
|
transparency: 'transparent',
|
|
67
|
-
iCalUID:
|
|
67
|
+
iCalUID: '0nsfi5ttd2b17ac76ma2f37oi9@google.com',
|
|
68
68
|
sequence: 1,
|
|
69
69
|
attendees: [
|
|
70
70
|
{
|
|
71
71
|
email: 'attende@test.com',
|
|
72
|
-
responseStatus: 'needsAction'
|
|
72
|
+
responseStatus: 'needsAction',
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
email: 'test@test.com',
|
|
76
76
|
organizer: true,
|
|
77
77
|
self: true,
|
|
78
|
-
responseStatus: 'accepted'
|
|
78
|
+
responseStatus: 'accepted',
|
|
79
79
|
},
|
|
80
80
|
],
|
|
81
81
|
reminders: {
|
|
82
|
-
useDefault: true
|
|
82
|
+
useDefault: true,
|
|
83
83
|
},
|
|
84
84
|
eventType: 'default',
|
|
85
85
|
},
|
|
86
86
|
type: pieces_framework_2.TriggerStrategy.POLLING,
|
|
87
87
|
test({ store, auth, propsValue }) {
|
|
88
88
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
89
|
-
return yield pieces_common_1.pollingHelper.test(polling, {
|
|
89
|
+
return yield pieces_common_1.pollingHelper.test(polling, {
|
|
90
|
+
store,
|
|
91
|
+
auth,
|
|
92
|
+
propsValue: { calendarId: propsValue.calendar_id },
|
|
93
|
+
});
|
|
90
94
|
});
|
|
91
95
|
},
|
|
92
96
|
onEnable({ store, auth, propsValue }) {
|
|
93
97
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
94
|
-
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
98
|
+
yield pieces_common_1.pollingHelper.onEnable(polling, {
|
|
99
|
+
store,
|
|
100
|
+
auth,
|
|
101
|
+
propsValue: { calendarId: propsValue.calendar_id },
|
|
102
|
+
});
|
|
95
103
|
});
|
|
96
104
|
},
|
|
97
105
|
onDisable({ store, auth, propsValue }) {
|
|
98
106
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
99
|
-
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
107
|
+
yield pieces_common_1.pollingHelper.onDisable(polling, {
|
|
108
|
+
store,
|
|
109
|
+
auth,
|
|
110
|
+
propsValue: { calendarId: propsValue.calendar_id },
|
|
111
|
+
});
|
|
100
112
|
});
|
|
101
113
|
},
|
|
102
114
|
run({ store, auth, propsValue }) {
|
|
103
115
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
104
|
-
return yield pieces_common_1.pollingHelper.poll(polling, {
|
|
116
|
+
return yield pieces_common_1.pollingHelper.poll(polling, {
|
|
117
|
+
store,
|
|
118
|
+
auth,
|
|
119
|
+
propsValue: { calendarId: propsValue.calendar_id },
|
|
120
|
+
});
|
|
105
121
|
});
|
|
106
122
|
},
|
|
107
123
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-event.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"calendar-event.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/google-calendar/src/lib/triggers/calendar-event.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,qEAAiE;AACjE,sCAAiD;AACjD,6CAA6C;AAE7C,8BAA4C;AAC5C,+DAIqC;AAErC,MAAM,OAAO,GAGT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,CAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE;;QACtE,IAAI,UAAU,GAAG,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC5C,kEAAkE;QAClE,IAAI,gBAAgB,KAAK,CAAC,EAAE;YAC1B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;YACvB,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;YAC7B,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;YAErC,UAAU,GAAG,SAAS,CAAC;SACxB;QAED,MAAM,aAAa,GACjB,MAAA,CAAC,MAAM,IAAA,kBAAS,EAAC,UAAW,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,mCAAI,EAAE,CAAC;QACzD,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACzC,iBAAiB,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE;YACnD,IAAI,EAAE,IAAI;SACX,CAAC,CAAC,CAAC;QACJ,OAAO,KAAK,CAAC;IACf,CAAC,CAAA;CACF,CAAC;AAEW,QAAA,oBAAoB,GAAG,IAAA,gCAAa,EAAC;IAChD,+DAA+D;IAC/D,IAAI,EAAE,sBAAkB;IACx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