@activepieces/piece-google-calendar 0.2.2 → 0.2.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
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-google-calendar",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@sinclair/typebox": "0.26.8",
|
|
6
6
|
"axios": "1.2.4",
|
|
7
|
+
"dayjs": "1.11.8",
|
|
8
|
+
"lodash": "4.17.21",
|
|
7
9
|
"nanoid": "3.3.4",
|
|
8
|
-
"@activepieces/pieces-framework": "0.3.
|
|
9
|
-
"@activepieces/shared": "0.3.
|
|
10
|
-
"@activepieces/pieces-common": "0.0.
|
|
11
|
-
"tslib": "2.
|
|
10
|
+
"@activepieces/pieces-framework": "0.3.27",
|
|
11
|
+
"@activepieces/shared": "0.3.44",
|
|
12
|
+
"@activepieces/pieces-common": "0.0.7",
|
|
13
|
+
"tslib": "2.5.3"
|
|
12
14
|
},
|
|
13
15
|
"main": "./src/index.js",
|
|
14
16
|
"types": "./src/index.d.ts"
|
package/src/index.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.googleCalendar = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
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");
|
|
7
|
+
const create_event_1 = require("./lib/actions/create-event");
|
|
9
8
|
exports.googleCalendar = (0, pieces_framework_1.createPiece)({
|
|
10
|
-
name: 'google-calendar',
|
|
11
9
|
logoUrl: 'https://cdn.activepieces.com/pieces/google-calendar.png',
|
|
12
|
-
displayName:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
actions: [create_quick_event_1.createQuickCalendarEvent],
|
|
10
|
+
displayName: 'Google Calendar',
|
|
11
|
+
authors: ['osamahaikal', 'bibhuty-did-this'],
|
|
12
|
+
actions: [create_quick_event_1.createQuickCalendarEvent, create_event_1.createEvent],
|
|
16
13
|
triggers: [calendar_event_1.calendarEventChanged],
|
|
17
14
|
});
|
|
18
15
|
//# sourceMappingURL=index.js.map
|
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,qEAA6D;AAC7D,yEAA4E;AAC5E,kEAAqE;AACrE,6DAAyD;AAG5C,QAAA,cAAc,GAAG,IAAA,8BAAW,EAAC;IACxC,OAAO,EAAE,yDAAyD;IAClE,WAAW,EAAE,iBAAiB;IAC9B,OAAO,EAAE,CAAC,aAAa,EAAE,kBAAkB,CAAC;IAC5C,OAAO,EAAE,CAAC,6CAAwB,EAAE,0BAAW,CAAC;IAChD,QAAQ,EAAE,CAAC,qCAAoB,CAAC;CACjC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createEvent: import("@activepieces/pieces-framework").Action;
|
|
@@ -0,0 +1,60 @@
|
|
|
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 pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
9
|
+
exports.createEvent = (0, pieces_framework_1.createAction)({
|
|
10
|
+
name: 'create_google_calendar_event',
|
|
11
|
+
description: 'Add Event',
|
|
12
|
+
displayName: 'Create Event',
|
|
13
|
+
props: {
|
|
14
|
+
authentication: common_1.googleCalendarCommon.authentication,
|
|
15
|
+
calendar_id: common_1.googleCalendarCommon.calendarDropdown('writer'),
|
|
16
|
+
title: pieces_framework_1.Property.ShortText({
|
|
17
|
+
displayName: 'Title of the event',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
start_date_time: pieces_framework_1.Property.DateTime({
|
|
21
|
+
displayName: 'Start date time of the event',
|
|
22
|
+
required: true,
|
|
23
|
+
}),
|
|
24
|
+
end_date_time: pieces_framework_1.Property.DateTime({
|
|
25
|
+
displayName: 'End date time of the event',
|
|
26
|
+
description: 'By default it\'ll be 30 min post start time',
|
|
27
|
+
required: false,
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
run(configValue) {
|
|
31
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
// docs: https://developers.google.com/calendar/api/v3/reference/events/insert
|
|
33
|
+
const { authentication, calendar_id: calendarId, title: summary, start_date_time, end_date_time, } = configValue.propsValue;
|
|
34
|
+
const { access_token: token } = authentication;
|
|
35
|
+
const start = {
|
|
36
|
+
dateTime: (0, dayjs_1.default)(start_date_time).format('YYYY-MM-DDTHH:mm:ss.sssZ'),
|
|
37
|
+
};
|
|
38
|
+
const endTime = end_date_time ? end_date_time : (0, dayjs_1.default)(start_date_time).add(30, 'm');
|
|
39
|
+
const end = {
|
|
40
|
+
dateTime: (0, dayjs_1.default)(endTime).format('YYYY-MM-DDTHH:mm:ss.sssZ'),
|
|
41
|
+
};
|
|
42
|
+
const url = `${common_1.googleCalendarCommon.baseUrl}/calendars/${calendarId}/events`;
|
|
43
|
+
const request = {
|
|
44
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
45
|
+
url,
|
|
46
|
+
body: {
|
|
47
|
+
summary,
|
|
48
|
+
start,
|
|
49
|
+
end,
|
|
50
|
+
},
|
|
51
|
+
authentication: {
|
|
52
|
+
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
53
|
+
token,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
return yield pieces_common_1.httpClient.sendRequest(request);
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=create-event.js.map
|
|
@@ -0,0 +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;AAEb,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACpC,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,cAAc;IAC3B,KAAK,EAAE;QACH,cAAc,EAAE,6BAAoB,CAAC,cAAc;QACnD,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,cAAc,EACd,WAAW,EAAC,UAAU,EACtB,KAAK,EAAE,OAAO,EACd,eAAe,EACf,aAAa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