refactor: Cal.diy (#28903)

* feat: Cal.diy — community-driven MIT-licensed fork of Cal.com

This squashed commit contains all Cal.diy changes applied on top of calcom/cal.com main:

- Rebrand Cal.com to Cal.diy across the entire codebase
- Remove Enterprise Edition (EE) features, license checks, and AGPL restrictions
- Switch license from AGPL-3.0 to MIT
- Remove docs/ directory (migrated to Nextra at cal.diy)
- Remove dead code: org tests, EE tips, platform nav, premium username, SAML/SSO, etc.
- Clean up .env.example for self-hosted Cal.diy
- Update Docker image references to calcom/cal.diy
- Update README, CONTRIBUTING.md, and issue templates for Cal.diy community fork
- Add PR welcome bot for Cal.diy contributors
- Fix API v2 breaking changes oasdiff ignore entries
- Replace Blacksmith CI runners with default GitHub Actions

3893 files changed, 20789 insertions(+), 411020 deletions(-)

Co-Authored-By: [email protected] <[email protected]>

* refactor: remove org-specific /organizations/:orgId endpoints from API v2 atoms controllers (#1701)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix: revert Cal.diy Inc to Cal.com, Inc. in license files, copyright notices, and package metadata (#1702)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* rip out org related comments in api v2

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Benny JooandDevin AI authored and GitHub committed 2026-04-15 09:52:36 -03:00
1 parent a17f28e9ab
commit ab21c7f805
4080 files changed
+14403 -404922

No files matched your search

-40
View File
@@ -1,40 +0,0 @@
# CLAUDE.md — Workflow Translation
## Project Context
Add auto-translation for workflow body and subject using lingo.dev, matching the existing event type translation pattern.
## Before Starting Work
1. Read specs/workflow-translation/design.md
2. Check specs/workflow-translation/implementation.md for current progress
3. Study existing patterns in:
- `packages/features/tasker/tasks/translateEventTypeData.ts`
- `packages/features/eventTypeTranslation/repositories/EventTypeTranslationRepository.ts`
- `packages/lib/server/service/lingoDotDev.ts`
## Code Patterns
**Repository pattern**: Follow `EventTypeTranslationRepository` for DB operations
**Tasker pattern**: Follow `translateEventTypeData.ts` for async translation task
**Translation lookup**: In email/SMS services, lookup translation before `customTemplate()` call
## Reference Files
| Purpose | File |
|---------|------|
| Lingo.dev service | `packages/lib/server/service/lingoDotDev.ts` |
| Event type translation task | `packages/features/tasker/tasks/translateEventTypeData.ts` |
| Event type translation repo | `packages/features/eventTypeTranslation/repositories/EventTypeTranslationRepository.ts` |
| Email workflow service | `packages/features/ee/workflows/lib/service/EmailWorkflowService.ts` |
| SMS manager | `packages/features/ee/workflows/lib/reminders/smsReminderManager.ts` |
| Workflow update handler | `packages/trpc/server/routers/viewer/workflows/update.handler.ts` |
## Don't
- Don't translate default templates (REMINDER, RATING) - they use i18n
- Don't support non-attendee actions (no locale available)
- Don't add features not in design.md
- Don't skip updating implementation.md after each piece
-42
View File
@@ -1,42 +0,0 @@
# Workflow Translation Decisions
## ADR-001: Pre-translate vs On-demand Translation
### Context
Need to decide when translations are generated - at workflow save time or at send time.
### Options Considered
1. **On-demand at send time** — Translate when sending to attendee, cache for reuse
- Pros: Fewer API calls, no unused translations
- Cons: Slight delay on first send to new locale
2. **Pre-translate at save time** — Translate to all 19 locales when workflow saved
- Pros: No delay at send time, matches event type pattern
- Cons: More upfront API calls
### Decision
Pre-translate at save time (option 2) to match the existing event type translation pattern and ensure no delay when sending notifications.
### Consequences
- Translations generated via async tasker task when workflow step is saved
- ~36 API calls per workflow step (18 locales × 2 fields)
- Database stores all translations upfront
## ADR-002: Organization-only Feature
### Context
Need to decide if feature is available to all users or restricted.
### Decision
Organization users only, matching the event type auto-translation feature.
### Consequences
- UI toggle only shown for org users
- Handler checks `ctx.user.organizationId` before triggering translation
-102
View File
@@ -1,102 +0,0 @@
# Workflow Translation Design
## Overview
Translate workflow `reminderBody` and `emailSubject` to the visitor's browser language using lingo.dev. Follows the existing pattern for event type title/description translation.
## Problem Statement
Workflow notifications are sent in the language they were written, not the attendee's language. Organizations need attendees to receive notifications in their preferred language.
## User Stories
- As an org admin, I want workflow notifications translated to the attendee's language so international attendees understand the message
- As an attendee, I want to receive booking notifications in my browser language
## Technical Design
### Database Changes
Add to `schema.prisma`:
```prisma
enum WorkflowStepAutoTranslatedField {
REMINDER_BODY
EMAIL_SUBJECT
}
model WorkflowStepTranslation {
uid String @id @default(cuid())
workflowStep WorkflowStep @relation(fields: [workflowStepId], references: [id], onDelete: Cascade)
workflowStepId Int
field WorkflowStepAutoTranslatedField
sourceLocale String
targetLocale String
translatedText String @db.Text
sourceHash String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([workflowStepId, field, targetLocale])
@@index([workflowStepId, field, targetLocale])
}
```
Add to WorkflowStep:
- `autoTranslateEnabled: Boolean @default(false)`
- `sourceLocale: String?`
- `translations: WorkflowStepTranslation[]`
### API Changes
**Workflow update handler** (`packages/trpc/server/routers/viewer/workflows/update.handler.ts`):
- Accept `autoTranslateEnabled` and `sourceLocale` fields
- Trigger `translateWorkflowStepData` tasker task when content changes
**New tasker task** (`packages/features/tasker/tasks/translateWorkflowStepData.ts`):
- Uses `TranslationService` to translate body/subject to 19 target locales
- Store translations in `WorkflowStepTranslation` table via repository
### TranslationService
Shared service at `packages/features/translation/services/TranslationService.ts`:
- `translateText()` - Translates text to all supported locales using LingoDotDevService
- `getWorkflowStepTranslations()` - Looks up cached translations for workflow steps
- `getEventTypeTranslations()` - Looks up cached translations for event types
- Uses DI pattern with repositories injected via constructor
### Send-Time Integration
**EmailWorkflowService** (`generateEmailPayloadForEvtWorkflow`):
- Uses `TranslationService.getWorkflowStepTranslations()` to lookup translation
- Fallback to original text if no translation found
**smsReminderManager** / **whatsappReminderManager**:
- Same pattern: uses TranslationService for attendee locale lookup
### UI Changes
**WorkflowStepContainer.tsx**:
- Add "Auto-translate for attendees" toggle
- Only show for org users and attendee-targeted actions
## Supported Locales
19 locales (same as event types):
en, es, de, pt, pt-BR, fr, it, ar, ru, zh-CN, zh-TW, ko, ja, nl, sv, da, is, lt, nb
## Scope
**Supported actions**: EMAIL_ATTENDEE, SMS_ATTENDEE, WHATSAPP_ATTENDEE
**Not supported**: EMAIL_HOST, EMAIL_ADDRESS, SMS_NUMBER (no attendee locale available)
## Out of Scope
- Form-based workflows (FORM_SUBMITTED triggers)
- CAL_AI_PHONE_CALL action
- Translation of default templates (already use i18n)
-39
View File
@@ -1,39 +0,0 @@
# Workflow Translation
## Overview
Auto-translate workflow notifications to the attendee's browser language using lingo.dev.
## How to Use
### Step 1: Enable Auto-translate
When editing a workflow step (EMAIL_ATTENDEE, SMS_ATTENDEE, or WHATSAPP_ATTENDEE), toggle "Auto-translate for attendees".
### Step 2: Translations Generated
Translations to 19 languages are generated automatically when you save the workflow.
### Step 3: Attendees Receive Translated Notifications
When a booking is made, the attendee receives notifications in their browser language (if supported).
## Configuration Options
| Option | Description | Default |
|--------|-------------|---------|
| Auto-translate for attendees | Enable/disable translation | Off |
## FAQ
### Which languages are supported?
English, Spanish, German, Portuguese, French, Italian, Arabic, Russian, Chinese (Simplified & Traditional), Japanese, Korean, Dutch, Swedish, Danish, Icelandic, Lithuanian, Norwegian.
### What happens if attendee's language isn't supported?
They receive the original notification in the language it was written.
### Are template variables translated?
No, variables like {EVENT_NAME} are preserved and substituted after translation.
Whitespace-only changes.
-16
View File
@@ -1,16 +0,0 @@
# Workflow Translation Future Work
Ideas and enhancements deferred from initial implementation.
## Enhancements
- Support form-based workflows (FORM_SUBMITTED) if submitter locale is captured
- Support EMAIL_ADDRESS action if recipient locale can be specified
- Translation preview in workflow editor
## Technical Debt
## Nice to Have
- Translation quality feedback mechanism
- Support for more locales beyond the initial 19
@@ -1,59 +0,0 @@
# Workflow Translation Implementation
## Status: complete
## Completed
- [x] Database schema: Added `WorkflowStepAutoTranslatedField` enum
- [x] Database schema: Added `WorkflowStepTranslation` model
- [x] Database schema: Added `autoTranslateEnabled`, `sourceLocale`, `translations` to WorkflowStep
- [x] Created WorkflowStepTranslationRepository (with DI/Prisma constructor injection)
- [x] Created translateWorkflowStepData tasker task
- [x] Integrated translation lookup in EmailWorkflowService
- [x] Integrated translation lookup in smsReminderManager
- [x] Integrated translation lookup in whatsappReminderManager
- [x] Updated workflow update handler to trigger translation
- [x] Added UI toggle in WorkflowStepContainer
- [x] Added unit tests
- [x] Created shared TranslationService with DI
## Files Changed
### New Files
- `packages/features/translation/services/TranslationService.ts` - Shared translation service
- `packages/features/translation/services/ITranslationService.ts` - Interface
- `packages/features/translation/di/tokens.ts` - DI tokens
- `packages/features/di/modules/TranslationService.ts` - DI module
- `packages/features/di/containers/TranslationService.ts` - DI container
- `packages/features/ee/workflows/repositories/WorkflowStepTranslationRepository.ts`
- `packages/features/ee/workflows/di/WorkflowStepTranslationRepository.module.ts` - DI module
- `packages/features/ee/workflows/di/WorkflowStepTranslationRepository.container.ts` - DI container
- `packages/features/tasker/tasks/translateWorkflowStepData.ts`
- `packages/features/tasker/tasks/translateWorkflowStepData.test.ts`
### Modified Files
- `packages/prisma/schema.prisma` - Added WorkflowStepTranslation model and WorkflowStep fields
- `packages/features/tasker/tasker.ts` - Register translateWorkflowStepData task
- `packages/features/tasker/tasks/index.ts` - Export translateWorkflowStepData
- `packages/features/ee/workflows/lib/service/EmailWorkflowService.ts` - Translation lookup at send time
- `packages/features/ee/workflows/lib/service/EmailWorkflowService.test.ts` - Auto translation tests
- `packages/features/ee/workflows/lib/reminders/smsReminderManager.ts` - Translation lookup
- `packages/features/ee/workflows/lib/reminders/emailReminderManager.ts` - Pass autoTranslateEnabled/sourceLocale
- `packages/features/ee/workflows/lib/scheduleBookingReminders.ts` - Pass fields to scheduleEmailReminder
- `packages/features/ee/workflows/lib/types.ts` - Added autoTranslateEnabled/sourceLocale to WorkflowStep type
- `packages/features/ee/workflows/lib/getAllWorkflows.ts` - Added fields to workflowSelect
- `packages/features/ee/workflows/lib/schema.ts` - Added fields to formSchema
- `packages/features/ee/workflows/lib/test/workflows.test.ts` - Added fields to test select
- `packages/features/ee/workflows/repositories/WorkflowReminderRepository.ts` - Added fields to findByIdIncludeStepAndWorkflow
- `packages/trpc/server/routers/viewer/workflows/update.schema.ts` - Added fields to step schema
- `packages/trpc/server/routers/viewer/workflows/update.handler.ts` - Org-only enforcement, trigger translation task
- `apps/web/modules/ee/workflows/components/WorkflowStepContainer.tsx` - UI toggle
- `apps/web/public/static/locales/en/common.json` - Translation strings
## Verification
- [ ] Run `yarn workspace @calcom/prisma db-migrate`
- [ ] Run `yarn prisma generate`
- [ ] Run `yarn type-check:ci --force`
-17
View File
@@ -1,17 +0,0 @@
# Workflow Translation Prompts
## Continue Feature
Continue working on workflow translation. Read specs/workflow-translation/implementation.md for current status.
## Sync Implementation Status
Review what's been implemented for workflow translation and update specs/workflow-translation/implementation.md
## Code Review
Review changes for: type safety, error handling, security, edge cases. Ensure it follows the event type translation pattern.
## Generate Tests
Write tests for workflow translation. Follow existing test patterns in packages/features/ee/workflows/.