Skip to content

Commit ece3898

Browse files
authored
Cal.com - update eventType to eventTypeId (#16382)
* updates * pnpm-lock.yaml * version * updates
1 parent 5ab8a83 commit ece3898

File tree

10 files changed

+49
-39
lines changed

10 files changed

+49
-39
lines changed

components/cal_com/actions/create-booking/create-booking.mjs

+22-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import calCom from "../../cal_com.app.mjs";
2+
import { ConfigurationError } from "@pipedream/platform";
23

34
export default {
45
key: "cal_com-create-booking",
56
name: "Create Booking",
6-
description: "Create a new booking. [See the docs here](https://developer.cal.com/api/api-reference/bookings#create-a-new-booking)",
7-
version: "0.0.1",
7+
description: "Create a new booking. [See the documentation](https://developer.cal.com/api/api-reference/bookings#create-a-new-booking)",
8+
version: "0.0.2",
89
type: "action",
910
props: {
1011
calCom,
11-
eventType: {
12+
eventTypeId: {
1213
propDefinition: [
1314
calCom,
14-
"eventType",
15+
"eventTypeId",
1516
],
1617
},
1718
name: {
@@ -33,12 +34,12 @@ export default {
3334
startTime: {
3435
type: "string",
3536
label: "Start Time",
36-
description: "The start time of the new booking in **ISO 8601** format",
37+
description: "The start time of the new booking in **ISO 8601** format. E.g. `2025-04-21T20:28:00`",
3738
},
3839
endTime: {
3940
type: "string",
4041
label: "End Time",
41-
description: "The end time of the new booking in **ISO 8601** format",
42+
description: "The end time of the new booking in **ISO 8601** format. E.g. `2025-04-21T20:28:00`",
4243
},
4344
recurringCount: {
4445
type: "integer",
@@ -61,7 +62,7 @@ export default {
6162
},
6263
async run({ $ }) {
6364
const data = {
64-
eventTypeId: this.eventType,
65+
eventTypeId: this.eventTypeId,
6566
name: this.name,
6667
email: this.email,
6768
title: this.title,
@@ -74,11 +75,19 @@ export default {
7475
customInputs: [],
7576
metadata: {},
7677
};
77-
const response = await this.calCom.createBooking({
78-
data,
79-
$,
80-
});
81-
$.export("$summary", `Successfully created booking with ID ${response.id}`);
82-
return response;
78+
try {
79+
const response = await this.calCom.createBooking({
80+
data,
81+
$,
82+
});
83+
$.export("$summary", `Successfully created booking with ID ${response.id}`);
84+
return response;
85+
} catch (error) {
86+
const errorJson = JSON.parse(error.slice(error.indexOf("{")));
87+
const message = errorJson?.data?.message;
88+
throw new ConfigurationError(`Error: ${message}${message === "no_available_users_found_error"
89+
? ". No users are available to be assigned to a booking at the specified time"
90+
: ""}`);
91+
}
8392
},
8493
};

components/cal_com/actions/delete-booking/delete-booking.mjs

+7-6
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,25 @@ import calCom from "../../cal_com.app.mjs";
33
export default {
44
key: "cal_com-delete-booking",
55
name: "Delete Booking",
6-
description: "Delete an existing booking by its ID. [See the docs here](https://developer.cal.com/api/api-reference/bookings)",
7-
version: "0.0.1",
6+
description: "Delete an existing booking by its ID. [See the documentation](https://developer.cal.com/api/api-reference/bookings)",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
calCom,
11-
booking: {
11+
bookingId: {
1212
propDefinition: [
1313
calCom,
14-
"booking",
14+
"bookingId",
1515
() => ({
1616
filterCancelled: true,
1717
}),
1818
],
19+
description: "The identifier of the booking to delete",
1920
},
2021
},
2122
async run({ $ }) {
22-
const response = await this.calCom.deleteBooking(this.booking, $);
23-
$.export("$summary", `Successfully deleted booking with ID ${this.booking}`);
23+
const response = await this.calCom.deleteBooking(this.bookingId, $);
24+
$.export("$summary", `Successfully deleted booking with ID ${this.bookingId}`);
2425
return response;
2526
},
2627
};

components/cal_com/actions/get-booking/get-booking.mjs

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ import calCom from "../../cal_com.app.mjs";
33
export default {
44
key: "cal_com-get-booking",
55
name: "Get Booking",
6-
description: "Retrieve a booking by its ID. [See the docs here](https://developer.cal.com/api/api-reference/bookings#find-a-booking)",
7-
version: "0.0.1",
6+
description: "Retrieve a booking by its ID. [See the documentation](https://developer.cal.com/api/api-reference/bookings#find-a-booking)",
7+
version: "0.0.2",
88
type: "action",
99
props: {
1010
calCom,
11-
booking: {
11+
bookingId: {
1212
propDefinition: [
1313
calCom,
14-
"booking",
14+
"bookingId",
1515
],
1616
},
1717
},
1818
async run({ $ }) {
19-
const response = await this.calCom.getBooking(this.booking, $);
20-
$.export("$summary", `Successfully retrieved booking with ID ${this.booking}`);
19+
const response = await this.calCom.getBooking(this.bookingId, $);
20+
$.export("$summary", `Successfully retrieved booking with ID ${this.bookingId}`);
2121
return response;
2222
},
2323
};

components/cal_com/cal_com.app.mjs

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ export default {
99
type: "app",
1010
app: "cal_com",
1111
propDefinitions: {
12-
booking: {
12+
bookingId: {
1313
type: "string",
14-
label: "Booking",
15-
description: "The booking to retrieve",
14+
label: "Booking ID",
15+
description: "The identifier of the booking to retrieve",
1616
async options({ filterCancelled = false }) {
1717
const { bookings = [] } = await this.listBookings();
1818
const filteredBookings = filterCancelled
@@ -24,10 +24,10 @@ export default {
2424
}));
2525
},
2626
},
27-
eventType: {
27+
eventTypeId: {
2828
type: "string",
29-
label: "Event Type",
30-
description: "Event type of the new booking",
29+
label: "Event Type ID",
30+
description: "The identifier of the event type of the new booking",
3131
async options() {
3232
const { event_types: eventTypes } = await this.listEventTypes();
3333
return eventTypes.map((type) => ({

components/cal_com/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/cal_com",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "Pipedream Cal.com Components",
55
"main": "cal_com.app.mjs",
66
"keywords": [
@@ -13,7 +13,7 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16-
"@pipedream/platform": "^1.1.1",
16+
"@pipedream/platform": "^3.0.3",
1717
"async-retry": "^1.3.3"
1818
}
1919
}

components/cal_com/sources/booking-cancelled/booking-cancelled.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "cal_com-booking-cancelled",
66
name: "Booking Cancelled",
77
description: "Emit new event when a booking is cancelled.",
8-
version: "0.0.1",
8+
version: "0.0.2",
99
type: "source",
1010
dedupe: "unique",
1111
methods: {

components/cal_com/sources/booking-created/booking-created.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "cal_com-booking-created",
66
name: "New Booking Created",
77
description: "Emit new event when a new booking is created.",
8-
version: "0.0.1",
8+
version: "0.0.2",
99
type: "source",
1010
dedupe: "unique",
1111
methods: {

components/cal_com/sources/booking-ended/booking-ended.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "cal_com-booking-ended",
66
name: "Booking Ended",
77
description: "Emit new event when a booking ends.",
8-
version: "0.0.1",
8+
version: "0.0.2",
99
type: "source",
1010
dedupe: "unique",
1111
methods: {

components/cal_com/sources/booking-rescheduled/booking-rescheduled.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "cal_com-booking-rescheduled",
66
name: "Booking Rescheduled",
77
description: "Emit new event when a booking is rescheduled.",
8-
version: "0.0.1",
8+
version: "0.0.2",
99
type: "source",
1010
dedupe: "unique",
1111
methods: {

pnpm-lock.yaml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)