@activepieces/piece-google-calendar 0.2.3 → 0.3.0
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 +8 -8
- package/src/index.d.ts +2 -1
- package/src/index.js +12 -5
- 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/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.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 +5 -4
- package/src/lib/triggers/calendar-event.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-google-calendar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@sinclair/typebox": "0.26.
|
|
5
|
+
"@sinclair/typebox": "^0.26.3",
|
|
6
6
|
"axios": "1.2.4",
|
|
7
|
-
"
|
|
8
|
-
"nanoid": "3.3.4",
|
|
9
|
-
"@activepieces/pieces-
|
|
10
|
-
"@activepieces/
|
|
11
|
-
"@activepieces/
|
|
12
|
-
"tslib": "
|
|
7
|
+
"dayjs": "^1.11.8",
|
|
8
|
+
"nanoid": "^3.3.4",
|
|
9
|
+
"@activepieces/pieces-common": "0.1.0",
|
|
10
|
+
"@activepieces/pieces-framework": "0.4.0",
|
|
11
|
+
"@activepieces/shared": "0.4.0",
|
|
12
|
+
"tslib": "1.14.1"
|
|
13
13
|
},
|
|
14
14
|
"main": "./src/index.js",
|
|
15
15
|
"types": "./src/index.d.ts"
|
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,18 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.googleCalendar = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
3
|
+
exports.googleCalendar = exports.googleCalendarAuth = void 0;
|
|
6
4
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
5
|
const create_quick_event_1 = require("./lib/actions/create-quick-event");
|
|
8
6
|
const calendar_event_1 = require("./lib/triggers/calendar-event");
|
|
9
7
|
const create_event_1 = require("./lib/actions/create-event");
|
|
8
|
+
exports.googleCalendarAuth = pieces_framework_1.PieceAuth.OAuth2({
|
|
9
|
+
description: '',
|
|
10
|
+
displayName: 'Authentication',
|
|
11
|
+
authUrl: 'https://accounts.google.com/o/oauth2/auth',
|
|
12
|
+
tokenUrl: 'https://oauth2.googleapis.com/token',
|
|
13
|
+
required: true,
|
|
14
|
+
pkce: true,
|
|
15
|
+
scope: ['https://www.googleapis.com/auth/calendar.events', 'https://www.googleapis.com/auth/calendar.readonly'],
|
|
16
|
+
});
|
|
10
17
|
exports.googleCalendar = (0, pieces_framework_1.createPiece)({
|
|
11
|
-
|
|
18
|
+
minimumSupportedRelease: '0.5.0',
|
|
12
19
|
logoUrl: 'https://cdn.activepieces.com/pieces/google-calendar.png',
|
|
13
20
|
displayName: 'Google Calendar',
|
|
14
|
-
version: package_json_1.default.version,
|
|
15
21
|
authors: ['osamahaikal', 'bibhuty-did-this'],
|
|
22
|
+
auth: exports.googleCalendarAuth,
|
|
16
23
|
actions: [create_quick_event_1.createQuickCalendarEvent, create_event_1.createEvent],
|
|
17
24
|
triggers: [calendar_event_1.calendarEventChanged],
|
|
18
25
|
});
|
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":"
|
|
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;IACjD,WAAW,EAAE,EAAE;IACf,WAAW,EAAE,gBAAgB;IAC7B,OAAO,EAAE,2CAA2C;IACpD,QAAQ,EAAE,qCAAqC;IAC/C,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,CAAC,iDAAiD,EAAE,mDAAmD,CAAC;CAChH,CAAC,CAAA;AAEW,QAAA,cAAc,GAAG,IAAA,8BAAW,EAAC;IACpC,uBAAuB,EAAE,OAAO;IAClC,OAAO,EAAE,yDAAyD;IACpE,WAAW,EAAE,iBAAiB;IAC9B,OAAO,EAAE,CAAC,aAAa,EAAE,kBAAkB,CAAC;IAC5C,IAAI,EAAE,0BAAkB;IACxB,OAAO,EAAE,CAAC,6CAAwB,EAAE,0BAAW,CAAC;IAChD,QAAQ,EAAE,CAAC,qCAAoB,CAAC;CACjC,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"}
|
|
@@ -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.WEBHOOK, 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,14 @@ 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("../../");
|
|
9
10
|
exports.calendarEventChanged = (0, pieces_framework_1.createTrigger)({
|
|
10
11
|
// docs: https://developers.google.com/calendar/api/guides/push
|
|
12
|
+
auth: __1.googleCalendarAuth,
|
|
11
13
|
name: 'new_or_updated_event',
|
|
12
14
|
displayName: 'New Or updated Event',
|
|
13
15
|
description: 'Triggers when there is an event added or updated',
|
|
14
16
|
props: {
|
|
15
|
-
authentication: common_1.googleCalendarCommon.authentication,
|
|
16
17
|
calendar_id: common_1.googleCalendarCommon.calendarDropdown(),
|
|
17
18
|
},
|
|
18
19
|
sampleData: {
|
|
@@ -65,7 +66,7 @@ exports.calendarEventChanged = (0, pieces_framework_1.createTrigger)({
|
|
|
65
66
|
onEnable(context) {
|
|
66
67
|
var _a, _b;
|
|
67
68
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
68
|
-
const authProp = context.
|
|
69
|
+
const authProp = context.auth;
|
|
69
70
|
const currentChannel = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_trigger'));
|
|
70
71
|
if (currentChannel === null || currentChannel === void 0 ? void 0 : currentChannel.id) {
|
|
71
72
|
yield (0, helper_1.stopWatchEvent)(currentChannel, authProp); // to avoid creating multiple watchers
|
|
@@ -78,7 +79,7 @@ exports.calendarEventChanged = (0, pieces_framework_1.createTrigger)({
|
|
|
78
79
|
onDisable(context) {
|
|
79
80
|
var _a, _b;
|
|
80
81
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
81
|
-
const authProp = context.
|
|
82
|
+
const authProp = context.auth;
|
|
82
83
|
const googleChannel = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_trigger'));
|
|
83
84
|
if (googleChannel === null || googleChannel === void 0 ? void 0 : googleChannel.id)
|
|
84
85
|
yield (0, helper_1.stopWatchEvent)(googleChannel, authProp);
|
|
@@ -87,7 +88,7 @@ exports.calendarEventChanged = (0, pieces_framework_1.createTrigger)({
|
|
|
87
88
|
},
|
|
88
89
|
run(context) {
|
|
89
90
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
const authProp = context.
|
|
91
|
+
const authProp = context.auth;
|
|
91
92
|
const event = yield (0, helper_1.getLatestEvent)(context.propsValue['calendar_id'], authProp);
|
|
92
93
|
return [event];
|
|
93
94
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-event.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-calendar/src/lib/triggers/calendar-event.ts"],"names":[],"mappings":";;;;AAAA,qEAAoF;AACpF,qEAAiE;AACjE,sCAAiD;AACjD,6CAA8E;
|
|
1
|
+
{"version":3,"file":"calendar-event.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/google-calendar/src/lib/triggers/calendar-event.ts"],"names":[],"mappings":";;;;AAAA,qEAAoF;AACpF,qEAAiE;AACjE,sCAAiD;AACjD,6CAA8E;AAE9E,8BAA4C;AAE/B,QAAA,oBAAoB,GAAG,IAAA,gCAAa,EAAC;IAChD,+DAA+D;IAC/D,IAAI,EAAE,sBAAkB;IACtB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,kDAAkD;IAC/D,KAAK,EAAE;QACL,WAAW,EAAE,6BAAoB,CAAC,gBAAgB,EAAE;KACrD;IACD,UAAU,EAAE;QACV,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,kBAAkB;QACxB,EAAE,EAAE,4BAA4B;QAChC,QAAQ,EAAE,wEAAwE;QAClF,OAAO,EAAE,eAAe;QACxB,OAAO,EAAE,0BAA0B;QACnC,OAAO,EAAE,0BAA0B;QACnC,WAAW,EAAE,oBAAoB;QACjC,MAAM,EAAE,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