chore: import upstream snapshot with attribution
Publish CLI Package / publish-npm (push) Waiting to run
Publish Python SDK / publish-pypi (push) Waiting to run
Publish TypeScript SDK / publish-npm (push) Waiting to run
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:20:55 +08:00
commit d25d482dc2
13754 changed files with 4996608 additions and 0 deletions
@@ -0,0 +1,35 @@
import { CalComIcon } from '@/components/icons'
import { buildTriggerSubBlocks } from '@/triggers'
import {
buildCancelledOutputs,
calcomSetupInstructions,
calcomTriggerOptions,
calcomWebhookSecretField,
} from '@/triggers/calcom/utils'
import type { TriggerConfig } from '@/triggers/types'
export const calcomBookingCancelledTrigger: TriggerConfig = {
id: 'calcom_booking_cancelled',
name: 'CalCom Booking Cancelled',
provider: 'calcom',
description: 'Trigger workflow when a booking is cancelled in Cal.com',
version: '1.0.0',
icon: CalComIcon,
subBlocks: buildTriggerSubBlocks({
triggerId: 'calcom_booking_cancelled',
triggerOptions: calcomTriggerOptions,
setupInstructions: calcomSetupInstructions('cancelled'),
extraFields: [calcomWebhookSecretField('calcom_booking_cancelled')],
}),
outputs: buildCancelledOutputs(),
webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Cal-Signature-256': '<hmac-sha256-hex>',
},
},
}
@@ -0,0 +1,36 @@
import { CalComIcon } from '@/components/icons'
import { buildTriggerSubBlocks } from '@/triggers'
import {
buildBookingOutputs,
calcomSetupInstructions,
calcomTriggerOptions,
calcomWebhookSecretField,
} from '@/triggers/calcom/utils'
import type { TriggerConfig } from '@/triggers/types'
export const calcomBookingCreatedTrigger: TriggerConfig = {
id: 'calcom_booking_created',
name: 'CalCom Booking Created',
provider: 'calcom',
description: 'Trigger workflow when a new booking is created in Cal.com',
version: '1.0.0',
icon: CalComIcon,
subBlocks: buildTriggerSubBlocks({
triggerId: 'calcom_booking_created',
triggerOptions: calcomTriggerOptions,
includeDropdown: true,
setupInstructions: calcomSetupInstructions('created'),
extraFields: [calcomWebhookSecretField('calcom_booking_created')],
}),
outputs: buildBookingOutputs(),
webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Cal-Signature-256': '<hmac-sha256-hex>',
},
},
}
+35
View File
@@ -0,0 +1,35 @@
import { CalComIcon } from '@/components/icons'
import { buildTriggerSubBlocks } from '@/triggers'
import {
buildPaidOutputs,
calcomSetupInstructions,
calcomTriggerOptions,
calcomWebhookSecretField,
} from '@/triggers/calcom/utils'
import type { TriggerConfig } from '@/triggers/types'
export const calcomBookingPaidTrigger: TriggerConfig = {
id: 'calcom_booking_paid',
name: 'CalCom Booking Paid',
provider: 'calcom',
description: 'Trigger workflow when payment is completed for a paid booking',
version: '1.0.0',
icon: CalComIcon,
subBlocks: buildTriggerSubBlocks({
triggerId: 'calcom_booking_paid',
triggerOptions: calcomTriggerOptions,
setupInstructions: calcomSetupInstructions('paid'),
extraFields: [calcomWebhookSecretField('calcom_booking_paid')],
}),
outputs: buildPaidOutputs(),
webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Cal-Signature-256': '<hmac-sha256-hex>',
},
},
}
@@ -0,0 +1,35 @@
import { CalComIcon } from '@/components/icons'
import { buildTriggerSubBlocks } from '@/triggers'
import {
buildRejectedOutputs,
calcomSetupInstructions,
calcomTriggerOptions,
calcomWebhookSecretField,
} from '@/triggers/calcom/utils'
import type { TriggerConfig } from '@/triggers/types'
export const calcomBookingRejectedTrigger: TriggerConfig = {
id: 'calcom_booking_rejected',
name: 'CalCom Booking Rejected',
provider: 'calcom',
description: 'Trigger workflow when a booking request is rejected by the host',
version: '1.0.0',
icon: CalComIcon,
subBlocks: buildTriggerSubBlocks({
triggerId: 'calcom_booking_rejected',
triggerOptions: calcomTriggerOptions,
setupInstructions: calcomSetupInstructions('rejected'),
extraFields: [calcomWebhookSecretField('calcom_booking_rejected')],
}),
outputs: buildRejectedOutputs(),
webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Cal-Signature-256': '<hmac-sha256-hex>',
},
},
}
@@ -0,0 +1,35 @@
import { CalComIcon } from '@/components/icons'
import { buildTriggerSubBlocks } from '@/triggers'
import {
buildRequestedOutputs,
calcomSetupInstructions,
calcomTriggerOptions,
calcomWebhookSecretField,
} from '@/triggers/calcom/utils'
import type { TriggerConfig } from '@/triggers/types'
export const calcomBookingRequestedTrigger: TriggerConfig = {
id: 'calcom_booking_requested',
name: 'CalCom Booking Requested',
provider: 'calcom',
description: 'Trigger workflow when a booking request is submitted (pending confirmation)',
version: '1.0.0',
icon: CalComIcon,
subBlocks: buildTriggerSubBlocks({
triggerId: 'calcom_booking_requested',
triggerOptions: calcomTriggerOptions,
setupInstructions: calcomSetupInstructions('requested'),
extraFields: [calcomWebhookSecretField('calcom_booking_requested')],
}),
outputs: buildRequestedOutputs(),
webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Cal-Signature-256': '<hmac-sha256-hex>',
},
},
}
@@ -0,0 +1,35 @@
import { CalComIcon } from '@/components/icons'
import { buildTriggerSubBlocks } from '@/triggers'
import {
buildRescheduledOutputs,
calcomSetupInstructions,
calcomTriggerOptions,
calcomWebhookSecretField,
} from '@/triggers/calcom/utils'
import type { TriggerConfig } from '@/triggers/types'
export const calcomBookingRescheduledTrigger: TriggerConfig = {
id: 'calcom_booking_rescheduled',
name: 'CalCom Booking Rescheduled',
provider: 'calcom',
description: 'Trigger workflow when a booking is rescheduled in Cal.com',
version: '1.0.0',
icon: CalComIcon,
subBlocks: buildTriggerSubBlocks({
triggerId: 'calcom_booking_rescheduled',
triggerOptions: calcomTriggerOptions,
setupInstructions: calcomSetupInstructions('rescheduled'),
extraFields: [calcomWebhookSecretField('calcom_booking_rescheduled')],
}),
outputs: buildRescheduledOutputs(),
webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Cal-Signature-256': '<hmac-sha256-hex>',
},
},
}
+9
View File
@@ -0,0 +1,9 @@
export { calcomBookingCancelledTrigger } from './booking_cancelled'
export { calcomBookingCreatedTrigger } from './booking_created'
export { calcomBookingPaidTrigger } from './booking_paid'
export { calcomBookingRejectedTrigger } from './booking_rejected'
export { calcomBookingRequestedTrigger } from './booking_requested'
export { calcomBookingRescheduledTrigger } from './booking_rescheduled'
export { calcomMeetingEndedTrigger } from './meeting_ended'
export { calcomRecordingReadyTrigger } from './recording_ready'
export { calcomWebhookTrigger } from './webhook'
+35
View File
@@ -0,0 +1,35 @@
import { CalComIcon } from '@/components/icons'
import { buildTriggerSubBlocks } from '@/triggers'
import {
buildMeetingEndedOutputs,
calcomSetupInstructions,
calcomTriggerOptions,
calcomWebhookSecretField,
} from '@/triggers/calcom/utils'
import type { TriggerConfig } from '@/triggers/types'
export const calcomMeetingEndedTrigger: TriggerConfig = {
id: 'calcom_meeting_ended',
name: 'CalCom Meeting Ended',
provider: 'calcom',
description: 'Trigger workflow when a Cal.com meeting ends',
version: '1.0.0',
icon: CalComIcon,
subBlocks: buildTriggerSubBlocks({
triggerId: 'calcom_meeting_ended',
triggerOptions: calcomTriggerOptions,
setupInstructions: calcomSetupInstructions('meeting_ended'),
extraFields: [calcomWebhookSecretField('calcom_meeting_ended')],
}),
outputs: buildMeetingEndedOutputs(),
webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Cal-Signature-256': '<hmac-sha256-hex>',
},
},
}
@@ -0,0 +1,35 @@
import { CalComIcon } from '@/components/icons'
import { buildTriggerSubBlocks } from '@/triggers'
import {
buildRecordingReadyOutputs,
calcomSetupInstructions,
calcomTriggerOptions,
calcomWebhookSecretField,
} from '@/triggers/calcom/utils'
import type { TriggerConfig } from '@/triggers/types'
export const calcomRecordingReadyTrigger: TriggerConfig = {
id: 'calcom_recording_ready',
name: 'CalCom Recording Ready',
provider: 'calcom',
description: 'Trigger workflow when a meeting recording is ready for download',
version: '1.0.0',
icon: CalComIcon,
subBlocks: buildTriggerSubBlocks({
triggerId: 'calcom_recording_ready',
triggerOptions: calcomTriggerOptions,
setupInstructions: calcomSetupInstructions('recording_ready'),
extraFields: [calcomWebhookSecretField('calcom_recording_ready')],
}),
outputs: buildRecordingReadyOutputs(),
webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Cal-Signature-256': '<hmac-sha256-hex>',
},
},
}
+664
View File
@@ -0,0 +1,664 @@
import type { SubBlockConfig } from '@/blocks/types'
import type { TriggerOutput } from '@/triggers/types'
/**
* Shared output property definitions for Cal.com trigger payloads.
*/
/**
* Organizer output definition with destructured properties
*/
const ORGANIZER_OUTPUT: TriggerOutput = {
type: 'object',
description: 'Organizer details',
properties: {
id: { type: 'number', description: 'Organizer user ID' },
name: { type: 'string', description: 'Organizer name' },
email: { type: 'string', description: 'Organizer email' },
username: { type: 'string', description: 'Organizer username' },
timeZone: { type: 'string', description: 'Organizer timezone' },
},
}
/**
* Attendees array output definition with destructured items
*/
const ATTENDEES_TRIGGER_OUTPUT: TriggerOutput = {
type: 'array',
description: 'List of attendees',
items: {
type: 'object',
properties: {
name: { type: 'string', description: 'Attendee name' },
email: { type: 'string', description: 'Attendee email' },
timeZone: { type: 'string', description: 'Attendee timezone' },
language: { type: 'string', description: 'Attendee language preference' },
},
},
}
export const calcomTriggerOptions = [
{ label: 'Booking Created', id: 'calcom_booking_created' },
{ label: 'Booking Cancelled', id: 'calcom_booking_cancelled' },
{ label: 'Booking Rescheduled', id: 'calcom_booking_rescheduled' },
{ label: 'Booking Requested', id: 'calcom_booking_requested' },
{ label: 'Booking Rejected', id: 'calcom_booking_rejected' },
{ label: 'Booking Paid', id: 'calcom_booking_paid' },
{ label: 'Meeting Ended', id: 'calcom_meeting_ended' },
{ label: 'Recording Ready', id: 'calcom_recording_ready' },
{ label: 'Generic Webhook (All Events)', id: 'calcom_webhook' },
]
/**
* Creates the webhook secret field subBlock for a CalCom trigger
*/
export function calcomWebhookSecretField(triggerId: string): SubBlockConfig {
return {
id: 'webhookSecret',
title: 'Webhook Secret',
type: 'short-input',
placeholder: 'Enter the same secret you configured in Cal.com',
description: 'Used to verify webhook requests via X-Cal-Signature-256 header.',
password: true,
required: false,
mode: 'trigger',
condition: {
field: 'selectedTriggerId',
value: triggerId,
},
}
}
/**
* Event type configuration for setup instructions
*/
type CalcomEventType =
| 'created'
| 'cancelled'
| 'rescheduled'
| 'requested'
| 'rejected'
| 'paid'
| 'meeting_ended'
| 'recording_ready'
| 'generic'
/**
* Generates setup instructions HTML for CalCom triggers
*/
export function calcomSetupInstructions(eventType: CalcomEventType): string {
const eventDescriptions: Record<CalcomEventType, string> = {
created: 'This webhook triggers when a new booking is created.',
cancelled: 'This webhook triggers when a booking is cancelled.',
rescheduled: 'This webhook triggers when a booking is rescheduled.',
requested:
'This webhook triggers when a booking request is submitted (for event types requiring confirmation).',
rejected: 'This webhook triggers when a booking request is rejected by the host.',
paid: 'This webhook triggers when payment is completed for a paid booking.',
meeting_ended: 'This webhook triggers when a meeting ends.',
recording_ready: 'This webhook triggers when a meeting recording is ready for download.',
generic: 'This webhook can receive any Cal.com event type you configure.',
}
const eventNames: Record<CalcomEventType, string> = {
created: 'BOOKING_CREATED',
cancelled: 'BOOKING_CANCELLED',
rescheduled: 'BOOKING_RESCHEDULED',
requested: 'BOOKING_REQUESTED',
rejected: 'BOOKING_REJECTED',
paid: 'BOOKING_PAID',
meeting_ended: 'MEETING_ENDED',
recording_ready: 'RECORDING_READY',
generic: 'your desired event type(s)',
}
return [
'Copy the webhook URL above.',
'Go to your <a href="https://app.cal.com/settings/developer/webhooks" target="_blank" rel="noopener noreferrer">Cal.com Webhook Settings</a>.',
'Click "New Webhook" and paste the URL.',
`Select the <strong>${eventNames[eventType]}</strong> event trigger.`,
eventDescriptions[eventType],
'If you add a secret key in Cal.com, enter the same secret in the <strong>Webhook Secret</strong> field above to verify webhook authenticity.',
]
.map(
(instruction, index) =>
`<div class="mb-3"><strong>${index + 1}.</strong> ${instruction}</div>`
)
.join('')
}
/**
* Builds common booking outputs for CalCom triggers
*/
export function buildBookingOutputs(): Record<string, TriggerOutput> {
return {
triggerEvent: {
type: 'string',
description: 'The webhook event type',
},
createdAt: {
type: 'string',
description: 'When the webhook event was created (ISO 8601)',
},
payload: {
title: {
type: 'string',
description: 'Booking title',
},
description: {
type: 'string',
description: 'Booking description',
},
eventTypeId: {
type: 'number',
description: 'Event type ID',
},
startTime: {
type: 'string',
description: 'Booking start time (ISO 8601)',
},
endTime: {
type: 'string',
description: 'Booking end time (ISO 8601)',
},
uid: {
type: 'string',
description: 'Unique booking identifier',
},
bookingId: {
type: 'number',
description: 'Numeric booking ID',
},
status: {
type: 'string',
description: 'Booking status',
},
location: {
type: 'string',
description: 'Meeting location or URL',
},
organizer: ORGANIZER_OUTPUT,
attendees: ATTENDEES_TRIGGER_OUTPUT,
responses: {
type: 'json',
description:
'Booking form responses (dynamic - fields depend on your event type configuration)',
},
metadata: {
type: 'json',
description:
'Custom metadata attached to the booking (dynamic - user-defined key-value pairs)',
},
videoCallData: {
type: 'json',
description: 'Video call details (structure varies by provider)',
},
},
} as any
}
/**
* Builds outputs specific to cancelled bookings
*/
export function buildCancelledOutputs(): Record<string, TriggerOutput> {
return {
triggerEvent: {
type: 'string',
description: 'The webhook event type',
},
createdAt: {
type: 'string',
description: 'When the webhook event was created (ISO 8601)',
},
payload: {
title: {
type: 'string',
description: 'Booking title',
},
description: {
type: 'string',
description: 'Booking description',
},
eventTypeId: {
type: 'number',
description: 'Event type ID',
},
startTime: {
type: 'string',
description: 'Booking start time (ISO 8601)',
},
endTime: {
type: 'string',
description: 'Booking end time (ISO 8601)',
},
uid: {
type: 'string',
description: 'Unique booking identifier',
},
bookingId: {
type: 'number',
description: 'Numeric booking ID',
},
status: {
type: 'string',
description: 'Booking status',
},
location: {
type: 'string',
description: 'Meeting location or URL',
},
cancellationReason: {
type: 'string',
description: 'Reason for cancellation',
},
organizer: ORGANIZER_OUTPUT,
attendees: ATTENDEES_TRIGGER_OUTPUT,
responses: {
type: 'json',
description: 'Booking form responses',
},
metadata: {
type: 'json',
description: 'Custom metadata attached to the booking',
},
},
} as any
}
/**
* Builds outputs specific to rescheduled bookings
*/
export function buildRescheduledOutputs(): Record<string, TriggerOutput> {
return {
triggerEvent: {
type: 'string',
description: 'The webhook event type',
},
createdAt: {
type: 'string',
description: 'When the webhook event was created (ISO 8601)',
},
payload: {
title: {
type: 'string',
description: 'Booking title',
},
description: {
type: 'string',
description: 'Booking description',
},
eventTypeId: {
type: 'number',
description: 'Event type ID',
},
startTime: {
type: 'string',
description: 'New booking start time (ISO 8601)',
},
endTime: {
type: 'string',
description: 'New booking end time (ISO 8601)',
},
uid: {
type: 'string',
description: 'Unique booking identifier',
},
bookingId: {
type: 'number',
description: 'Numeric booking ID',
},
status: {
type: 'string',
description: 'Booking status',
},
location: {
type: 'string',
description: 'Meeting location or URL',
},
rescheduleId: {
type: 'number',
description: 'Previous booking ID',
},
rescheduleUid: {
type: 'string',
description: 'Previous booking UID',
},
rescheduleStartTime: {
type: 'string',
description: 'Original start time (ISO 8601)',
},
rescheduleEndTime: {
type: 'string',
description: 'Original end time (ISO 8601)',
},
organizer: ORGANIZER_OUTPUT,
attendees: ATTENDEES_TRIGGER_OUTPUT,
responses: {
type: 'json',
description: 'Booking form responses',
},
metadata: {
type: 'json',
description: 'Custom metadata attached to the booking',
},
},
} as any
}
/**
* Builds outputs for booking requested events (pending confirmation)
*/
export function buildRequestedOutputs(): Record<string, TriggerOutput> {
return {
triggerEvent: {
type: 'string',
description: 'The webhook event type (BOOKING_REQUESTED)',
},
createdAt: {
type: 'string',
description: 'When the webhook event was created (ISO 8601)',
},
payload: {
title: {
type: 'string',
description: 'Booking title',
},
description: {
type: 'string',
description: 'Booking description',
},
eventTypeId: {
type: 'number',
description: 'Event type ID',
},
startTime: {
type: 'string',
description: 'Requested start time (ISO 8601)',
},
endTime: {
type: 'string',
description: 'Requested end time (ISO 8601)',
},
uid: {
type: 'string',
description: 'Unique booking identifier',
},
bookingId: {
type: 'number',
description: 'Numeric booking ID',
},
status: {
type: 'string',
description: 'Booking status (pending)',
},
location: {
type: 'string',
description: 'Meeting location or URL',
},
organizer: ORGANIZER_OUTPUT,
attendees: ATTENDEES_TRIGGER_OUTPUT,
responses: {
type: 'json',
description: 'Booking form responses',
},
metadata: {
type: 'json',
description: 'Custom metadata attached to the booking',
},
},
} as any
}
/**
* Builds outputs for booking rejected events
*/
export function buildRejectedOutputs(): Record<string, TriggerOutput> {
return {
triggerEvent: {
type: 'string',
description: 'The webhook event type (BOOKING_REJECTED)',
},
createdAt: {
type: 'string',
description: 'When the webhook event was created (ISO 8601)',
},
payload: {
title: {
type: 'string',
description: 'Booking title',
},
description: {
type: 'string',
description: 'Booking description',
},
eventTypeId: {
type: 'number',
description: 'Event type ID',
},
startTime: {
type: 'string',
description: 'Requested start time (ISO 8601)',
},
endTime: {
type: 'string',
description: 'Requested end time (ISO 8601)',
},
uid: {
type: 'string',
description: 'Unique booking identifier',
},
bookingId: {
type: 'number',
description: 'Numeric booking ID',
},
status: {
type: 'string',
description: 'Booking status (rejected)',
},
rejectionReason: {
type: 'string',
description: 'Reason for rejection provided by host',
},
organizer: ORGANIZER_OUTPUT,
attendees: ATTENDEES_TRIGGER_OUTPUT,
metadata: {
type: 'json',
description: 'Custom metadata attached to the booking',
},
},
} as any
}
/**
* Builds outputs for booking paid events
*/
export function buildPaidOutputs(): Record<string, TriggerOutput> {
return {
triggerEvent: {
type: 'string',
description: 'The webhook event type (BOOKING_PAID)',
},
createdAt: {
type: 'string',
description: 'When the webhook event was created (ISO 8601)',
},
payload: {
title: {
type: 'string',
description: 'Booking title',
},
description: {
type: 'string',
description: 'Booking description',
},
eventTypeId: {
type: 'number',
description: 'Event type ID',
},
startTime: {
type: 'string',
description: 'Booking start time (ISO 8601)',
},
endTime: {
type: 'string',
description: 'Booking end time (ISO 8601)',
},
uid: {
type: 'string',
description: 'Unique booking identifier',
},
bookingId: {
type: 'number',
description: 'Numeric booking ID',
},
status: {
type: 'string',
description: 'Booking status',
},
location: {
type: 'string',
description: 'Meeting location or URL',
},
payment: {
type: 'object',
description: 'Payment details',
properties: {
id: { type: 'string', description: 'Payment ID' },
amount: { type: 'number', description: 'Payment amount' },
currency: { type: 'string', description: 'Payment currency' },
success: { type: 'boolean', description: 'Whether payment succeeded' },
},
},
organizer: ORGANIZER_OUTPUT,
attendees: ATTENDEES_TRIGGER_OUTPUT,
metadata: {
type: 'json',
description: 'Custom metadata attached to the booking',
},
},
} as any
}
/**
* Builds outputs for meeting ended events
*/
export function buildMeetingEndedOutputs(): Record<string, TriggerOutput> {
return {
triggerEvent: {
type: 'string',
description: 'The webhook event type (MEETING_ENDED)',
},
createdAt: {
type: 'string',
description: 'When the webhook event was created (ISO 8601)',
},
payload: {
title: {
type: 'string',
description: 'Meeting title',
},
eventTypeId: {
type: 'number',
description: 'Event type ID',
},
startTime: {
type: 'string',
description: 'Meeting start time (ISO 8601)',
},
endTime: {
type: 'string',
description: 'Meeting end time (ISO 8601)',
},
uid: {
type: 'string',
description: 'Unique booking identifier',
},
bookingId: {
type: 'number',
description: 'Numeric booking ID',
},
duration: {
type: 'number',
description: 'Actual meeting duration in minutes',
},
organizer: ORGANIZER_OUTPUT,
attendees: ATTENDEES_TRIGGER_OUTPUT,
videoCallData: {
type: 'json',
description: 'Video call details',
},
},
} as any
}
/**
* Builds outputs for recording ready events
*/
export function buildRecordingReadyOutputs(): Record<string, TriggerOutput> {
return {
triggerEvent: {
type: 'string',
description: 'The webhook event type (RECORDING_READY)',
},
createdAt: {
type: 'string',
description: 'When the webhook event was created (ISO 8601)',
},
payload: {
title: {
type: 'string',
description: 'Meeting title',
},
eventTypeId: {
type: 'number',
description: 'Event type ID',
},
startTime: {
type: 'string',
description: 'Meeting start time (ISO 8601)',
},
endTime: {
type: 'string',
description: 'Meeting end time (ISO 8601)',
},
uid: {
type: 'string',
description: 'Unique booking identifier',
},
bookingId: {
type: 'number',
description: 'Numeric booking ID',
},
recordingUrl: {
type: 'string',
description: 'URL to download the recording',
},
transcription: {
type: 'string',
description: 'Meeting transcription text (if available)',
},
organizer: ORGANIZER_OUTPUT,
attendees: ATTENDEES_TRIGGER_OUTPUT,
},
} as any
}
/**
* Builds outputs for generic webhook (any event type)
*/
export function buildGenericOutputs(): Record<string, TriggerOutput> {
return {
triggerEvent: {
type: 'string',
description: 'The webhook event type (e.g., BOOKING_CREATED, MEETING_ENDED)',
},
createdAt: {
type: 'string',
description: 'When the webhook event was created (ISO 8601)',
},
payload: {
type: 'json',
description: 'Complete webhook payload (structure varies by event type)',
},
}
}
+40
View File
@@ -0,0 +1,40 @@
import { CalComIcon } from '@/components/icons'
import { buildTriggerSubBlocks } from '@/triggers'
import {
buildGenericOutputs,
calcomSetupInstructions,
calcomTriggerOptions,
calcomWebhookSecretField,
} from '@/triggers/calcom/utils'
import type { TriggerConfig } from '@/triggers/types'
/**
* Generic Cal.com webhook trigger that accepts any event type.
* Use this when you need to handle events not covered by specific triggers,
* or when you want to receive multiple event types on the same webhook.
*/
export const calcomWebhookTrigger: TriggerConfig = {
id: 'calcom_webhook',
name: 'CalCom Webhook (All Events)',
provider: 'calcom',
description: 'Trigger workflow on any Cal.com webhook event (configure event types in Cal.com)',
version: '1.0.0',
icon: CalComIcon,
subBlocks: buildTriggerSubBlocks({
triggerId: 'calcom_webhook',
triggerOptions: calcomTriggerOptions,
setupInstructions: calcomSetupInstructions('generic'),
extraFields: [calcomWebhookSecretField('calcom_webhook')],
}),
outputs: buildGenericOutputs(),
webhook: {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Cal-Signature-256': '<hmac-sha256-hex>',
},
},
}