@activepieces/piece-google-calendar 0.4.4 → 0.4.5
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-google-calendar",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@sinclair/typebox": "0.26.8",
|
|
6
6
|
"axios": "^1.6.3",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"semver": "7.5.4",
|
|
14
14
|
"@activepieces/pieces-common": "0.2.8",
|
|
15
15
|
"@activepieces/pieces-framework": "0.7.15",
|
|
16
|
-
"@activepieces/shared": "0.10.
|
|
17
|
-
"tslib": "
|
|
16
|
+
"@activepieces/shared": "0.10.69",
|
|
17
|
+
"tslib": "2.6.2"
|
|
18
18
|
},
|
|
19
19
|
"main": "./src/index.js",
|
|
20
20
|
"type": "commonjs"
|
|
@@ -3,4 +3,11 @@ export declare const createEvent: import("@activepieces/pieces-framework").IActi
|
|
|
3
3
|
title: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
4
|
start_date_time: import("@activepieces/pieces-framework").DateTimeProperty<true>;
|
|
5
5
|
end_date_time: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
6
|
+
location: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
|
+
description: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
8
|
+
attendees: import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
9
|
+
guests_can_modify: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
10
|
+
guests_can_invite_others: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
11
|
+
guests_can_see_other_guests: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
12
|
+
send_notifications: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
6
13
|
}>;
|
|
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createEvent = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
6
|
const common_1 = require("../common");
|
|
8
7
|
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
9
8
|
const __1 = require("../../");
|
|
9
|
+
const googleapis_1 = require("googleapis");
|
|
10
|
+
const googleapis_common_1 = require("googleapis-common");
|
|
10
11
|
exports.createEvent = (0, pieces_framework_1.createAction)({
|
|
11
12
|
auth: __1.googleCalendarAuth,
|
|
12
13
|
name: 'create_google_calendar_event',
|
|
@@ -27,12 +28,57 @@ exports.createEvent = (0, pieces_framework_1.createAction)({
|
|
|
27
28
|
description: "By default it'll be 30 min post start time",
|
|
28
29
|
required: false,
|
|
29
30
|
}),
|
|
31
|
+
location: pieces_framework_1.Property.ShortText({
|
|
32
|
+
displayName: 'Location',
|
|
33
|
+
required: false,
|
|
34
|
+
}),
|
|
35
|
+
/*attachment: Property.ShortText({
|
|
36
|
+
displayName: 'Attachment',
|
|
37
|
+
description: 'URL of the file to be attached',
|
|
38
|
+
required: false,
|
|
39
|
+
}),*/
|
|
40
|
+
description: pieces_framework_1.Property.LongText({
|
|
41
|
+
displayName: 'Description',
|
|
42
|
+
description: 'Description of the event. You can use HTML tags here.',
|
|
43
|
+
required: false,
|
|
44
|
+
}),
|
|
45
|
+
attendees: pieces_framework_1.Property.Array({
|
|
46
|
+
displayName: 'Attendees',
|
|
47
|
+
description: 'Emails of the attendees (guests)',
|
|
48
|
+
required: false,
|
|
49
|
+
}),
|
|
50
|
+
guests_can_modify: pieces_framework_1.Property.Checkbox({
|
|
51
|
+
displayName: 'Guests can modify',
|
|
52
|
+
defaultValue: false,
|
|
53
|
+
required: false,
|
|
54
|
+
}),
|
|
55
|
+
guests_can_invite_others: pieces_framework_1.Property.Checkbox({
|
|
56
|
+
displayName: 'Guests can invite others',
|
|
57
|
+
defaultValue: false,
|
|
58
|
+
required: false,
|
|
59
|
+
}),
|
|
60
|
+
guests_can_see_other_guests: pieces_framework_1.Property.Checkbox({
|
|
61
|
+
displayName: 'Guests can see other guests',
|
|
62
|
+
defaultValue: false,
|
|
63
|
+
required: false,
|
|
64
|
+
}),
|
|
65
|
+
send_notifications: pieces_framework_1.Property.StaticDropdown({
|
|
66
|
+
displayName: 'Send Notifications',
|
|
67
|
+
defaultValue: 'all',
|
|
68
|
+
options: {
|
|
69
|
+
options: [
|
|
70
|
+
{ label: 'Yes, to everyone', value: 'all' },
|
|
71
|
+
{ label: 'To non-Google Calendar guests only', value: 'externalOnly' },
|
|
72
|
+
{ label: 'To no one', value: 'none' },
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
required: true,
|
|
76
|
+
}),
|
|
30
77
|
},
|
|
31
78
|
run(configValue) {
|
|
32
79
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
33
80
|
// docs: https://developers.google.com/calendar/api/v3/reference/events/insert
|
|
34
|
-
const { calendar_id: calendarId, title: summary, start_date_time, end_date_time, } = configValue.propsValue;
|
|
35
|
-
const { access_token: token } = configValue.auth;
|
|
81
|
+
const { calendar_id: calendarId, title: summary, start_date_time, end_date_time, location, description, guests_can_modify: guestsCanModify, guests_can_invite_others: guestsCanInviteOthers, guests_can_see_other_guests: guestsCanSeeOtherGuests, } = configValue.propsValue;
|
|
36
82
|
const start = {
|
|
37
83
|
dateTime: (0, dayjs_1.default)(start_date_time).format('YYYY-MM-DDTHH:mm:ss.sssZ'),
|
|
38
84
|
};
|
|
@@ -42,21 +88,38 @@ exports.createEvent = (0, pieces_framework_1.createAction)({
|
|
|
42
88
|
const end = {
|
|
43
89
|
dateTime: (0, dayjs_1.default)(endTime).format('YYYY-MM-DDTHH:mm:ss.sssZ'),
|
|
44
90
|
};
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
91
|
+
/*const attachment = {
|
|
92
|
+
fileUrl: configValue.propsValue.attachment,
|
|
93
|
+
};*/
|
|
94
|
+
const attendeesArray = configValue.propsValue.attendees;
|
|
95
|
+
const sendNotifications = configValue.propsValue.send_notifications;
|
|
96
|
+
const attendeesObject = [];
|
|
97
|
+
if (attendeesArray) {
|
|
98
|
+
for (const attendee of attendeesArray) {
|
|
99
|
+
attendeesObject.push({ email: attendee });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
console.log;
|
|
103
|
+
const authClient = new googleapis_common_1.OAuth2Client();
|
|
104
|
+
authClient.setCredentials(configValue.auth);
|
|
105
|
+
const calendar = googleapis_1.google.calendar({ version: 'v3', auth: authClient });
|
|
106
|
+
const response = yield calendar.events.insert({
|
|
107
|
+
calendarId,
|
|
108
|
+
sendUpdates: sendNotifications,
|
|
109
|
+
requestBody: {
|
|
50
110
|
summary,
|
|
51
111
|
start,
|
|
52
112
|
end,
|
|
113
|
+
//attachments: configValue.propsValue.attachment ? [attachment] : [],
|
|
114
|
+
location: location !== null && location !== void 0 ? location : "",
|
|
115
|
+
description: description !== null && description !== void 0 ? description : "",
|
|
116
|
+
attendees: attendeesObject,
|
|
117
|
+
guestsCanInviteOthers,
|
|
118
|
+
guestsCanModify,
|
|
119
|
+
guestsCanSeeOtherGuests,
|
|
53
120
|
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
token,
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
return yield pieces_common_1.httpClient.sendRequest(request);
|
|
121
|
+
});
|
|
122
|
+
return response.data;
|
|
60
123
|
});
|
|
61
124
|
},
|
|
62
125
|
});
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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,sCAAiD;AACjD,0DAA0B;AAC1B,8BAA4C;AAC5C,2CAAoC;AACpC,yDAAiD;AAEpC,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;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,UAAU;YACvB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF;;;;aAIK;QACL,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,uDAAuD;YACpE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACxB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,kCAAkC;YAC/C,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,iBAAiB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACnC,WAAW,EAAE,m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 @@
|
|
|
1
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
|
-
send_updates: import("@activepieces/pieces-framework").StaticDropdownProperty<string,
|
|
4
|
+
send_updates: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true> | import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
5
5
|
}>;
|