* chore: Upgrade prisma to 6.7.0
* Build fixes
* type fixes
Signed-off-by: Omar López <zomars@me.com>
* Update schema.prisma
* Patching
* Revert "Update schema.prisma"
This reverts commit 47d8618bf89ef4d007b30084df766f17281e21a1.
* Revert "Patching"
This reverts commit a1d2e3040e71690a44d4324db95d73b4d68c6adb.
* Revert schema changes
Signed-off-by: Omar López <zomars@me.com>
* WIP
Signed-off-by: Omar López <zomars@me.com>
* Update getPublicEvent.ts
* Update imports
Signed-off-by: Omar López <zomars@me.com>
* Update gitignore
Signed-off-by: Omar López <zomars@me.com>
* update remaining imports
Signed-off-by: Omar López <zomars@me.com>
* Delete .cursor/config.json
* Discard changes to packages/features/eventtypes/lib/getPublicEvent.ts
* Update _get.ts
* Update user.ts
* Update .gitignore
* update
* Update WorkflowStepContainer.tsx
* Update next-auth-custom-adapter.ts
* Update getPublicEvent.ts
* Update workflow.ts
* Update next-auth-custom-adapter.ts
* Update next-auth-options.ts
* Update bookingScenario.ts
* fix missing imports
* upgrades prismock
Signed-off-by: Omar López <zomars@me.com>
* patches prismock
Signed-off-by: Omar López <zomars@me.com>
* Update reschedule.test.ts
* Update prisma.ts
* patch prismock
Signed-off-by: Omar López <zomars@me.com>
* fix enums imports
Signed-off-by: Omar López <zomars@me.com>
* Revert "Update prisma.ts"
This reverts commit 64edcf8db54171ff4456c209d563b5d431d99619.
* Revert "patch prismock"
This reverts commit e95819113dc9d88e7130947aa120cd42710977c8.
* fix patch
* Fix test that overrun the boundary, it shouldn't test too much
* Move prisma import to changeSMSLockState
* Bring back broken test without illegal imports
* Merge with main and fix filter hosts by same round robin host
* Fixed buildDryRunBooking fn tests
* Fix and move ooo create or update handler test
* Fix packages/features/eventtypes/lib/isCurrentlyAvailable.test.ts
* Fix packages/trpc/server/routers/viewer/organizations/listMembers.handler.test.ts
* Mock @calcom/prisma
* Fix: verify-email.test.ts
* fix: Moved WebhookService test and fixed default import mock
* Fix: Added missing prisma mock, handleNewBooking uses that of course
* We're not testing createContext here
* fix: Prisma mock fix for listMembers.test.ts
* More fixes to broken testcases
* Forgot to remove borked test
* Prevent the need to mock a lot of dependencies by moving out buildBaseWhereCondition to its own file
* Temporarily skip getCalendarEvents, needs a rewrite
* Fix: turns out you can access protected in testcases
* fix further mocks
* Added packages/features/insights/server/buildBaseWhereCondition.ts, types
* Always great to have a mock and then not use it
* And one less again.
* fix: confirm.handler.test, didn't mock prisma
* fix: Address minor nit by @eunjae & fix ImpersonationProvider test
* Updated isPrismaAvailableCheck that doesn't crash on import
* fix: Get Prisma directly from the client, it usually involves the Validator and does not need 'local' inclusion
* Add zod-prisma-types without the generator enabled (commented out)
* Uncomment and see what happens
* Change method of import as imports did not work in Input Schemas
* Remove custom 'zod' booking model, it does not belong with Prisma
* Fix all other global Model imports
* Rewrite most schema includes AND remove barrel file
* Add bookingCreateBodySchema to features/bookings
* Flurry of type fixes for compatibility with new zod gen
* Refactor out the custom prisma type createEventTypeInput
* Work around nullable eventTypeLocations
* HandlePayment type fix
* More fixes, final fix remaining is CompleteEventType
* Should fix a bunch more booking related type errors
* Missed one
* Some props missing from BookingCreateBodySchema
* Fix location type in handleChildrenEventTypes
* Little bit hacky imo but it works
* Final type error \o/
* Forgot to include Prisma
* Do not include zod-utils in booker/types
* Oops, was already including Booker/types
* Fix membership type, also disallow updating createdAt/updatedAt, make part of patch/post
* Fix api v1 type errors
* Fix EventTypeDescription typings
* Remove getParserWithGeneric, use userBodySchema with UserSchema
* use centralized timeZoneSchema
* Implement feedback by @zomars
* Couple of WIP pushes
* Fix tests
* Type fixes in `handleChildrenEventTypes` test
* Try and parse metadata before use
* Change zod-prisma-types configuration for optimal performance
* Fix prisma validator error in `prisma/selects/credential`
* Disable seperate relations model, hits a bug
* Import absolute - this makes rollup work in @platform/libraries
* Attempt at removing resolutions override
* Refactor using `Prisma.validator` to `satisfies`
* Build atoms using @calcom/prisma/client
* Build atoms using @calcom/prisma/client
* fixes
* Update eventTypeSelect.ts
* Adjust `eventTypeMetaDataSchemaWithUntypedApps` from `unknown` to `record(any)`
* `EventTypeDescription` rely on `descriptionAsSafeHTML` instead of `description`
* Add `seatsPerTimeSlot` to event type public select
* Fix typing in `users-public-view` getServerSide props
* Add missing `schedulingType` to prop
* chore: bump platform libraries
* Function return type is illegal, not sure how this passed eslint (#21567)
* Merged with main
* Update updateTokenObject.ts
* Update handleResponse.ts
* Update index.ts
* Update handleChildrenEventTypes.ts
* Update booking-idempotency-key.ts
* Update WebhookService.test.ts
* Update events.test.ts
* Update queued-response.test.ts
* Update events.test.ts
* Update getRoutedUrl.test.ts
* fix: type checks
Signed-off-by: Omar López <zomars@me.com>
* fixes
Signed-off-by: Omar López <zomars@me.com>
* chore: bump platform libraries
* Update yarn.lock
* more fixes
Signed-off-by: Omar López <zomars@me.com>
* fixes
Signed-off-by: Omar López <zomars@me.com>
* biuld fixes
* chore: bump platform libraries
* Update conferencing.repository.ts
* Update conferencing.repository.ts
* Update getCalendarsEvents.test.ts
* Update vite.config.js
* chore: bump platform libraries
* Update users.ts
* Discard changes to docs/api-reference/v2/openapi.json
* Update vite.config.ts
* updated platform libraries
* Update get.handler.test.ts
* Update get.handler.test.ts
* Update schema.prisma
* Discard changes to docs/api-reference/v2/openapi.json
* Update next-auth-custom-adapter.ts
* Update team.ts
* Flurry of type fixes
* Fix majority of insight related type errors
* Type fixes for unlink of account
* Make user nullable again
* Fixed a bunch of unit tests and one type error
* Attempted mock fix
* Attempted fix for Attribute type
* Ensure default import becomes prisma, but not direct usage
* Import default as prisma in prisma.module
* Add attributeOption to attribute type
* Fix calcom/prisma mock
* Refactor Prisma client imports to @calcom/prisma/client
Updated all imports from '@prisma/client' to '@calcom/prisma/client' across tests and repository files for consistency and to use the correct Prisma client package. This change improves maintainability and ensures the correct client is referenced throughout the codebase.
* Undo removal of max-warnings=0 to get main to merge
* Remove unit tests for e2e fixtures, provide new prisma mock
* Mock @calcom/prisma in event manager
* Mock @calcom/prisma in event manager
* Add correct format even with --no-verify
* Mock prisma in CalendarManager
* Add mock for permission-check.service
* Better injection in PrismaApiKeyRepository imports
* More mock fixes :)
* Fix listMembers.handler.test
* Fix User import
* Appropriately adjust all types to be imported as types, there were a lot of types imported as normal deps
* Why was this a thing?
* Strictly speaking; Not using prismock anymore
* Ditched patch file for prismock
* Fix output.service.ts platform type imports, need concrete for plainToClass
* Better typing and tests for unlinkConnectedAccount.handler
* Small type fix
* Disable calendar cache tests as they are dependent on prismock
* chore: bump platform lib
* getRoutedUrl test remove of unused import
* Extract select to external const on getEventTypesFromDB
* Direct select of userSelect from selects/user
* fix type error from merging 23653
* Fixed integration tests by removing hardcoded values that were possible due to mocking, but as its now directly hitting the db no longer
* fix: vite config atoms prisma client type location
* revert: example app prisma client
* revert: example app prisma client
* bump platform libs
* fix: use class instead of type for DI of PlatformBookingsService
* update platform libs
* remove unused variable
* chore: generate prisma client for api v2
* fix: api v2 e2e
* fix: atoms e2e
* fix: atoms e2e
* fix: atoms e2e
* fix: api v2 e2e
* fix: tsconfig apiv2 enums
* publish libraries
* Simplify check for existence teamId
---------
Signed-off-by: Omar López <zomars@me.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: Joe Au-Yeung <j.auyeung419@gmail.com>
Co-authored-by: supalarry <laurisskraucis@gmail.com>
Co-authored-by: cal.com <morgan@cal.com>
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
Co-authored-by: Benny Joo <sldisek783@gmail.com>
* refactor: separate task creation from processing to eliminate compilation overhead
- Create TaskProcessor class to handle task processing logic
- Move processQueue and cleanup methods to TaskProcessor
- Remove task handler imports from InternalTasker creation path
- Eliminate 2.5-3s compilation overhead by only loading task handlers during processing
- Maintain existing tasker.create() API for all callers
- Use composition pattern for clean separation of concerns
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
refactor: completely separate TaskProcessor from InternalTasker
- Remove processQueue() and cleanup() methods from Tasker interface
- Eliminate TaskProcessor dependency from InternalTasker class
- Update API endpoints (cron.ts, cleanup.ts) to use TaskProcessor directly
- Update README documentation to show correct TaskProcessor usage
- Complete separation ensures task creation no longer imports task handlers
- Eliminates 2.5-3s compilation overhead while preserving all functionality
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* Moved the cleanup method back to internal tasker
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* feat: optimize Prisma queries by replacing findFirst with findUnique where applicable
- Replace findFirst/findFirstOrThrow with findUnique/findUniqueOrThrow for queries using unique constraints
- Maintain existing functionality and error handling behavior
- Focus on queries using primary keys and unique index fields from schema
- Revert problematic changes that caused test failures to maintain stability
Co-Authored-By: benny@cal.com <benny@cal.com>
* revert: exclude API files from Prisma query optimizations per user request
- Reverted all 55 API-related files to their original state
- Kept all non-API Prisma query optimizations intact
- API files include apps/api/v1, apps/api/v2, apps/web/app/api, and packages/app-store/*/api
- Non-API optimizations remain for packages/lib, packages/features, apps/web (non-api), etc.
Co-Authored-By: benny@cal.com <benny@cal.com>
* feat: optimize membership query in attributeUtils to use findUnique with userId_teamId constraint
Co-Authored-By: benny@cal.com <benny@cal.com>
* revert: exclude test files from Prisma query optimizations per user request
Co-Authored-By: benny@cal.com <benny@cal.com>
* revert: revert attributeUtils.ts to use findFirst for test compatibility
Co-Authored-By: benny@cal.com <benny@cal.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: benny@cal.com <benny@cal.com>
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
* fix deleting reminders
* schedule reminders if iffy is disabled
* fix unit test
* clean up code
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
* Add Iffy API key variable
* WIP using Iffy to scan comments
* Use Iffy for workflow body scanning
* Update entity
* Clean up
* Update test
* Fix client id
* Fix test
* Add whitelistWorkflows to user
* Do not autolock whitelisted users
* Add endpoint to whitelist a user
* Get users data - include whitelistWorkflows
* Whitelist a user on the user admin page
* Fix typo
* Add test
* Use translations
* Add `updateWhitelistWorkflows` to `UserRepository`
* Use i18 for strings
* Rename to whitelistWorkflows
---------
Co-authored-by: Benny Joo <sldisek783@gmail.com>
* Add translations in respective files
* implement multilingual support for email templates
* fix: indentation in common.js & typos in common.js and update.handler.ts
* Add akismet package to tasker
* Create scanWorkflowBody task
* Schedule workflow body scan
* Add AKISMET_API_KEY .env
* Auto lock user if spam is detected
* Uncommit key
* Add safe param to workflow step
* Migration for safe field
* Do not process workflow steps is `safe` is false
* Update migration to set previous records to true
* Address comments
* Refactor `scheduleWorkflowNotifications` to accept an object
* If new steps or editing old ones send to tasker
* Call `scheduleWorkflowNotifications` in task
* Fix `IS_SELF_HOSTED`
* Remove unused function
* Make `safe` optional in schema
* Type fix
* Revert "Make `safe` optional in schema"
This reverts commit d0964702affa87c35562300301473d25635c565b.
* Revert "Type fix"
This reverts commit d9a031303269a2994ae46f576ab2a3d31e4d977b.
* Type fixes
* Type fixes
* Address comments
* Fix tests
* Add tests
* Update tests
* Typo fix
* Update `safe` to `verifiedAt`
* feat: Compare workflow reminder bodies to default template (#19060)
* Add `getTemplateForAction` function
* Use `getTemplateForAction` when creating a new step
* Use `getTemplateForAction` when action changes
* Have `emailReminderTemplate` accept an object as a param
* Rename `getTemplateForAction` to `getTemplateBodyForAction`
* Simplify changing body when changing templates
* Create `compareReminderBodyToTemplate`
* In task, compare if reminderBody is a template
* Linting
* Add tests
* refactor: `emailReminderTemplate` to accept object as param (#19288)
* Add `getTemplateForAction` function
* Use `getTemplateForAction` when creating a new step
* Use `getTemplateForAction` when action changes
* Have `emailReminderTemplate` accept an object as a param
* Rename `getTemplateForAction` to `getTemplateBodyForAction`
* Simplify changing body when changing templates
* Create `compareReminderBodyToTemplate`
* In task, compare if reminderBody is a template
* Linting
* Add tests
* Refactor `scheduleEmailReminders`
* Refactor `create.handler` for new workflows
* Refactor `emailReminderManager`
* Refactor `getEmailTemplateText`
* Fix typo
* Type fix - whatsapp plain text template imports
* Type fix - no template found
* Type fix - add `isBrandingDisabled` to `emailReminderTemplate`
* Add workflow and user to prisma mock
* Fix imports for akismet dependencies
* Record user lock reason
* Undo linting changes
* Fix tests
* New workflow, at verify created step
* Handle if `SCANNING_WORKFLOW_STEPS` is toggled
* Move `verifiedAt` checks to specific schedule functions
- `scheduleWhatsappReminder`
- `scheduleEmailReminder`
- `scheduleSMSReminder`
* Update logic
* Do not fallback verifiedAt
* Add comment to next.config.js
Found via `codespell -q 3 -S "*.svg,./apps/web/public/static/locales,./packages/app-store/stripepayment/lib/currencyOptions.ts,./packages/lib/freeEmailDomainCheck/freeEmailDomains.ts" -L afterall,atleast,datea,fo,incase,ist,nam,notin,optionel,perview,reccuring`
Closes#19219
* Add booking incomplete actions table
* Add incomplete booking page tab
* Add `getincompleteBookingSettings` trpc endpoints
* Add incomplete booking page
* Abstract enabled apps array
* Handle no enabled credentials and no actions
* Add enabled field to incomplete booking action db record
* Add new write record entries
* UI add separation between switch and inputs
* Fix typo
* clean up
* Add saveIncompleteBookingSettings endpoint
* Save incomplete booking settings
* Fix language around when to write to field
* Add `credentialId` to action record
* Choose which credential to assign to action
* Save credential to action
* Revert "Save credential to action"
This reverts commit ba6a1c808baed54f6d3d4c6155cf192c813d0696.
* Revert "Choose which credential to assign to action"
This reverts commit 968f6e5295d098c64abe95268afd1fa139a175ba.
* Revert "Add `credentialId` to action record"
This reverts commit 579f9ff4167b65aa987659e4e8f8c26f9e773317.
* Add credentialId to action record - rewrite migration file
* Revert "Add credentialId to action record - rewrite migration file"
This reverts commit 2843a92c61820e7f7a1614a557d3f7ea96342107.
* Revert "Add booking incomplete actions table"
This reverts commit 7ec75bef4a0f0a9d07be0142da64c49d739439ea.
* Revert "Add enabled field to incomplete booking action db record"
This reverts commit d279a1da05819eafa8fc5d664e3be733e0687e8d.
* Write migration in single commit
* Rename table
* Rename table - remove underscores
* Remove credential relationship
* Type fix - changing table name
* Fix table name
* Change writeToRecordObject to object
* Salesforce add incomplete booking, write to record
* Add incomplete booking actions to `triggerFormSubmittedNoEventWebhooks`
* Remove console.log
* Type fixes
* Type fixes
* Iterate if incompleteBookingActions
* Choose which credential to assign to action
* Save credential to action
* Fix getServerSideProp changes
* Type fix
* Type fix
* Type fix
* Type fix
---------
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* feat: AI description - DB model + frontend + backend (fetch only)
* fix types and add validation to backend
* improve log
* improve
* import type
* add EventTypeTranslationRepository
* fix replexica error
* fix replexica error
* fix
* fix test
* wip
* wip
* add createManyDescriptionTranslations method
* improve logic
* refactor
* update replexica type
* improve typing
* Renamed descriptionTranslations to fieldTranslations
* log errors in replexica service
* handle translations in background
* don't create, upsert instead
* make sure that description is updated
* simplify
* fix
* Update packages/trpc/server/routers/viewer/eventTypes/update.handler.ts
* improve filter logic in frontend
* implement background job using Tasker
* update schema
* update schema again
* rename
* rename id to uid
* add migration
* fix type
* update
* update schema and migration sql
* fix migration
* fix type check
* fix type check 2
* improve find logic in EventMeta
* add more validation
* add logger
* rename
* upgrade replexica/sdk to 0.7.0
* upgrade replexica to 0.7.0
* use batchLocalizeText
* add comments
* override browser locale if user is a signed in calcom user
* fix type in replexica
* fix migration sql
* fix type
* use dynamic import
* do not use batchLocalizeText
* chore: drop sourceLang, targetLang and id columns
* fix
* wip
* add more validations
* fix type error
* address comment
* refactor
* update booking page to use translated title
* fix type error
* fix
* revert yarn.lock changes
* remove unused import
* remove duplication migrate.sql file
* fix test
* remove test tags
* fix function name
* refactor
* fix type check
* use Promise.all
* remove unneeded code
---------
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
* fix: skip sending webhook in case of duplicate response
* fix: type err
* fix: tests
* refactor: only check email
* fix: type err
* chore: changed it to 60 min
* fix: use lowercase