@activepieces/piece-google-calendar 0.2.4 → 0.3.1
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 +11 -9
- package/src/index.d.ts +2 -1
- package/src/index.js +12 -2
- package/src/index.js.map +1 -1
- package/src/lib/actions/create-event.d.ts +6 -1
- package/src/lib/actions/create-event.js +4 -3
- package/src/lib/actions/create-event.js.map +1 -1
- package/src/lib/actions/create-quick-event.d.ts +5 -1
- package/src/lib/actions/create-quick-event.js +21 -23
- package/src/lib/actions/create-quick-event.js.map +1 -1
- package/src/lib/common/helper.d.ts +1 -0
- package/src/lib/common/helper.js +11 -3
- package/src/lib/common/helper.js.map +1 -1
- package/src/lib/common/index.d.ts +0 -1
- package/src/lib/common/index.js +4 -13
- package/src/lib/common/index.js.map +1 -1
- package/src/lib/common/types.d.ts +2 -2
- package/src/lib/common/types.js +2 -2
- package/src/lib/common/types.js.map +1 -1
- package/src/lib/triggers/calendar-event.d.ts +4 -1
- package/src/lib/triggers/calendar-event.js +37 -25
- 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.3.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@sinclair/typebox": "0.26.8",
|
|
6
|
-
"axios": "1.
|
|
7
|
-
"dayjs": "1.11.
|
|
6
|
+
"axios": "^1.6.0",
|
|
7
|
+
"dayjs": "1.11.9",
|
|
8
|
+
"is-base64": "1.1.0",
|
|
8
9
|
"lodash": "4.17.21",
|
|
9
|
-
"nanoid": "3.3.
|
|
10
|
-
"
|
|
11
|
-
"@activepieces/
|
|
12
|
-
"@activepieces/pieces-
|
|
13
|
-
"
|
|
10
|
+
"nanoid": "3.3.6",
|
|
11
|
+
"semver": "7.5.4",
|
|
12
|
+
"@activepieces/pieces-common": "0.2.5",
|
|
13
|
+
"@activepieces/pieces-framework": "0.7.1",
|
|
14
|
+
"@activepieces/shared": "0.10.22",
|
|
15
|
+
"tslib": "2.6.2"
|
|
14
16
|
},
|
|
15
17
|
"main": "./src/index.js",
|
|
16
|
-
"
|
|
18
|
+
"type": "commonjs"
|
|
17
19
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const googleCalendarAuth: import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>;
|
|
2
|
+
export declare const googleCalendar: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>>;
|
package/src/index.js
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.googleCalendar = void 0;
|
|
3
|
+
exports.googleCalendar = exports.googleCalendarAuth = void 0;
|
|
4
4
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
5
|
const create_quick_event_1 = require("./lib/actions/create-quick-event");
|
|
6
6
|
const calendar_event_1 = require("./lib/triggers/calendar-event");
|
|
7
7
|
const create_event_1 = require("./lib/actions/create-event");
|
|
8
|
+
exports.googleCalendarAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
9
|
+
description: '',
|
|
10
|
+
authUrl: 'https://accounts.google.com/o/oauth2/auth',
|
|
11
|
+
tokenUrl: 'https://oauth2.googleapis.com/token',
|
|
12
|
+
required: true,
|
|
13
|
+
pkce: true,
|
|
14
|
+
scope: ['https://www.googleapis.com/auth/calendar.events', 'https://www.googleapis.com/auth/calendar.readonly'],
|
|
15
|
+
});
|
|
8
16
|
exports.googleCalendar = (0, pieces_framework_1.createPiece)({
|
|
17
|
+
minimumSupportedRelease: '0.5.0',
|
|
9
18
|
logoUrl: 'https://cdn.activepieces.com/pieces/google-calendar.png',
|
|
10
19
|
displayName: 'Google Calendar',
|
|
11
|
-
authors: ['osamahaikal', 'bibhuty-did-this'],
|
|
20
|
+
authors: ['osamahaikal', 'bibhuty-did-this', 'MoShizzle'],
|
|
21
|
+
auth: exports.googleCalendarAuth,
|
|
12
22
|
actions: [create_quick_event_1.createQuickCalendarEvent, create_event_1.createEvent],
|
|
13
23
|
triggers: [calendar_event_1.calendarEventChanged],
|
|
14
24
|
});
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/google-calendar/src/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/pieces/google-calendar/src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AACxE,yEAA4E;AAC5E,kEAAqE;AACrE,6DAAyD;AAE5C,QAAA,kBAAkB,GAAG,4BAAS,CAAC,MAAM,CAAC;IAC/C,WAAW,EAAE,EAAE;IACf,OAAO,EAAE,2CAA2C;IACpD,QAAQ,EAAE,qCAAqC;IAC/C,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,CAAC,iDAAiD,EAAE,mDAAmD,CAAC;CAClH,CAAC,CAAC;AAEU,QAAA,cAAc,GAAG,IAAA,8BAAW,EAAC;IACtC,uBAAuB,EAAE,OAAO;IAChC,OAAO,EAAE,yDAAyD;IAClE,WAAW,EAAE,iBAAiB;IAC9B,OAAO,EAAE,CAAC,aAAa,EAAE,kBAAkB,EAAE,WAAW,CAAC;IACzD,IAAI,EAAE,0BAAkB;IACxB,OAAO,EAAE,CAAC,6CAAwB,EAAE,0BAAW,CAAC;IAChD,QAAQ,EAAE,CAAC,qCAAoB,CAAC;CACnC,CAAC,CAAC"}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export declare const createEvent: import("@activepieces/pieces-framework").
|
|
1
|
+
export declare const createEvent: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
|
+
title: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
|
+
start_date_time: import("@activepieces/pieces-framework").DateTimeProperty<true>;
|
|
5
|
+
end_date_time: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
6
|
+
}>;
|
|
@@ -6,12 +6,13 @@ const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
|
6
6
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
9
|
+
const __1 = require("../../");
|
|
9
10
|
exports.createEvent = (0, pieces_framework_1.createAction)({
|
|
11
|
+
auth: __1.googleCalendarAuth,
|
|
10
12
|
name: 'create_google_calendar_event',
|
|
11
13
|
description: 'Add Event',
|
|
12
14
|
displayName: 'Create Event',
|
|
13
15
|
props: {
|
|
14
|
-
authentication: common_1.googleCalendarCommon.authentication,
|
|
15
16
|
calendar_id: common_1.googleCalendarCommon.calendarDropdown('writer'),
|
|
16
17
|
title: pieces_framework_1.Property.ShortText({
|
|
17
18
|
displayName: 'Title of the event',
|
|
@@ -30,8 +31,8 @@ exports.createEvent = (0, pieces_framework_1.createAction)({
|
|
|
30
31
|
run(configValue) {
|
|
31
32
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
32
33
|
// docs: https://developers.google.com/calendar/api/v3/reference/events/insert
|
|
33
|
-
const {
|
|
34
|
-
const { access_token: token } =
|
|
34
|
+
const { calendar_id: calendarId, title: summary, start_date_time, end_date_time, } = configValue.propsValue;
|
|
35
|
+
const { access_token: token } = configValue.auth;
|
|
35
36
|
const start = {
|
|
36
37
|
dateTime: (0, dayjs_1.default)(start_date_time).format('YYYY-MM-DDTHH:mm:ss.sssZ'),
|
|
37
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-event.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-calendar/src/lib/actions/create-event.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAsG;AACtG,sCAAiD;AACjD,0DAA0B;
|
|
1
|
+
{"version":3,"file":"create-event.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-calendar/src/lib/actions/create-event.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAsG;AACtG,sCAAiD;AACjD,0DAA0B;AAC1B,8BAA4C;AAE/B,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACpC,IAAI,EAAE,sBAAkB;IACpB,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,cAAc;IAC3B,KAAK,EAAE;QACH,WAAW,EAAE,6BAAoB,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QAC5D,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC/B,WAAW,EAAE,8BAA8B;YAC3C,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,aAAa,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,WAAW,EAAE,4BAA4B;YACzC,WAAW,EAAE,6CAA6C;YAC1D,QAAQ,EAAE,KAAK;SAClB,CAAC;KACL;IACK,GAAG,CAAC,WAAW;;YACjB,8EAA8E;YAC9E,MAAM,EACF,WAAW,EAAC,UAAU,EACtB,KAAK,EAAE,OAAO,EACd,eAAe,EACf,aAAa,GAChB,GAAG,WAAW,CAAC,UAAU,CAAC;YAC3B,MAAM,EAAC,YAAY,EAAC,KAAK,EAAC,GAAG,WAAW,CAAC,IAAI,CAAC;YAC9C,MAAM,KAAK,GAAG;gBACV,QAAQ,EAAE,IAAA,eAAK,EAAC,eAAe,CAAC,CAAC,MAAM,CAAC,0BAA0B,CAAC;aACtE,CAAC;YACF,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAA,eAAK,EAAC,eAAe,CAAC,CAAC,GAAG,CAAC,EAAE,EAAC,GAAG,CAAC,CAAC;YACnF,MAAM,GAAG,GAAG;gBACR,QAAQ,EAAE,IAAA,eAAK,EAAC,OAAO,CAAC,CAAC,MAAM,CAAC,0BAA0B,CAAC;aAC9D,CAAC;YACF,MAAM,GAAG,GAAG,GAAG,6BAAoB,CAAC,OAAO,cAAc,UAAU,SAAS,CAAC;YAC7E,MAAM,OAAO,GAAyC;gBAClD,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG;gBACH,IAAI,EAAC;oBACD,OAAO;oBACP,KAAK;oBACL,GAAG;iBACN;gBACD,cAAc,EAAE;oBACZ,IAAI,EAAE,kCAAkB,CAAC,YAAY;oBACrC,KAAK;iBACR;aACJ,CAAC;YACF,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACjD,CAAC;KAAA;CAER,CAAC,CAAC"}
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export declare const createQuickCalendarEvent: import("@activepieces/pieces-framework").
|
|
1
|
+
export declare const createQuickCalendarEvent: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
2
|
+
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
3
|
+
text: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
4
|
+
send_updates: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false> | import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
5
|
+
}>;
|
|
@@ -5,42 +5,40 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
6
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
|
+
const __1 = require("../../");
|
|
8
9
|
exports.createQuickCalendarEvent = (0, pieces_framework_1.createAction)({
|
|
10
|
+
auth: __1.googleCalendarAuth,
|
|
9
11
|
name: 'create_quick_event',
|
|
10
12
|
description: 'Add Quick Calendar Event',
|
|
11
13
|
displayName: 'Create Quick Event',
|
|
12
14
|
props: {
|
|
13
|
-
authentication: common_1.googleCalendarCommon.authentication,
|
|
14
15
|
calendar_id: common_1.googleCalendarCommon.calendarDropdown('writer'),
|
|
15
16
|
text: pieces_framework_1.Property.LongText({
|
|
16
17
|
displayName: 'Summary',
|
|
17
18
|
description: 'The text describing the event to be created',
|
|
18
19
|
required: true,
|
|
19
20
|
}),
|
|
20
|
-
send_updates: pieces_framework_1.Property.
|
|
21
|
+
send_updates: pieces_framework_1.Property.StaticDropdown({
|
|
21
22
|
displayName: "Send Updates",
|
|
22
23
|
description: "Guests who should receive notifications about the creation of the new event.",
|
|
23
|
-
refreshers: [],
|
|
24
24
|
required: false,
|
|
25
|
-
options:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
})
|
|
25
|
+
options: {
|
|
26
|
+
disabled: false,
|
|
27
|
+
options: [
|
|
28
|
+
{
|
|
29
|
+
label: "All",
|
|
30
|
+
value: "all",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: "External Only",
|
|
34
|
+
value: "externalOnly",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: "none",
|
|
38
|
+
value: "none",
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
44
42
|
}),
|
|
45
43
|
},
|
|
46
44
|
run(configValue) {
|
|
@@ -58,7 +56,7 @@ exports.createQuickCalendarEvent = (0, pieces_framework_1.createAction)({
|
|
|
58
56
|
body: {},
|
|
59
57
|
authentication: {
|
|
60
58
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
61
|
-
token: configValue.
|
|
59
|
+
token: configValue.auth.access_token,
|
|
62
60
|
},
|
|
63
61
|
queryParams: qParams,
|
|
64
62
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-quick-event.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-calendar/src/lib/actions/create-quick-event.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAsG;AACtG,sCAAiD;
|
|
1
|
+
{"version":3,"file":"create-quick-event.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-calendar/src/lib/actions/create-quick-event.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAsG;AACtG,sCAAiD;AACjD,8BAA4C;AAE/B,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,sBAAkB;IACtB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,0BAA0B;IACvC,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,EAAE,8EAA8E;YAC3F,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACL,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;aACJ;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,WAAW,CAAC,IAAI,CAAC,YAAY;iBACrC;gBACD,WAAW,EAAE,OAAO;aACrB,CAAC;YACF,OAAO,MAAM,0BAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC/C,CAAC;KAAA;CAEJ,CAAC,CAAC"}
|
|
@@ -3,4 +3,5 @@ import { GoogleWatchResponse, CalendarObject, GoogleCalendarEvent } from "./type
|
|
|
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
5
|
export declare function getCalendars(authProp: OAuth2PropertyValue, minAccessRole?: "writer"): Promise<CalendarObject[]>;
|
|
6
|
+
export declare function getEvents(calendarId: string, authProp: OAuth2PropertyValue, minUpdated?: Date): Promise<GoogleCalendarEvent[]>;
|
|
6
7
|
export declare function getLatestEvent(calendarId: string, authProp: OAuth2PropertyValue): Promise<GoogleCalendarEvent>;
|
package/src/lib/common/helper.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLatestEvent = exports.getCalendars = exports.watchEvent = exports.stopWatchEvent = void 0;
|
|
3
|
+
exports.getLatestEvent = exports.getEvents = exports.getCalendars = exports.watchEvent = exports.stopWatchEvent = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
6
|
const crypto_1 = require("crypto");
|
|
@@ -67,14 +67,15 @@ function getCalendars(authProp, minAccessRole) {
|
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
exports.getCalendars = getCalendars;
|
|
70
|
-
function
|
|
70
|
+
function getEvents(calendarId, authProp, minUpdated) {
|
|
71
|
+
var _a;
|
|
71
72
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
72
73
|
// docs: https://developers.google.com/calendar/api/v3/reference/events/list
|
|
73
74
|
const now = new Date();
|
|
74
75
|
const yesterday = new Date();
|
|
75
76
|
yesterday.setDate(now.getDate() - 1);
|
|
76
77
|
const qParams = {
|
|
77
|
-
updatedMin: yesterday.toISOString(),
|
|
78
|
+
updatedMin: (_a = minUpdated === null || minUpdated === void 0 ? void 0 : minUpdated.toISOString()) !== null && _a !== void 0 ? _a : yesterday.toISOString(),
|
|
78
79
|
maxResults: '2500',
|
|
79
80
|
orderBy: 'updated',
|
|
80
81
|
singleEvents: 'true',
|
|
@@ -99,6 +100,13 @@ function getLatestEvent(calendarId, authProp) {
|
|
|
99
100
|
}
|
|
100
101
|
pageToken = res.nextPageToken;
|
|
101
102
|
} while (pageToken);
|
|
103
|
+
return eventList;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
exports.getEvents = getEvents;
|
|
107
|
+
function getLatestEvent(calendarId, authProp) {
|
|
108
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
const eventList = yield getEvents(calendarId, authProp);
|
|
102
110
|
const lastUpdatedEvent = eventList.pop(); // You can retrieve the last updated event.
|
|
103
111
|
return lastUpdatedEvent;
|
|
104
112
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-calendar/src/lib/common/helper.ts"],"names":[],"mappings":";;;;AACA,+DAAsG;AACtG,mCAAoC;AACpC,wBAAyC;AACzC,mCAA2I;AAE3I,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;gBACrC,KAAK,EAAE,QAAQ,CAAC,YAAY;aAC7B;SACF,CAAC;QACF,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,0BAAU,CAAC,WAAW,CACpD,OAAO,CACR,CAAC;QACF,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA;AAtBD,gCAsBC;AAED,SAAsB,YAAY,CAChC,QAA6B,EAC7B,aAAwB;;QAExB,kFAAkF;QAClF,MAAM,WAAW,GAA2B;YAC1C,WAAW,EAAE,OAAO;SACrB,CAAA;QACD,IAAI,aAAa,EAAE;YACjB,WAAW,CAAC,eAAe,CAAC,GAAG,aAAa,CAAC;SAC9C;QACD,MAAM,OAAO,GAAgB;YAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,GAAG,EAAE,GAAG,uBAAoB,CAAC,OAAO,wBAAwB;YAC5D,WAAW,EAAE,WAAW;YACxB,cAAc,EAAE;gBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;gBACrC,KAAK,EAAE,QAAQ,CAAC,YAAY;aAC7B;SACF,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAe,OAAO,CAAC,CAAC;QACrE,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IAC7B,CAAC;CAAA;AAtBD,oCAsBC;AAED,SAAsB,
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-calendar/src/lib/common/helper.ts"],"names":[],"mappings":";;;;AACA,+DAAsG;AACtG,mCAAoC;AACpC,wBAAyC;AACzC,mCAA2I;AAE3I,SAAsB,cAAc,CAClC,IAAyB,EACzB,QAA6B;;QAE7B,MAAM,OAAO,GAAgB;YAC3B,MAA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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;AAtCD,8BAsCC;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,5 +1,4 @@
|
|
|
1
1
|
export declare const googleCalendarCommon: {
|
|
2
2
|
baseUrl: string;
|
|
3
|
-
authentication: import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>;
|
|
4
3
|
calendarDropdown: (minAccessRole?: 'writer') => import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
5
4
|
};
|
package/src/lib/common/index.js
CHANGED
|
@@ -6,29 +6,20 @@ const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
|
6
6
|
const helper_1 = require("./helper");
|
|
7
7
|
exports.googleCalendarCommon = {
|
|
8
8
|
baseUrl: 'https://www.googleapis.com/calendar/v3',
|
|
9
|
-
authentication: pieces_framework_1.Property.OAuth2({
|
|
10
|
-
description: '',
|
|
11
|
-
displayName: 'Authentication',
|
|
12
|
-
authUrl: 'https://accounts.google.com/o/oauth2/auth',
|
|
13
|
-
tokenUrl: 'https://oauth2.googleapis.com/token',
|
|
14
|
-
required: true,
|
|
15
|
-
pkce: true,
|
|
16
|
-
scope: ['https://www.googleapis.com/auth/calendar.events', 'https://www.googleapis.com/auth/calendar.readonly'],
|
|
17
|
-
}),
|
|
18
9
|
calendarDropdown: (minAccessRole) => {
|
|
19
10
|
return pieces_framework_1.Property.Dropdown({
|
|
20
11
|
displayName: 'Calendar',
|
|
21
|
-
refreshers: [
|
|
12
|
+
refreshers: [],
|
|
22
13
|
required: true,
|
|
23
|
-
options: (
|
|
24
|
-
if (!
|
|
14
|
+
options: ({ auth }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
if (!auth) {
|
|
25
16
|
return {
|
|
26
17
|
disabled: true,
|
|
27
18
|
placeholder: 'Please connect your account first',
|
|
28
19
|
options: [],
|
|
29
20
|
};
|
|
30
21
|
}
|
|
31
|
-
const authProp =
|
|
22
|
+
const authProp = auth;
|
|
32
23
|
const calendars = yield (0, helper_1.getCalendars)(authProp, minAccessRole);
|
|
33
24
|
return {
|
|
34
25
|
disabled: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-calendar/src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA+E;AAC/E,qCAAwC;AAE3B,QAAA,oBAAoB,GAAG;IAClC,OAAO,EAAE,wCAAwC;IACjD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/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,CAAA;IACJ,CAAC;CACF,CAAC"}
|
package/src/lib/common/types.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.GoogleCalendarKind = exports.GoogleWatchType = void 0;
|
|
|
4
4
|
var GoogleWatchType;
|
|
5
5
|
(function (GoogleWatchType) {
|
|
6
6
|
GoogleWatchType["WEBHOOK"] = "web_hook";
|
|
7
|
-
})(GoogleWatchType
|
|
7
|
+
})(GoogleWatchType || (exports.GoogleWatchType = GoogleWatchType = {}));
|
|
8
8
|
var GoogleCalendarKind;
|
|
9
9
|
(function (GoogleCalendarKind) {
|
|
10
10
|
GoogleCalendarKind["CALENDAR_LIST"] = "calendar#calendarList";
|
|
@@ -12,5 +12,5 @@ var GoogleCalendarKind;
|
|
|
12
12
|
GoogleCalendarKind["CALENDAR_EVENT"] = "calendar#event";
|
|
13
13
|
GoogleCalendarKind["CALENDAR_EVENT_LIST"] = "calendar#events";
|
|
14
14
|
GoogleCalendarKind["EVENT_WATCH"] = "api#channel";
|
|
15
|
-
})(GoogleCalendarKind
|
|
15
|
+
})(GoogleCalendarKind || (exports.GoogleCalendarKind = GoogleCalendarKind = {}));
|
|
16
16
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-calendar/src/lib/common/types.ts"],"names":[],"mappings":";;;AAAA,IAAY,eAEX;AAFD,WAAY,eAAe;IACzB,uCAAoB,CAAA;AACtB,CAAC,EAFW,eAAe,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/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 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { TriggerStrategy } from "@activepieces/pieces-framework";
|
|
2
|
+
export declare const calendarEventChanged: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").OAuth2Property<true, import("@activepieces/pieces-framework").OAuth2Props>, {
|
|
3
|
+
calendar_id: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
4
|
+
}>;
|
|
@@ -6,13 +6,35 @@ const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
|
6
6
|
const pieces_framework_2 = require("@activepieces/pieces-framework");
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
const helper_1 = require("../common/helper");
|
|
9
|
+
const __1 = require("../../");
|
|
10
|
+
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
11
|
+
const polling = {
|
|
12
|
+
strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
|
|
13
|
+
items: ({ auth, propsValue: { calendarId }, lastFetchEpochMS }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
+
var _a;
|
|
15
|
+
let minUpdated = new Date(lastFetchEpochMS);
|
|
16
|
+
// Google Calendar API breaks if minUpdated is too far in the past
|
|
17
|
+
if (lastFetchEpochMS === 0) {
|
|
18
|
+
const now = new Date();
|
|
19
|
+
const yesterday = new Date();
|
|
20
|
+
yesterday.setDate(now.getDate() - 7);
|
|
21
|
+
minUpdated = yesterday;
|
|
22
|
+
}
|
|
23
|
+
const currentValues = (_a = yield (0, helper_1.getEvents)(calendarId, auth, minUpdated)) !== null && _a !== void 0 ? _a : [];
|
|
24
|
+
const items = currentValues.map((item) => ({
|
|
25
|
+
epochMilliSeconds: (new Date(item.updated)).getTime(),
|
|
26
|
+
data: item,
|
|
27
|
+
}));
|
|
28
|
+
return items;
|
|
29
|
+
})
|
|
30
|
+
};
|
|
9
31
|
exports.calendarEventChanged = (0, pieces_framework_1.createTrigger)({
|
|
10
32
|
// docs: https://developers.google.com/calendar/api/guides/push
|
|
33
|
+
auth: __1.googleCalendarAuth,
|
|
11
34
|
name: 'new_or_updated_event',
|
|
12
|
-
displayName: 'New
|
|
13
|
-
description: 'Triggers when
|
|
35
|
+
displayName: 'New or Updated Event',
|
|
36
|
+
description: 'Triggers when an event is added or updated',
|
|
14
37
|
props: {
|
|
15
|
-
authentication: common_1.googleCalendarCommon.authentication,
|
|
16
38
|
calendar_id: common_1.googleCalendarCommon.calendarDropdown(),
|
|
17
39
|
},
|
|
18
40
|
sampleData: {
|
|
@@ -61,35 +83,25 @@ exports.calendarEventChanged = (0, pieces_framework_1.createTrigger)({
|
|
|
61
83
|
},
|
|
62
84
|
eventType: 'default',
|
|
63
85
|
},
|
|
64
|
-
type: pieces_framework_2.TriggerStrategy.
|
|
65
|
-
|
|
66
|
-
var _a, _b;
|
|
86
|
+
type: pieces_framework_2.TriggerStrategy.POLLING,
|
|
87
|
+
test({ store, auth, propsValue }) {
|
|
67
88
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
68
|
-
|
|
69
|
-
const currentChannel = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_trigger'));
|
|
70
|
-
if (currentChannel === null || currentChannel === void 0 ? void 0 : currentChannel.id) {
|
|
71
|
-
yield (0, helper_1.stopWatchEvent)(currentChannel, authProp); // to avoid creating multiple watchers
|
|
72
|
-
}
|
|
73
|
-
const calendarId = context.propsValue['calendar_id'];
|
|
74
|
-
const channel = yield (0, helper_1.watchEvent)(calendarId, context.webhookUrl, authProp);
|
|
75
|
-
yield ((_b = context.store) === null || _b === void 0 ? void 0 : _b.put('_trigger', channel));
|
|
89
|
+
return yield pieces_common_1.pollingHelper.test(polling, { store, auth, propsValue: { calendarId: propsValue.calendar_id } });
|
|
76
90
|
});
|
|
77
91
|
},
|
|
78
|
-
|
|
79
|
-
var _a, _b;
|
|
92
|
+
onEnable({ store, auth, propsValue }) {
|
|
80
93
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
81
|
-
|
|
82
|
-
const googleChannel = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_trigger'));
|
|
83
|
-
if (googleChannel === null || googleChannel === void 0 ? void 0 : googleChannel.id)
|
|
84
|
-
yield (0, helper_1.stopWatchEvent)(googleChannel, authProp);
|
|
85
|
-
yield ((_b = context.store) === null || _b === void 0 ? void 0 : _b.put('_trigger', {}));
|
|
94
|
+
yield pieces_common_1.pollingHelper.onEnable(polling, { store, auth, propsValue: { calendarId: propsValue.calendar_id } });
|
|
86
95
|
});
|
|
87
96
|
},
|
|
88
|
-
|
|
97
|
+
onDisable({ store, auth, propsValue }) {
|
|
89
98
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
yield pieces_common_1.pollingHelper.onDisable(polling, { store, auth, propsValue: { calendarId: propsValue.calendar_id } });
|
|
100
|
+
});
|
|
101
|
+
},
|
|
102
|
+
run({ store, auth, propsValue }) {
|
|
103
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
return yield pieces_common_1.pollingHelper.poll(polling, { store, auth, propsValue: { calendarId: propsValue.calendar_id } });
|
|
93
105
|
});
|
|
94
106
|
},
|
|
95
107
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-event.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-calendar/src/lib/triggers/calendar-event.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"calendar-event.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-calendar/src/lib/triggers/calendar-event.ts"],"names":[],"mappings":";;;;AAAA,qEAAqF;AACrF,qEAAiE;AACjE,sCAAiD;AACjD,6CAA6C;AAE7C,8BAA4C;AAC5C,+DAAqF;AAErF,MAAM,OAAO,GAAsF;IAC/F,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,CAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE;;QACpE,IAAI,UAAU,GAAG,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC5C,kEAAkE;QAClE,IAAI,gBAAgB,KAAK,CAAC,EAAE;YACxB,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;SAC1B;QAED,MAAM,aAAa,GAA0B,MAAA,MAAM,IAAA,kBAAS,EAAC,UAAW,EAAE,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