Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(cal-com): ui improvement (#16781)

Talal Jabera3fddc5fab10
diff --git a/bun.lock b/bun.lock
index 623406f789c..0f0594dd4db 100644
--- a/bun.lock
+++ b/bun.lock
@@ -1515,7 +1515,7 @@
},
"packages/pieces/community/cal-com": {
"name": "@activepieces/piece-cal-com",
- "version": "0.5.0",
+ "version": "0.6.0",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
diff --git a/packages/pieces/community/cal-com/package.json b/packages/pieces/community/cal-com/package.json
index 0bbc3ad9101..f908b477128 100644
--- a/packages/pieces/community/cal-com/package.json
+++ b/packages/pieces/community/cal-com/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-cal-com",
- "version": "0.5.0",
+ "version": "0.6.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
diff --git a/packages/pieces/community/cal-com/src/i18n/de.json b/packages/pieces/community/cal-com/src/i18n/de.json
index 02fd992ffb1..a00961642ef 100644
--- a/packages/pieces/community/cal-com/src/i18n/de.json
+++ b/packages/pieces/community/cal-com/src/i18n/de.json
@@ -6,5 +6,12 @@
"Booking Rescheduled": "Buchung neu geplant",
"Create a webhook to monitor when Booking Cancelled": "Erstellen Sie einen Webhook zum Überwachen bei Stornierung der Buchung",
"Create a webhook to monitor when Booking Created": "Erstellen Sie einen Webhook zum Überwachen bei der Buchung",
- "Create a webhook to monitor when Booking Rescheduled": "Erstellen Sie einen Webhook um zu überwachen, wenn die Buchung neu geplant wird"
+ "Create a webhook to monitor when Booking Rescheduled": "Erstellen Sie einen Webhook um zu überwachen, wenn die Buchung neu geplant wird",
+ "To get your API key:\n1. Open [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) in Cal.com.\n2. Create a new key and choose when it expires.\n3. Copy the key (it starts with `cal_`) and paste it here.": "So erhalten Sie Ihren API-Schlüssel:\n1. Öffnen Sie in Cal.com [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys).\n2. Erstellen Sie einen neuen Schlüssel und legen Sie fest, wann er abläuft.\n3. Kopieren Sie den Schlüssel (er beginnt mit `cal_`) und fügen Sie ihn hier ein.",
+ "Add cal-api-version (2026-05-01 for /bookings). Auth is added for you.": "Fügen Sie cal-api-version hinzu (2026-05-01 für /bookings). Die Authentifizierung wird automatisch ergänzt.",
+ "New Booking": "Neue Buchung",
+ "Triggers when a Cal.com booking is cancelled.": "Wird ausgelöst, wenn eine Cal.com-Buchung storniert wird.",
+ "Triggers when someone books a meeting with you on Cal.com.": "Wird ausgelöst, wenn jemand auf Cal.com einen Termin bei Ihnen bucht.",
+ "Triggers when a Cal.com booking is moved to a new time.": "Wird ausgelöst, wenn eine Cal.com-Buchung auf eine neue Zeit verschoben wird.",
+ "This webhook is added to your Cal.com account when you publish the flow and removed when you turn it off. It fires for bookings on the account that owns the API key.": "Dieser Webhook wird beim Veröffentlichen des Flows zu Ihrem Cal.com-Konto hinzugefügt und beim Ausschalten wieder entfernt. Er wird für Buchungen des Kontos ausgelöst, dem der API-Schlüssel gehört."
}
\ No newline at end of file
diff --git a/packages/pieces/community/cal-com/src/i18n/es.json b/packages/pieces/community/cal-com/src/i18n/es.json
index c996b9577cb..60a6c826207 100644
--- a/packages/pieces/community/cal-com/src/i18n/es.json
+++ b/packages/pieces/community/cal-com/src/i18n/es.json
@@ -6,5 +6,12 @@
"Booking Rescheduled": "Reserva reprogramada",
"Create a webhook to monitor when Booking Cancelled": "Crear un webhook para monitorear cuando se cancele la reserva",
"Create a webhook to monitor when Booking Created": "Crear un webhook para monitorear al realizar la reserva",
- "Create a webhook to monitor when Booking Rescheduled": "Crear un webhook para monitorear cuando la reserva se reprograme"
+ "Create a webhook to monitor when Booking Rescheduled": "Crear un webhook para monitorear cuando la reserva se reprograme",
+ "To get your API key:\n1. Open [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) in Cal.com.\n2. Create a new key and choose when it expires.\n3. Copy the key (it starts with `cal_`) and paste it here.": "Para obtener tu clave API:\n1. Abre [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) en Cal.com.\n2. Crea una clave nueva y elige cuándo caduca.\n3. Copia la clave (empieza por `cal_`) y pégala aquí.",
+ "Add cal-api-version (2026-05-01 for /bookings). Auth is added for you.": "Añade cal-api-version (2026-05-01 para /bookings). La autenticación se añade automáticamente.",
+ "New Booking": "Nueva reserva",
+ "Triggers when a Cal.com booking is cancelled.": "Se activa cuando se cancela una reserva de Cal.com.",
+ "Triggers when someone books a meeting with you on Cal.com.": "Se activa cuando alguien reserva una reunión contigo en Cal.com.",
+ "Triggers when a Cal.com booking is moved to a new time.": "Se activa cuando una reserva de Cal.com se cambia a otra hora.",
+ "This webhook is added to your Cal.com account when you publish the flow and removed when you turn it off. It fires for bookings on the account that owns the API key.": "Este webhook se añade a tu cuenta de Cal.com al publicar el flujo y se elimina al desactivarlo. Se activa con las reservas de la cuenta propietaria de la clave API."
}
\ No newline at end of file
diff --git a/packages/pieces/community/cal-com/src/i18n/fr.json b/packages/pieces/community/cal-com/src/i18n/fr.json
index c583ad1c944..6111ad684c4 100644
--- a/packages/pieces/community/cal-com/src/i18n/fr.json
+++ b/packages/pieces/community/cal-com/src/i18n/fr.json
@@ -6,5 +6,12 @@
"Booking Rescheduled": "Réservation reprogrammée",
"Create a webhook to monitor when Booking Cancelled": "Créer un webhook à surveiller lors de l'annulation de la réservation",
"Create a webhook to monitor when Booking Created": "Créer un webhook à surveiller lors de la création d'une réservation",
- "Create a webhook to monitor when Booking Rescheduled": "Créer un webhook à surveiller lorsque la réservation est reprogrammée"
+ "Create a webhook to monitor when Booking Rescheduled": "Créer un webhook à surveiller lorsque la réservation est reprogrammée",
+ "To get your API key:\n1. Open [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) in Cal.com.\n2. Create a new key and choose when it expires.\n3. Copy the key (it starts with `cal_`) and paste it here.": "Pour obtenir votre clé API :\n1. Ouvrez [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) dans Cal.com.\n2. Créez une nouvelle clé et choisissez sa date d'expiration.\n3. Copiez la clé (elle commence par `cal_`) et collez-la ici.",
+ "Add cal-api-version (2026-05-01 for /bookings). Auth is added for you.": "Ajoutez cal-api-version (2026-05-01 pour /bookings). L'authentification est ajoutée pour vous.",
+ "New Booking": "Nouvelle réservation",
+ "Triggers when a Cal.com booking is cancelled.": "Se déclenche lorsqu'une réservation Cal.com est annulée.",
+ "Triggers when someone books a meeting with you on Cal.com.": "Se déclenche lorsqu'une personne réserve une réunion avec vous sur Cal.com.",
+ "Triggers when a Cal.com booking is moved to a new time.": "Se déclenche lorsqu'une réservation Cal.com est déplacée à un autre horaire.",
+ "This webhook is added to your Cal.com account when you publish the flow and removed when you turn it off. It fires for bookings on the account that owns the API key.": "Ce webhook est ajouté à votre compte Cal.com lorsque vous publiez le flux et supprimé lorsque vous le désactivez. Il se déclenche pour les réservations du compte propriétaire de la clé API."
}
\ No newline at end of file
diff --git a/packages/pieces/community/cal-com/src/i18n/ja.json b/packages/pieces/community/cal-com/src/i18n/ja.json
index fd93af900e5..5dc5a611544 100644
--- a/packages/pieces/community/cal-com/src/i18n/ja.json
+++ b/packages/pieces/community/cal-com/src/i18n/ja.json
@@ -6,5 +6,12 @@
"Booking Rescheduled": "予約の再スケジュール",
"Create a webhook to monitor when Booking Cancelled": "予約がキャンセルされたときに監視するWebhookを作成します",
"Create a webhook to monitor when Booking Created": "予約作成時にモニターするWebhookを作成する",
- "Create a webhook to monitor when Booking Rescheduled": "予約変更時に監視するWebhookを作成します"
+ "Create a webhook to monitor when Booking Rescheduled": "予約変更時に監視するWebhookを作成します",
+ "To get your API key:\n1. Open [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) in Cal.com.\n2. Create a new key and choose when it expires.\n3. Copy the key (it starts with `cal_`) and paste it here.": "API キーの取得方法:\n1. Cal.com で [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) を開きます。\n2. 新しいキーを作成し、有効期限を選びます。\n3. キー(`cal_` で始まります)をコピーしてここに貼り付けます。",
+ "Add cal-api-version (2026-05-01 for /bookings). Auth is added for you.": "cal-api-version を追加してください(/bookings には 2026-05-01)。認証は自動で追加されます。",
+ "New Booking": "新しい予約",
+ "Triggers when a Cal.com booking is cancelled.": "Cal.com の予約がキャンセルされたときにトリガーします。",
+ "Triggers when someone books a meeting with you on Cal.com.": "誰かが Cal.com であなたとのミーティングを予約したときにトリガーします。",
+ "Triggers when a Cal.com booking is moved to a new time.": "Cal.com の予約が別の時間に変更されたときにトリガーします。",
+ "This webhook is added to your Cal.com account when you publish the flow and removed when you turn it off. It fires for bookings on the account that owns the API key.": "この Webhook はフローを公開すると Cal.com アカウントに追加され、オフにすると削除されます。API キーを所有するアカウントの予約で発火します。"
}
\ No newline at end of file
diff --git a/packages/pieces/community/cal-com/src/i18n/nl.json b/packages/pieces/community/cal-com/src/i18n/nl.json
index 32728de9ffc..fc6e0229031 100644
--- a/packages/pieces/community/cal-com/src/i18n/nl.json
+++ b/packages/pieces/community/cal-com/src/i18n/nl.json
@@ -6,5 +6,12 @@
"Booking Rescheduled": "Boeking gerepareerd",
"Create a webhook to monitor when Booking Cancelled": "Maak een webhook om te monitoren wanneer je een reservering annuleert",
"Create a webhook to monitor when Booking Created": "Maak een webhook om te monitoren wanneer een reservering wordt gemaakt",
- "Create a webhook to monitor when Booking Rescheduled": "Maak een webhook om te monitoren bij Rescheduled"
+ "Create a webhook to monitor when Booking Rescheduled": "Maak een webhook om te monitoren bij Rescheduled",
+ "To get your API key:\n1. Open [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) in Cal.com.\n2. Create a new key and choose when it expires.\n3. Copy the key (it starts with `cal_`) and paste it here.": "Zo krijg je je API-sleutel:\n1. Open [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) in Cal.com.\n2. Maak een nieuwe sleutel aan en kies wanneer die verloopt.\n3. Kopieer de sleutel (begint met `cal_`) en plak hem hier.",
+ "Add cal-api-version (2026-05-01 for /bookings). Auth is added for you.": "Voeg cal-api-version toe (2026-05-01 voor /bookings). Authenticatie wordt automatisch toegevoegd.",
+ "New Booking": "Nieuwe boeking",
+ "Triggers when a Cal.com booking is cancelled.": "Wordt geactiveerd wanneer een Cal.com-boeking wordt geannuleerd.",
+ "Triggers when someone books a meeting with you on Cal.com.": "Wordt geactiveerd wanneer iemand via Cal.com een afspraak met je boekt.",
+ "Triggers when a Cal.com booking is moved to a new time.": "Wordt geactiveerd wanneer een Cal.com-boeking naar een ander tijdstip wordt verplaatst.",
+ "This webhook is added to your Cal.com account when you publish the flow and removed when you turn it off. It fires for bookings on the account that owns the API key.": "Deze webhook wordt aan je Cal.com-account toegevoegd wanneer je de flow publiceert en verwijderd wanneer je hem uitschakelt. Hij wordt geactiveerd voor boekingen van het account dat eigenaar is van de API-sleutel."
}
\ No newline at end of file
diff --git a/packages/pieces/community/cal-com/src/i18n/pt.json b/packages/pieces/community/cal-com/src/i18n/pt.json
index 3627e544b28..ca192f71285 100644
--- a/packages/pieces/community/cal-com/src/i18n/pt.json
+++ b/packages/pieces/community/cal-com/src/i18n/pt.json
@@ -6,5 +6,12 @@
"Booking Rescheduled": "Reserva reagendada",
"Create a webhook to monitor when Booking Cancelled": "Criar um webhook para monitorar quando a reserva foi cancelada",
"Create a webhook to monitor when Booking Created": "Criar um webhook para monitorar quando agendar criação",
- "Create a webhook to monitor when Booking Rescheduled": "Criar um webhook para monitorar quando agendar novamente"
+ "Create a webhook to monitor when Booking Rescheduled": "Criar um webhook para monitorar quando agendar novamente",
+ "To get your API key:\n1. Open [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) in Cal.com.\n2. Create a new key and choose when it expires.\n3. Copy the key (it starts with `cal_`) and paste it here.": "Para obter sua chave de API:\n1. Abra [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) no Cal.com.\n2. Crie uma nova chave e escolha quando ela expira.\n3. Copie a chave (começa com `cal_`) e cole aqui.",
+ "Add cal-api-version (2026-05-01 for /bookings). Auth is added for you.": "Adicione cal-api-version (2026-05-01 para /bookings). A autenticação é adicionada para você.",
+ "New Booking": "Nova reserva",
+ "Triggers when a Cal.com booking is cancelled.": "É acionado quando uma reserva do Cal.com é cancelada.",
+ "Triggers when someone books a meeting with you on Cal.com.": "É acionado quando alguém agenda uma reunião com você no Cal.com.",
+ "Triggers when a Cal.com booking is moved to a new time.": "É acionado quando uma reserva do Cal.com é remarcada para outro horário.",
+ "This webhook is added to your Cal.com account when you publish the flow and removed when you turn it off. It fires for bookings on the account that owns the API key.": "Este webhook é adicionado à sua conta do Cal.com quando você publica o fluxo e removido quando você o desativa. Ele é acionado para reservas da conta dona da chave de API."
}
\ No newline at end of file
diff --git a/packages/pieces/community/cal-com/src/i18n/ru.json b/packages/pieces/community/cal-com/src/i18n/ru.json
index 92a268c7bfb..940767094fc 100644
--- a/packages/pieces/community/cal-com/src/i18n/ru.json
+++ b/packages/pieces/community/cal-com/src/i18n/ru.json
@@ -7,5 +7,12 @@
"Booking Rescheduled": "Бронирование перепланировано",
"Create a webhook to monitor when Booking Cancelled": "Создать вебхук для мониторинга при отмене бронирования",
"Create a webhook to monitor when Booking Created": "Создать вебхук для мониторинга при создании бронирования",
- "Create a webhook to monitor when Booking Rescheduled": "Создать вебхук для мониторинга при переходе бронирования"
+ "Create a webhook to monitor when Booking Rescheduled": "Создать вебхук для мониторинга при переходе бронирования",
+ "To get your API key:\n1. Open [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) in Cal.com.\n2. Create a new key and choose when it expires.\n3. Copy the key (it starts with `cal_`) and paste it here.": "Как получить ключ API:\n1. Откройте [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) в Cal.com.\n2. Создайте новый ключ и выберите срок его действия.\n3. Скопируйте ключ (он начинается с `cal_`) и вставьте его сюда.",
+ "Add cal-api-version (2026-05-01 for /bookings). Auth is added for you.": "Добавьте cal-api-version (2026-05-01 для /bookings). Авторизация добавляется автоматически.",
+ "New Booking": "Новое бронирование",
+ "Triggers when a Cal.com booking is cancelled.": "Срабатывает, когда бронирование в Cal.com отменено.",
+ "Triggers when someone books a meeting with you on Cal.com.": "Срабатывает, когда кто-то бронирует с вами встречу в Cal.com.",
+ "Triggers when a Cal.com booking is moved to a new time.": "Срабатывает, когда бронирование в Cal.com переносится на другое время.",
+ "This webhook is added to your Cal.com account when you publish the flow and removed when you turn it off. It fires for bookings on the account that owns the API key.": "Этот вебхук добавляется в ваш аккаунт Cal.com при публикации потока и удаляется при его отключении. Он срабатывает для бронирований аккаунта, которому принадлежит ключ API."
}
\ No newline at end of file
diff --git a/packages/pieces/community/cal-com/src/i18n/translation.json b/packages/pieces/community/cal-com/src/i18n/translation.json
index dc875ecb299..68560c5f28a 100644
--- a/packages/pieces/community/cal-com/src/i18n/translation.json
+++ b/packages/pieces/community/cal-com/src/i18n/translation.json
@@ -1,6 +1,6 @@
{
"Open-source alternative to Calendly": "Open-source alternative to Calendly",
- "API Key provided by cal.com": "API Key provided by cal.com",
+ "To get your API key:\n1. Open [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) in Cal.com.\n2. Create a new key and choose when it expires.\n3. Copy the key (it starts with `cal_`) and paste it here.": "To get your API key:\n1. Open [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) in Cal.com.\n2. Create a new key and choose when it expires.\n3. Copy the key (it starts with `cal_`) and paste it here.",
"List Event Types": "List Event Types",
"Get Event Type": "Get Event Type",
"Create Event Type": "Create Event Type",
@@ -141,7 +141,7 @@
"If set, replaces the entire weekly availability array, e.g. [{\"days\": [\"Monday\"], \"startTime\": \"09:00\", \"endTime\": \"17:00\"}].": "If set, replaces the entire weekly availability array, e.g. [{\"days\": [\"Monday\"], \"startTime\": \"09:00\", \"endTime\": \"17:00\"}].",
"If set, replaces the entire date-overrides array, e.g. [{\"date\": \"2026-05-20\", \"startTime\": \"12:00\", \"endTime\": \"13:00\"}].": "If set, replaces the entire date-overrides array, e.g. [{\"date\": \"2026-05-20\", \"startTime\": \"12:00\", \"endTime\": \"13:00\"}].",
"e.g. Monday.": "e.g. Monday.",
- "Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
+ "Add cal-api-version (2026-05-01 for /bookings). Auth is added for you.": "Add cal-api-version (2026-05-01 for /bookings). Auth is added for you.",
"Appended to the URL as ?key=value.": "Appended to the URL as ?key=value.",
"Enable for files like PDFs, images, etc.": "Enable for files like PDFs, images, etc.",
"On a failed request, output the error instead of failing the step.": "On a failed request, output the error instead of failing the step.",
@@ -165,9 +165,11 @@
"Request": "Request",
"Data to send": "Data to send",
"Booking Cancelled": "Booking Cancelled",
- "Booking Created": "Booking Created",
+ "New Booking": "New Booking",
"Booking Rescheduled": "Booking Rescheduled",
- "Create a webhook to monitor when Booking Cancelled": "Create a webhook to monitor when Booking Cancelled",
- "Create a webhook to monitor when Booking Created": "Create a webhook to monitor when Booking Created",
- "Create a webhook to monitor when Booking Rescheduled": "Create a webhook to monitor when Booking Rescheduled"
+ "Triggers when a Cal.com booking is cancelled.": "Triggers when a Cal.com booking is cancelled.",
+ "Triggers when someone books a meeting with you on Cal.com.": "Triggers when someone books a meeting with you on Cal.com.",
+ "Triggers when a Cal.com booking is moved to a new time.": "Triggers when a Cal.com booking is moved to a new time.",
+ "Markdown": "Markdown",
+ "This webhook is added to your Cal.com account when you publish the flow and removed when you turn it off. It fires for bookings on the account that owns the API key.": "This webhook is added to your Cal.com account when you publish the flow and removed when you turn it off. It fires for bookings on the account that owns the API key."
}
\ No newline at end of file
diff --git a/packages/pieces/community/cal-com/src/lib/actions/index.ts b/packages/pieces/community/cal-com/src/lib/actions/index.ts
index 5569fc05375..86c496938f1 100644
--- a/packages/pieces/community/cal-com/src/lib/actions/index.ts
+++ b/packages/pieces/community/cal-com/src/lib/actions/index.ts
@@ -1,5 +1,6 @@
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import { calcomAuth } from '../auth';
+import { calcomCommon } from '../common';
import { calcomListEventTypes } from './list-event-types';
import { calcomGetEventType } from './get-event-type';
import { calcomCreateEventType } from './create-event-type';
@@ -53,10 +54,19 @@ export const actions = [
calcomUpdateMyProfile,
calcomListTeams,
createCustomApiCallAction({
- baseUrl: () => 'https://api.cal.com/v2',
+ baseUrl: () => calcomCommon.baseUrl,
auth: calcomAuth,
authMapping: async (auth) => ({
Authorization: `Bearer ${auth.secret_text}`,
}),
+ props: {
+ url: {
+ description: `Full URL, or a path relative to ${calcomCommon.baseUrl}`,
+ placeholder: '/me',
+ },
+ headers: {
+ description: `Add cal-api-version (${calcomCommon.versions.bookingsList} for /bookings). Auth is added for you.`,
+ },
+ },
}),
];
diff --git a/packages/pieces/community/cal-com/src/lib/auth.ts b/packages/pieces/community/cal-com/src/lib/auth.ts
index 7998f10437e..883adf9c218 100644
--- a/packages/pieces/community/cal-com/src/lib/auth.ts
+++ b/packages/pieces/community/cal-com/src/lib/auth.ts
@@ -2,6 +2,9 @@ import { PieceAuth } from '@activepieces/pieces-framework';
export const calcomAuth = PieceAuth.SecretText({
displayName: 'API Key',
- description: 'API Key provided by cal.com',
+ description: `To get your API key:
+1. Open [Settings → Developer → API Keys](https://app.cal.com/settings/developer/api-keys) in Cal.com.
+2. Create a new key and choose when it expires.
+3. Copy the key (it starts with \`cal_\`) and paste it here.`,
required: true,
});
diff --git a/packages/pieces/community/cal-com/src/lib/common/client.ts b/packages/pieces/community/cal-com/src/lib/common/client.ts
index 7cd3ebbbb81..0cd04280cd9 100644
--- a/packages/pieces/community/cal-com/src/lib/common/client.ts
+++ b/packages/pieces/community/cal-com/src/lib/common/client.ts
@@ -109,6 +109,7 @@ async function calRequestPaginated<T>(
}
export const calcomCommon = {
+ baseUrl: 'https://api.cal.com/v2',
calRequest,
calRequestPaginated,
versions: {
diff --git a/packages/pieces/community/cal-com/src/lib/triggers/index.ts b/packages/pieces/community/cal-com/src/lib/triggers/index.ts
index e93690550da..fdb7f2f7877 100644
--- a/packages/pieces/community/cal-com/src/lib/triggers/index.ts
+++ b/packages/pieces/community/cal-com/src/lib/triggers/index.ts
@@ -6,6 +6,7 @@ export const triggers = [
{
type: EventTrigger.BOOKING_CANCELLED,
displayName: 'Booking Cancelled',
+ description: 'Triggers when a Cal.com booking is cancelled.',
sampleData: {
triggerEvent: 'BOOKING_CANCELLED',
createdAt: '2023-02-18T12:11:37.975Z',
@@ -50,7 +51,8 @@ export const triggers = [
},
{
type: EventTrigger.BOOKING_CREATED,
- displayName: 'Booking Created',
+ displayName: 'New Booking',
+ description: 'Triggers when someone books a meeting with you on Cal.com.',
sampleData: {
triggerEvent: 'BOOKING_CREATED',
createdAt: '2023-02-18T11:54:18.440Z',
@@ -126,6 +128,7 @@ export const triggers = [
{
type: EventTrigger.BOOKING_RESCHEDULED,
displayName: 'Booking Rescheduled',
+ description: 'Triggers when a Cal.com booking is moved to a new time.',
sampleData: {
triggerEvent: 'BOOKING_RESCHEDULED',
createdAt: '2023-02-18T12:11:26.909Z',
@@ -194,7 +197,7 @@ export const triggers = [
name: eventTrigger.type,
displayName: eventTrigger.displayName,
sampleData: eventTrigger.sampleData,
- description: `Create a webhook to monitor when ${eventTrigger.displayName}`,
+ description: eventTrigger.description,
outputSchema: bookingEventTriggerOutputSchema,
})
);
diff --git a/packages/pieces/community/cal-com/src/lib/triggers/register-webhook.ts b/packages/pieces/community/cal-com/src/lib/triggers/register-webhook.ts
index 767cc2784fd..233270449e8 100644
--- a/packages/pieces/community/cal-com/src/lib/triggers/register-webhook.ts
+++ b/packages/pieces/community/cal-com/src/lib/triggers/register-webhook.ts
@@ -1,14 +1,15 @@
import {
createTrigger,
OutputSchema,
- Trigger,
TriggerStrategy,
Property,
+ MarkdownVariant,
} from '@activepieces/pieces-framework';
import {
httpClient,
HttpRequest,
HttpMethod,
+ HttpError,
} from '@activepieces/pieces-common';
import { calcomAuth } from '../auth';
@@ -35,7 +36,13 @@ export const registerWebhooks = ({
displayName,
aiMetadata,
outputSchema,
- props: {},
+ props: {
+ webhook_info: Property.MarkDown({
+ value:
+ 'This webhook is added to your Cal.com account when you publish the flow and removed when you turn it off. It fires for bookings on the account that owns the API key.',
+ variant: MarkdownVariant.INFO,
+ }),
+ },
sampleData: sampleData,
type: TriggerStrategy.WEBHOOK,
async onEnable(context) {
@@ -80,11 +87,10 @@ export const registerWebhooks = ({
try {
await httpClient.sendRequest(request);
- } catch (e: any) {
- // 404 means the webhook was registered under the old v1 API and no
- // longer exists in v2 — safe to ignore, re-enabling will create a
- // fresh v2 webhook.
- if (e?.response?.status !== 404) throw e;
+ } catch (e) {
+ if (!(e instanceof HttpError) || e.response.status !== 404) {
+ throw e;
+ }
}
}
},