Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions components/cal_com/actions/create-booking/create-booking.mjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import calCom from "../../cal_com.app.mjs";
import { ConfigurationError } from "@pipedream/platform";

export default {
key: "cal_com-create-booking",
name: "Create Booking",
description: "Create a new booking. [See the docs here](https://developer.cal.com/api/api-reference/bookings#create-a-new-booking)",
version: "0.0.1",
description: "Create a new booking. [See the documentation](https://developer.cal.com/api/api-reference/bookings#create-a-new-booking)",
version: "0.0.2",
type: "action",
props: {
calCom,
eventType: {
eventTypeId: {
propDefinition: [
calCom,
"eventType",
"eventTypeId",
],
},
name: {
Expand All @@ -33,12 +34,12 @@ export default {
startTime: {
type: "string",
label: "Start Time",
description: "The start time of the new booking in **ISO 8601** format",
description: "The start time of the new booking in **ISO 8601** format. E.g. `2025-04-21T20:28:00`",
},
endTime: {
type: "string",
label: "End Time",
description: "The end time of the new booking in **ISO 8601** format",
description: "The end time of the new booking in **ISO 8601** format. E.g. `2025-04-21T20:28:00`",
},
recurringCount: {
type: "integer",
Expand All @@ -61,7 +62,7 @@ export default {
},
async run({ $ }) {
const data = {
eventTypeId: this.eventType,
eventTypeId: this.eventTypeId,
name: this.name,
email: this.email,
title: this.title,
Expand All @@ -74,11 +75,19 @@ export default {
customInputs: [],
metadata: {},
};
const response = await this.calCom.createBooking({
data,
$,
});
$.export("$summary", `Successfully created booking with ID ${response.id}`);
return response;
try {
const response = await this.calCom.createBooking({
data,
$,
});
$.export("$summary", `Successfully created booking with ID ${response.id}`);
return response;
} catch (error) {
const errorJson = JSON.parse(error.slice(error.indexOf("{")));
const message = errorJson?.data?.message;
throw new ConfigurationError(`Error: ${message}${message === "no_available_users_found_error"
? ". No users are available to be assigned to a booking at the specified time"
: ""}`);
}
},
};
13 changes: 7 additions & 6 deletions components/cal_com/actions/delete-booking/delete-booking.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,25 @@ import calCom from "../../cal_com.app.mjs";
export default {
key: "cal_com-delete-booking",
name: "Delete Booking",
description: "Delete an existing booking by its ID. [See the docs here](https://developer.cal.com/api/api-reference/bookings)",
version: "0.0.1",
description: "Delete an existing booking by its ID. [See the documentation](https://developer.cal.com/api/api-reference/bookings)",
version: "0.0.2",
type: "action",
props: {
calCom,
booking: {
bookingId: {
propDefinition: [
calCom,
"booking",
"bookingId",
() => ({
filterCancelled: true,
}),
],
description: "The identifier of the booking to delete",
},
},
async run({ $ }) {
const response = await this.calCom.deleteBooking(this.booking, $);
$.export("$summary", `Successfully deleted booking with ID ${this.booking}`);
const response = await this.calCom.deleteBooking(this.bookingId, $);
$.export("$summary", `Successfully deleted booking with ID ${this.bookingId}`);
return response;
},
};
12 changes: 6 additions & 6 deletions components/cal_com/actions/get-booking/get-booking.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import calCom from "../../cal_com.app.mjs";
export default {
key: "cal_com-get-booking",
name: "Get Booking",
description: "Retrieve a booking by its ID. [See the docs here](https://developer.cal.com/api/api-reference/bookings#find-a-booking)",
version: "0.0.1",
description: "Retrieve a booking by its ID. [See the documentation](https://developer.cal.com/api/api-reference/bookings#find-a-booking)",
version: "0.0.2",
type: "action",
props: {
calCom,
booking: {
bookingId: {
propDefinition: [
calCom,
"booking",
"bookingId",
],
},
},
async run({ $ }) {
const response = await this.calCom.getBooking(this.booking, $);
$.export("$summary", `Successfully retrieved booking with ID ${this.booking}`);
const response = await this.calCom.getBooking(this.bookingId, $);
$.export("$summary", `Successfully retrieved booking with ID ${this.bookingId}`);
return response;
},
};
12 changes: 6 additions & 6 deletions components/cal_com/cal_com.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ export default {
type: "app",
app: "cal_com",
propDefinitions: {
booking: {
bookingId: {
type: "string",
label: "Booking",
description: "The booking to retrieve",
label: "Booking ID",
description: "The identifier of the booking to retrieve",
async options({ filterCancelled = false }) {
const { bookings = [] } = await this.listBookings();
const filteredBookings = filterCancelled
Expand All @@ -24,10 +24,10 @@ export default {
}));
},
},
eventType: {
eventTypeId: {
type: "string",
label: "Event Type",
description: "Event type of the new booking",
label: "Event Type ID",
description: "The identifier of the event type of the new booking",
async options() {
const { event_types: eventTypes } = await this.listEventTypes();
return eventTypes.map((type) => ({
Expand Down
4 changes: 2 additions & 2 deletions components/cal_com/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/cal_com",
"version": "0.0.4",
"version": "0.0.5",
"description": "Pipedream Cal.com Components",
"main": "cal_com.app.mjs",
"keywords": [
Expand All @@ -13,7 +13,7 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^1.1.1",
"@pipedream/platform": "^3.0.3",
"async-retry": "^1.3.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
export default {
...common,
key: "cal_com-booking-cancelled",
name: "Booking Cancelled",

Check warning on line 6 in components/cal_com/sources/booking-cancelled/booking-cancelled.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new event when a booking is cancelled.",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "cal_com-booking-created",
name: "New Booking Created",
description: "Emit new event when a new booking is created.",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
methods: {
Expand Down
2 changes: 1 addition & 1 deletion components/cal_com/sources/booking-ended/booking-ended.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
export default {
...common,
key: "cal_com-booking-ended",
name: "Booking Ended",

Check warning on line 6 in components/cal_com/sources/booking-ended/booking-ended.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new event when a booking ends.",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
export default {
...common,
key: "cal_com-booking-rescheduled",
name: "Booking Rescheduled",

Check warning on line 6 in components/cal_com/sources/booking-rescheduled/booking-rescheduled.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new event when a booking is rescheduled.",
version: "0.0.1",
version: "0.0.2",
type: "source",
dedupe: "unique",
methods: {
Expand Down
18 changes: 8 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading