* refactor: decouple @calcom/prisma from @calcom/features, @calcom/ee, and @calcom/lib
- Inline helper functions in zod-utils.ts (emailSchema, slugify, getValidRhfFieldName, isPasswordValid, intervalLimitsType, zodAttributesQueryValue)
- Update schema.prisma @zod.import comments to reference zod-utils instead of @calcom/lib
- Inline idempotency key generation in booking-idempotency-key extension using uuid v5
- Move usage-tracking extension to @calcom/ee/prisma-extensions/
- Remove usage-tracking extension from packages/prisma/index.ts
- Move Prisma DI module from @calcom/prisma to @calcom/features/di/modules/Prisma.ts
- Update 20 import paths in @calcom/features to use new Prisma DI module
- Remove @calcom/lib dependency from @calcom/prisma package.json
- Add uuid dependency to @calcom/prisma package.json
This reduces the dependency footprint of @calcom/prisma and breaks circular dependencies between packages.
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
* feat: add EE-specific Prisma DI module with usage tracking
Create packages/ee/di/modules/PrismaEE.ts to apply the usage-tracking extension in EE contexts. This module:
- Imports the base prisma client from @calcom/prisma
- Applies the usageTrackingExtention from @calcom/ee/prisma-extensions/usage-tracking
- Exports the same DI tokens as the base Prisma module for override in EE containers
This ensures usage tracking functionality is preserved in EE builds while keeping the base @calcom/prisma package free of EE dependencies.
Note: EE containers should load this module after the base Prisma module to override the bindings.
Co-Authored-By: Volnei Munhoz <volnei.munhoz@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* feat: add seed-all command to run all seed scripts
- Add seed-all command to packages/prisma/package.json
- Create scripts/seed-all.ts to run seed.ts, seed-insights.ts, and seed-pbac-organization.ts in sequence
- Update Prisma configuration to use seed-all as the default seed command
- Add GitHub workflow to test seed-all command with a real PostgreSQL database
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: use correct path resolution in seed-all script
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix: simplify database verification step in test workflow
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* refactor: use seed-all in cache-db action instead of separate workflow
- Update cache-db action to use seed-all command
- Remove test-seed-all.yml workflow as requested
Co-Authored-By: eunjae@cal.com <hey@eunjae.dev>
* fix error
* change command name
* fix integration tests
* run basic seed by default
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2025-10-28 10:56:52 +00:00
Keith WilliamsGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>cal.comMorgancubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* feat: upgrade Prisma to 6.16.0 with no-rust engine
- Update Prisma packages to 6.16.0
- Add PostgreSQL adapter dependency
- Configure engineType: 'client' and provider: 'prisma-client' in schema
- Update Prisma client instantiation with PostgreSQL adapter
- Remove binaryTargets from generators (not needed with library engine)
- Fix schema view issue by removing @id decorator from BookingTimeStatusDenormalized
- Fix ESLint warning by removing non-null assertion
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* Web app running but types wrecked
* web app running but build and type issues
* Removed the connection pool
* Fixed zod type issue
* Fixed types in booking reference extension
* Fixed test issues
* Type checks passing it seems
* Using cjs as moduleFormat
* Fixing Prisma undefined
* fix: update prismock initialization for Prisma 6.16 compatibility
- Add @prisma/internals dependency for getDMMF()
- Restructure prismock initialization to use createPrismock() with DMMF
- Create Proxy that's returned from mock factory for proper spy support
- Fixes 89 failing unit tests with 'Cannot read properties of undefined (reading datamodel)' error
- Based on workaround from prismock issue #1482
All unit tests now pass (375 test files, 3323 tests passed)
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: cast serviceAccountKey to Prisma.InputJsonValue in bookingScenario.ts
- Apply type cast at lines 2493 and 2535
- Fixes type errors from Prisma 6.16 upgrade
- Follows established pattern from delegationCredential.ts
- Add eslint-disable for pre-existing any types
- Rename unused appStoreLookupKey parameter to satisfy lint
- All 3323 tests passing
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* chore: remove whitespace-only lines from bookingScenario.ts
- Remove blank lines where eslint-disable comments were replaced
- Cleanup from pre-commit hook formatting
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* Update is-prisma-available-check.ts
* fix: remove datasources config when using Prisma Driver Adapters
- Update customPrisma to create new adapter when datasources URL is provided
- Remove datasources config from API v2 Prisma services (already in adapter)
- Fixes 'Custom datasource configuration is not compatible with Prisma Driver Adapters' error
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: use Pool instances for PrismaPg adapters in index.ts
- Create Pool instance before passing to PrismaPg adapter
- Update customPrisma to create Pool for custom connection strings
- Matches working pattern from API v2 services
- Fixes 'Invalid `prisma.$queryRawUnsafe()` invocation' error
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* Not using queryRawUnsafe
* Trying anything at this point
* Make sure the DB is ready first
* Don't auto run migrations in CI mode
* Revert "Make sure the DB is ready first"
This reverts commit 2b20bd45c974f3d7e07d8b904bc7fcdae37cce03.
* Dynamic import of prisma
* Commenting where it seems to break
* Backwards compatability for API v2
* fix: add explicit type annotations for map callbacks in API v2
- Add type annotation for map parameter in memberships.repository.ts
- Add type annotation for map parameter in stripe.service.ts
- Fixes implicit 'any' type errors from stricter Prisma 6.16.0 type inference
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: add explicit type annotations for API v2 map callbacks
- users.repository.ts:292: add Profile & { user: User } type
- memberships.service.ts:19-20: add Membership type to filter callbacks
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: add explicit type annotation for attributeToUser in organizations-users.repository.ts
- organizations-users.repository.ts:63: add AttributeToUser with nested relations type
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: add explicit Membership type annotations in teams.repository.ts
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: use API v2 dedicated Prisma client to support adapter in PrismaClientOptions
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* Running API v2 build commands together so they all get the space size var
* Fixing Maximum call depth exceeded error
* fixed type issues
* Trying to make the seed more stable
* Revert "Trying to make the seed more stable"
This reverts commit 1fd4495e6af7acd7981cda7dedec3168979b0e9d.
* Fixed path to prisma client
* Fixed type check
* Fix eslint warnings
* fix: externalize @prisma/adapter-pg and pg in platform-libraries Vite config
- Add @prisma/adapter-pg and pg to external dependencies list
- Add corresponding globals for these packages
- Fix Prisma client aliases to point to packages/prisma/client instead of node_modules
- Add Node.js resolve conditions to prefer Node.js exports
- Keep commonjsOptions.include for proper CommonJS transformation
- Add eslint-disable for __dirname in Vite config file
- Remove problematic prettier/prettier eslint comment
This fixes the 'Extensions.defineExtension is unable to run in this browser environment' error when running yarn generate-swagger in apps/api/v2 after upgrading to Prisma v6.16 with the no-rust engine approach.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: update Prisma imports in API v2 services to use package path
- Change imports from '../../../generated/prisma/client' to '@calcom/prisma/client'
- Fixes CI error: Cannot find module '../../../../../packages/prisma/generated/prisma/client.ts'
- Aligns with backwards compatibility re-export structure after Prisma v6.16 upgrade
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: remove .ts extension from Prisma client path mapping in tsconfig
- Remove file extension from @calcom/prisma/client path mapping
- Fixes runtime error: Cannot find module '../../../../../packages/prisma/generated/prisma/client.ts'
- TypeScript path mappings should not include file extensions per best practices
- Allows Node.js to correctly resolve to .js files at runtime
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: resolve Prisma 6.16.0 type incompatibilities in bookingScenario tests
- Changed InputPayment.data type from PaymentData to Prisma.InputJsonValue
- Changed createCredentials key parameter from JsonValue to InputJsonValue
- Removed unused PaymentData type definition
- Resolves type errors at lines 709 and 1088 without using 'as any' casts
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: remove non-existent Watchlist fields from test fixtures
- Remove createdById from isLockedOrBlocked.test.ts (lines 15, 20)
- Remove severity and createdById from _post.test.ts (line 110)
- These fields don't exist in Watchlist model schema after Prisma 6.16.0 upgrade
- Resolves TS2353 errors without using 'as any' casts
Relates to PR #23816
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: api v2 imports generated prisma and platform libraries
* fix: resolve type errors from Prisma 6.16 upgrade
- Add missing markdownToSafeHTML import in AppCard.tsx
- Fix organizationId null handling in fresh-booking.test.ts
- Remove non-existent createdById field from Watchlist test utils
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* Put back some external rollups
* Added back the resolve conditions
* Stop using Pool directly
* chore: remove prisma bookingReferenceExtension and update calls
* fix: organizations-admin-not-team-member-event-types.e2e-spec.ts
* chore: bring back POOL in api v2 prisma clients
* chore: remove Pool but await connect
* fixup! chore: remove Pool but await connect
* chore: bring back Pool on all clients
* chore: end pool manually
* chore: test with pool max 1
* chore: e2e test prisma max pool of 1 connection
* chore: give more control over pool for prisma module with env
* remove pool from base prisma client
* chore: prisma client in libraries use pool
* Fixed types
* chore: log pool events and improve pooling
* Fixing some types and tests
* Changing the parsing of USE_POOL
* fix: ensure Prisma client is connected before seeding to prevent transaction errors
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* chore: adjust pools
* chore: add process.env.USE_POOL to libraries vite config
* fix: v1 _patch reference check bookingRef on the booking find
* fix: v1 get references deleted null for system admin
* test: add integration tests for bookingReference soft-delete behavior
- Add bookingReference.integration-test.ts to test repository methods
- Add handleDeleteCredential.integration-test.ts to test credential deletion cascade
- Add booking-references.integration-test.ts for API v1 integration tests
- All tests verify soft-delete behavior without using mocks
- Tests use real database operations to ensure soft-deleted records persist
- Cover scenarios: replacing references, credential deletion, querying with filters
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* refactor: convert booking-references test to actual API endpoint testing
- Modified _get.ts to export handler function for testing
- Refactored integration test to call API handler instead of directly testing Prisma
- Added timestamps to test data to avoid conflicts
- Tests now verify API layer correctly filters soft-deleted references
- All 4 tests passing
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: add explicit prisma.$connect() call to seed-insights script
With Prisma 6.16 and the PostgreSQL adapter, scripts need to explicitly call $connect() before running database operations to ensure the connection pool is properly initialized. This prevents 'Transaction already closed' errors.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: add $connect() to main() execution in seed-insights
Both main() and createPerformanceData() entry points need explicit prisma.$connect() calls with the Prisma 6.16 PostgreSQL adapter.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: always use connection pool for Prisma PostgreSQL adapter
Enable connection pooling by default for the Prisma adapter to prevent
transaction state issues during seed operations. Without a pool, each
operation creates a new connection which can lead to 'Transaction already
closed' errors during heavy database operations like seeding.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* Revert "fix: always use connection pool for Prisma PostgreSQL adapter"
This reverts commit 6724bb08e42bc0a94846069de83b04db0aeb8e8b.
* fix: enable connection pool for db-seed in cache-db action
Set USE_POOL=true when running yarn db-seed to use connection pooling
with the Prisma PostgreSQL adapter. This prevents 'Transaction already
closed' errors during seeding by maintaining stable database connections.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: add safety check for undefined ownerForEvent in seed script
Prevent 'Cannot read properties of undefined' error when orgMembersInDBWithProfileId
is empty. This can happen if organization members fail to create or when there's a
duplicate constraint violation causing early return.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: v1 _patch reference check bookingRef
* fix: increase pool size and add timeout settings to prevent transaction errors
- Increase max connections from 5 to 10
- Add connectionTimeoutMillis: 30000 (30 seconds)
- Add statement_timeout: 60000 (60 seconds)
These settings help prevent 'Unknown transaction status' errors during
heavy database operations like seeding by giving transactions more time
to complete and allowing more concurrent connections.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* Revert "fix: increase pool size and add timeout settings to prevent transaction errors"
This reverts commit 148264f1f1861dfb09a082937a3e2b49e78fc41a.
* fix: remove standalone execution in seed-app-store to prevent premature disconnect
The seed-app-store.ts file had a standalone main() call at the bottom
that would execute immediately when imported, including a prisma.$disconnect()
in its .finally() block.
This caused issues because:
1. seed.ts imports and calls mainAppStore()
2. The import triggers the standalone main() execution
3. This standalone execution disconnects prisma after completion
4. seed.ts then tries to call mainHugeEventTypesSeed() but prisma is disconnected
5. This leads to 'Unknown transaction status' errors
Fixed by removing the standalone execution since mainAppStore() is already
called programmatically from seed.ts which manages the connection lifecycle.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: use require.main check to prevent premature disconnect when imported
Added require.main === module check so seed-app-store.ts:
- Runs standalone with proper connection management when executed directly
via 'yarn seed-app-store' or 'ts-node seed-app-store.ts'
- Does NOT run standalone when imported as a module by seed.ts,
preventing premature prisma disconnect
This fixes 'Unknown transaction status' errors while maintaining
backward compatibility for direct execution.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: seed apps before creating users to prevent foreign key constraint violation
Reordered seeding operations to call mainAppStore() before main() because:
- main() creates users with credentials that reference apps via appId foreign key
- mainAppStore() seeds the App table with app records
- Apps must exist before credentials can reference them
This fixes the 'Foreign key constraint violated on Credential_appId_fkey' error
that occurred when creating credentials before the apps they reference existed.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* Apply suggestion from @cubic-dev-ai[bot]
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* Removing functional changes of deleted: null
* Apply suggestion from @keithwillcode
* refactor: move seedAppData call to bottom of main() in seed.ts
Moved seedAppData() call from seed-app-store.ts to the bottom of main()
in seed.ts to ensure the 'pro' user is created before attempting to
create routing form data for them.
Changes:
- Exported seedAppData function from seed-app-store.ts
- Removed seedAppData() call from the main() export in seed-app-store.ts
- Added seedAppData() call at the bottom of main() in seed.ts
- Updated standalone execution in seed-app-store.ts to still call
seedAppData() when run directly via 'yarn seed-app-store'
This ensures proper ordering: apps seeded → users created → routing
form data created for existing users.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* refactor: move routing form seeding from seed-app-store.ts to seed.ts
Moved the routing form seeding logic (previously in seedAppData function)
from seed-app-store.ts to be inline at the bottom of main() in seed.ts.
This ensures the 'pro' user is created before attempting to create routing
form data for them.
Changes:
- Removed seedAppData function and seededForm export from seed-app-store.ts
- Removed import of seedAppData from seed.ts
- Added routing form seeding logic inline at bottom of main() in seed.ts
Seeding order: apps → users (including 'pro') → routing forms
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* fix: add deleted: null filter to bookingReference update operations
- Add deleted: null filter to API v1 PATCH endpoint to prevent updating soft-deleted booking references
- Add deleted: null filter to DailyVideo updateMeetingTokenIfExpired and setEnableRecordingUIAndUserIdForOrganizer
- Add comprehensive test coverage for PATCH endpoint soft-delete behavior
- Tests verify that soft-deleted booking references cannot be updated
- Tests verify that only active booking references can be updated successfully
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* revert: remove deleted: null filters to preserve existing functionality
Per @keithwillcode's feedback, reverting the soft-delete filtering changes to preserve existing functionality in this PR. This PR should focus only on the Prisma upgrade itself.
- Reverted API v1 PATCH endpoint change
- Reverted DailyVideo adapter changes (updateMeetingTokenIfExpired and setEnableRecordingUIAndUserIdForOrganizer)
- Removed test file that was added for soft-delete behavior testing
Addresses comments:
- https://github.com/calcom/cal.com/pull/23816#discussion_r2448854197
- https://github.com/calcom/cal.com/pull/23816#discussion_r2448860594
- https://github.com/calcom/cal.com/pull/23816#discussion_r2448860833
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* test: restore and update booking reference tests to match existing functionality
Updated tests to verify existing behavior where PATCH endpoint can update
booking references regardless of their deleted status. This matches the
current implementation after reverting the deleted: null filters.
Changes:
- Restored test file that was previously deleted
- Updated PATCH tests to expect successful updates of soft-deleted references
- Renamed test suite to 'Existing functionality' to clarify intent
- Tests now verify that the PATCH endpoint preserves existing behavior
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
* test: rename booking-references test to integration-test
The test requires a database connection and should run in the integration
test job, not the unit test job. Renamed from .test.ts to .integration-test.ts
to match the repository's testing conventions.
Co-Authored-By: keith@cal.com <keithwillcode@gmail.com>
---------
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: cal.com <morgan@cal.com>
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* 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>
* Reapply "feat: add text & numeric filters to insights routing responses (#18016)"
This reverts commit 49070b96ae.
* support SINGLE_SELECT
* fix type error
* put back ts-expect-error
* remove playground
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: improve text filters (WIP)
* move function to bottom
* apply some styles
* fix selection of TextFilterOptions
* rename value to operand
* remove unused file
* merge filters/filters into filters/utils
* fix regression of not putting url params correctly
* move makeWhereClause to filters/utils
* fix negative, empty, and not empty operators
* fix initial filtering from search state (url)
* fix type errors
* do not send an empty array to query
* update yarn.lock
* i18n for text filter operators
* extract logic as useColumnFilters()
* add missing import
* fix type error
* revert yarn.lock
* use i18n
* insensitive text match
* move data-table to @calcom/features
* fix type errors
* fix type errors
* fix type errors
* feat: support DataTable filters for Insights Routing WIP
* remove unused filters
* remove additionalFilters and fix types
* clean up filter components
* support icons for ActiveFilters
* support filters on json
* fix filter ui
* fix type error and clean up
* revert changes
* revert change
* clean up
* revert change
* fix compatibility with insights booking page
* remove unused params
* fix type errors
* update yarn.lock
* fix field filter and adjust ui
* chore: update yarn.lock
* fix text filter
* add Clear Filters button
* add more test data
* feat: support numeric filter WIP
* feat: support numeric filter
* feat: move People to an external filter
* fixing query states
* rename state to activeFilters
* add useDataTable
* fix ResponseCellValue bug and enable resizing for RoutingFormResponsesTable
* fix response values
* truncate attribute text
* seed booking attendees
* fix accessor (no actual change though)
* add a gap
* rename
* use pathname as default identifier for DataTable
* fix type error
* support text filter for assignment reason
* Apply suggestions from code review
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* rename fields to headers
* use safeParse
* fix type error
* push yarn.lock with faker
* fix MemberList
---------
Co-authored-by: Udit Takkar <udit222001@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: sean-brydon <sean@cal.com>
* revert: "feat: refactor filters on insights response table (#17796)"
This reverts commit 5d88858995.
* Put back the search columns and options english terms
* feat: improve text filters (WIP)
* move function to bottom
* apply some styles
* fix selection of TextFilterOptions
* rename value to operand
* remove unused file
* merge filters/filters into filters/utils
* fix regression of not putting url params correctly
* move makeWhereClause to filters/utils
* fix negative, empty, and not empty operators
* fix initial filtering from search state (url)
* fix type errors
* do not send an empty array to query
* update yarn.lock
* i18n for text filter operators
* extract logic as useColumnFilters()
* add missing import
* fix type error
* revert yarn.lock
* use i18n
* insensitive text match
* move data-table to @calcom/features
* fix type errors
* fix type errors
* fix type errors
* feat: support DataTable filters for Insights Routing WIP
* remove unused filters
* remove additionalFilters and fix types
* clean up filter components
* support icons for ActiveFilters
* support filters on json
* fix filter ui
* fix type error and clean up
* revert changes
* revert change
* clean up
* revert change
* fix compatibility with insights booking page
* remove unused params
* fix type errors
* update yarn.lock
* fix field filter and adjust ui
* chore: update yarn.lock
* fix text filter
* add Clear Filters button
* add more test data
---------
Co-authored-by: Udit Takkar <udit222001@gmail.com>
* add connect to cal atom
* add connect to cal to atoms package index
* shadcn setup
* update packages
* button component from shadcn
* dumb button component
* replace button with dumb button component
* update commenst and change url param
* chore: setting up monorepo packages for platforms (#12572)
* chore: init platform folders strucutre and api proxy
* fixup! chore: init platform folders strucutre and api proxy
* chore: init database oAuth platform client schema
* fixup! chore: init database oAuth platform client schema
* fix config path after move to folder /v1
* feat: scaffold v2 API (#12554)
* init nest project
* add kysely as a separate package
* add ee folder with license
* prettier: format v2 api same as mono repo
* migrate over Eriks nestjs poc
* schema generation script
* ee license file
* nest poc eslint file
* remove prisma-kysely from v2 api
* prepare for mergin platform: remove prisma-kysely because incorrect checksum
* add prisma-kysely to packages/prisma
* move to apps/api/v2
* rename v2 package
* readme update
* Update apps/api/v2/env.example
* env typo
* env typo
---------
Co-authored-by: Erik <erik@erosemberg.com>
Co-authored-by: Morgan Vernay <morgan@cal.com>
* chore: init platform packages (#12603)
* chore: init platform packages
* fixup! chore: init platform packages
* fixup! fixup! chore: init platform packages
* fix: type in package.json
* fixup! fixup! fixup! chore: init platform packages
* fixup! fixup! fixup! fixup! chore: init platform packages
* fixup! fixup! fixup! fixup! fixup! chore: init platform packages
* fixup! fixup! fixup! fixup! fixup! fixup! chore: init platform packages
---------
Co-authored-by: Lauris Skraucis <lauris.skraucis@gmail.com>
* chore: platform more permissions utils and tests (#12613)
* chore: more permisions utils and tests
* chore: tests
* feat: validate `CalProvider` api keys (#12672)
* fix: signup nit (#12585)
* Disable submit on empty form
* Fix submit
---------
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
* New Crowdin translations by Github Action
* fix: Signup options are not disabled (#12610)
* fix: Signup options are not disabled
* fixes/signup disabling suggested changes done
* chore: signup and login improvements
---------
Co-authored-by: Udit Takkar <udit222001@gmail.com>
* fix: typo in @calcom/emails readme (#12615)
* fix: handle reschedule request for dynamic meetings (#12275)
* chore: [app-router-migration-1] migrate the pages in `settings/admin` to the app directory (#12561)
Co-authored-by: Dmytro Hryshyn <dev.dmytroh@gmail.com>
Co-authored-by: DmytroHryshyn <125881252+DmytroHryshyn@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
* chore: added cursor-pointer to img upload (#12624)
* added cursor-pointer to img upload
* nit
* feat: add clear filters option in bookings page (#12629)
* add clear filters option
* fix vscode settings.json
* use removeAllQueryParams()
* fix yarn lock
* remove toggleoption
* feat: display long durations in hours on booking (#12631)
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
* New Crowdin translations by Github Action
* fix: workaround for future app dir routes
* feat: Allow only first slot to be booked (#12636)
Co-authored-by: Morgan Vernay <morgan@cal.com>
* New Crowdin translations by Github Action
* feat: add matomo analytics app (#12646)
* chore: Sentry Wrapper with Performance and Error Tracing (#12642)
* add wrapper for sentry and update functions in 'getUserAvailability'. Update tracesSampleRate to 1.0
* Make Sentry Wrapper utilize parent transaction, if it exists.
* Update wrapper for functions to inherit parameters from the child function
* add comment of when to use the wrapper
* check for sentry before wrapping, if not call unwrapped function
* refactored wrapper to have async and sync separate functions that utilize helpers for common behaviour
* update type of args to unknown
* fixed types of returns from wrapped functions
---------
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
* validate api keys to set error and key states for api keys
* organize error messages into one place
* set error messages from errors file instead of hardcoding value
* fix incorrect constant name
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: Pratik Kumar <70286186+Pratik-Kumar-621@users.noreply.github.com>
Co-authored-by: Udit Takkar <udit222001@gmail.com>
Co-authored-by: Samyabrata Maji <116789799+samyabrata-maji@users.noreply.github.com>
Co-authored-by: Manpreet Singh <manpoffc@gmail.com>
Co-authored-by: Benny Joo <sldisek783@gmail.com>
Co-authored-by: Dmytro Hryshyn <dev.dmytroh@gmail.com>
Co-authored-by: DmytroHryshyn <125881252+DmytroHryshyn@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Varun Prahlad Balani <varunprahladbalani@gmail.com>
Co-authored-by: Mike Zhou <mikezhoudev@gmail.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: Haran Rajkumar <haranrajkumar97@gmail.com>
Co-authored-by: Morgan Vernay <morgan@cal.com>
Co-authored-by: Harshith Pabbati <pabbatiharshith@gmail.com>
Co-authored-by: Brendan Woodward <73412688+bwoody13@users.noreply.github.com>
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
* fix: storybook atom import
* feat: oauth clients management (#12604)
* feat: oAuth create and update dtos
* feat: WIP oAuth repository
* feat: oAuth controller and module
* refactor: rename cal oAuth to simply oauth
* fix: controller update client
* add oAuth client module to endpoints module
* refactor: OAuthClientRepository
* refactor
* status codes for controller
* oauth create return
* fix: oAuth client only for v2 API
* remove repository as provider from its module
* fix: oAuth module, have repository in providers
* fix: make endpoints run
* comment out oauth prisma schema code: coming next
* refactor: remove api-key authguard (#12675)
* chore: Prisma exception filters (#12679)
* fix: get prisma schema from package @calcom/prisma (#12692)
* fix: get prisma schema from package @calcom/prisma
* fixup! fix: get prisma schema from package @calcom/prisma
* fixup! fixup! fix: get prisma schema from package @calcom/prisma
* fix: prettier config
* fixup! fix: prettier config
* chore: create authenticated user guard (#12677)
* chore: wip next-auth-guard for apiv2
* refactor: use NextAuthGuard on all OAuthClientController routes
* refactor: use passport to get next user
* exclude password from prisma read service
* Revert "exclude password from prisma read service"
This reverts commit 24b1f8ed59f6d99f0ecc589c691efb0ac1f2ac3b.
* fix: userRepo sanitize password
* refactor: function order in UserRepository
* implement user repository service
* refactor: strict null checks for TS
* refactor: fix strict null checks
* delete res locals type
* refactor: switch from zod to class-validator for oAuth client
* refactor: switch from zod to class-validator for booking
* refactor: rename dtos folder to input folder
* fix: create migration for prisma schema oauth clients table
* feature: post oAuth client
* refactor: rename oAuth client_secret to secret
* stricter ts config + oauth secret
* remove migrations
* fix: improve response type
* improve error code types
* fix: prettier by removing eslint as its not needed
* refactor: eslint fix files
* wip organization oauth_lcient
* fix import types
* fix team schema platformOAuthClient name
* fix: import packages transpiled
* feat: roles guard
* refactor: use organisationId instead of userId
* fix: jwt secret signing not having jwt_secret
* fix: stop importing input DTOs as types
* fix: jwt sign expecting plain object
* add sentry, routes logger, generic response type
* fix test config
* fixup! fix test config
* refactor: dont await async function return
* feat: fallback value for getEnv
* feat: add helmet for security
* feat: organization guard
* refactor: check if user set in RolesGuard
* refactor: remove roles requirement for oauth read
* chore: add exceptions filters
* fix: api key strategy throws errors
* chore: set e2e tests
* chore: centralize api type in package
* feat: user repository relations
* feat: user repository relations
* Revert "feat: user repository relations"
This reverts commit 1802b256b5a6e5c9b6a62138c8cb1b6f75ed401b.
* Revert "feat: user repository relations"
This reverts commit 4a8f52583d95ff15b6254694c976d8ec9ce0e546.
* test: mock next auth
* fixup! test: mock next auth
* test:oAuth authed user but no org
* refactor: remove unused type
* refactor: organisation guard based on Membership table
* refactor: folder and file structure
* fix: small changes exception filters
* refactor: merge organization and roles guards into one guard
* fix: remove old export
* fix: org roles guard
---------
Co-authored-by: supalarry <lauris.skraucis@gmail.com>
* chore: OAuth clients tests and fixes (#12762)
* chore: add tests and fixes
* fixup! chore: add tests and fixes
* fixup! fixup! chore: add tests and fixes
* fixup! fixup! fixup! chore: add tests and fixes
* fixup! fixup! fixup! fixup! chore: add tests and fixes
* fixup! fixup! fixup! fixup! fixup! chore: add tests and fixes
* fixup! fixup! fixup! fixup! fixup! fixup! chore: add tests and fixes
* fix: remove unused imports
* chore: move repos to feature folder (#12769)
* chore: rename repositories
* fix yarn.lock
* feat: oauth client guard (#12814)
* feat: oAuth client guard
* refactor test
* refactor: move oauth-client guard to oauth module
* refactor: separate jest config from package.json
* fix: resolving paths in jest tests
* fix: tests
* jest setup file
* fix: jest test warnings about .js platform constants imports
* refactor: test repository fixtures
* remove allowjs
* ignore js files in ts-jest
* make oauth client module global
* make oauth client module global
* feat: platform oAuth clients frontend (#12867)
* add oauth client to settings
* fix imports
* add react and axios
* oauth client form and card components
* hooks for oauth clients data
* index page for oauth clients
* oauth client list component
* oauth client form page
* shift atoms into platform
* init platform folder
* refactor handleSubmit functioin
* platform
* platform
* platform parts
* revert tsconfig constant platform
* fix: useOauthClients
* feat: create oauth client with api
* fix: add prettier to platform type package
* fixup! fix: add prettier to platform type package
* chore: class-validator types in platform package
* add types for delete oauth client iput
* add onSuccess and onError methods
* update oauth client card view with client id and secret
* cleanup comments
* split oauth persisit hook into create and delete hooks
* fix: oauth client creation / deletion / listing
* fixup! fix: oauth client creation / deletion / listing
* fix: comment logo for now
* fix: layout setting org keys
* cleanup comments
* minor style fixes, add logic for client permissions
* show toast after deleting client
* not passing clint logo at the moment
---------
Co-authored-by: Morgan Vernay <morgan@cal.com>
* chore(platform): OAuth Flow (#12798)
* fixup! chore(platform): OAuth Flow (#12798)
* feat: CRUD for oAuth users (#12853)
* user controller with oauth guard
* crud repository and controller operations
* add user controller to user module
* refactor: oauth guard
* connect user with oauth client upon creation
* fix: test
* wip: e2e test
* refactor: findUniqueOrThrow -> findUnique user
* test: POST user request
* feat: permissions guard
* e2e tests
* e2e
* e2e refactor
* e2e refactor
* reflector decorator check refactor
* refactor oauth guard
* remov unused imports
* log message
* delete permissions decorator and guard
* remove delete user endpoint
* remove delete user endpoint
* refactor: route structure
* remove get oauth client decorator
* delete unecessary e2e config changes
* remove set header in post test
* fix: oauth guard test on empty db
* revert: add previously removed constant to fulfill merge platform
* fix: import to satisfy platform branch merge
* use real implementation of access token guard
* generate access & refresh tokens and fix e2e
* fix: oauth client e2e test
* refactor: variable naming
* refactor
* rename test file
* remove oauth client from request
* refactor: v2 API (#12913)
* Use Boolean only instead of git add src/modules/auth/guard/organization-roles/organization-roles.guard.ts
* move tests next to files they test
* replace .. in import paths with absolute path
* camelCase instead of snake_case for access and refresh token variables
* user sanitize function Typescript friendly
* restructure oAuth clients folder: example for other folders
* restructure bookings module
* organize modules in auth, endpoints, repositories, services
* organize auth module
* organize repositories
* organize inputs
* rename OAuthClientGuard to OAuthClientCredentialsGuard
* add error messages
* add error messages
* clientId as param in oauth-flow & schema mapping
* camelCase instead of snake_case for clientId and clientSecret
* access token guard as passport strategy
* folder structure as features
* get rid of index files
* feat: endpoint for deleting oAuth users & oAuth users returned data (#12912)
* feat: delete oAuth users
* check if access token matches userId in parameter
* driveby: return only user id and email in oauth users endpoints
* refactor: access token errors (#12932)
* change error messages
* error message if access token does not exist in our database
* token expired 498
* access token expired message as constant
* store 498 status code as const
* fix: access token error less information given
* chore: invalid access token const
---------
Co-authored-by: Morgan Vernay <morgan@cal.com>
* feat: external gcal (#12954)
* wip connect gcal
* feat: add external google calendar
* fixup! feat: add external google calendar
* fix: google calendar oauth check invalid
* google cal check tests
* use zod
* fix: await validate access token service
* chore: e2e tests for oAuth flow (#13005)
* fix: accessing length of undefined
* refactor: GetUser throw error if no user provided
* fix: cascade delete PlatformAuthorizationToken if owner or client deleted
* test: POST /authorize
* refactor oauth-flow controller
* refactor oauth-flow controller
* new function to get authorization token by client user ids
* refactor token service
* fix: re-created access and refresh tokens having not unique secret
* oauth flow tests
* oauth flow tests
* feat: abstracted jwt service (#13016)
* remove unused JwtModule from the auth module
* feat: create abstracted jwt service
* refactor: tokens module and service use new jwt service
* refactor: oauth-client module and repository use new jwt service
* implement Morgans requests
* Basic atoms in barebone example platform apps (#13006)
* example app
* example app
* dev move
* fix: more entry points
* fixup! fix: more entry points
* refactor: v2 API (#12913)
* Use Boolean only instead of git add src/modules/auth/guard/organization-roles/organization-roles.guard.ts
* move tests next to files they test
* replace .. in import paths with absolute path
* camelCase instead of snake_case for access and refresh token variables
* user sanitize function Typescript friendly
* restructure oAuth clients folder: example for other folders
* restructure bookings module
* organize modules in auth, endpoints, repositories, services
* organize auth module
* organize repositories
* organize inputs
* rename OAuthClientGuard to OAuthClientCredentialsGuard
* add error messages
* add error messages
* clientId as param in oauth-flow & schema mapping
* camelCase instead of snake_case for clientId and clientSecret
* access token guard as passport strategy
* folder structure as features
* get rid of index files
* feat: endpoint for deleting oAuth users & oAuth users returned data (#12912)
* feat: delete oAuth users
* check if access token matches userId in parameter
* driveby: return only user id and email in oauth users endpoints
* Connect CalProvider and GCal
* Connect CalProvider and GCal
* return response interceptor to handle failed requests
* handle failed requests using axios intercepter
* cal provider refresh tokens, external gcal
* external gcal
* cal provider refresh and retries
* remove console.log
* refactor
* ignore built atoms css
* remove change to token repo
* refactor
* refactor
* downdgrade vite of unrelated packages
* move gcal endpoints to platform
* gcal service
* refactor: use atoms provider
---------
Co-authored-by: Lauris Skraucis <lauris.skraucis@gmail.com>
Co-authored-by: Ryukemeister <sahalrajiv-extc@atharvacoe.ac.in>
* feat: user schedule management (#13053)
* platform-constants package: list of accepted schedule timezones
* feat: schedules endpoint to create schedule with default availability
* refactor: rename function
* refactor: store userId for availabilities
* feat: createSchedule endpoint
* feat: get schedules/default
* feat: getSchedule by id
* feat: get all schedules
* feat: delete schedule
* feat: update schedule
* check user owns schedule
* empty test
* define returned data on controller level not repository
* define returned data on controller level not repository
* Revert "define returned data on controller level not repository"
This reverts commit 4c292a0f0762f58bdcad0707ad8eef7408390800.
* use luxton
* put availabilities out of ee
* use guard on controller level
* refactor
* e2e test schedule creation
* remove log
* test
* default schedule get test
* update schedule test
* delete schedule test
* fix update test
* different email for schedules e2e
* driveby: fix yarn test
* schedule inputs availabilities as array
* re-use BaseStrategy class
* feat: me endpoint v2 api (#13274)
* feat: me endpoint v2 api
* simplify
* chore: NestJS throttling (#13011)
* fix: v2 throttling setup (#13402)
* fix: v2 throttling
* fix: setup redis locally
* move sentry files to api v1
* chore: calcom platform libraries (#13444)
* fixup! chore: calcom platform libraries (#13444)
* fix: fix managed users
* feat: user timezone management in `CalProvider` (#13361)
* hooks to fetch and update user timezone
* add react query package
* add logic to check for change in user timezone and update it
* hook to handle timezone changes
* shift timezone handling logic into separate custom hook
* rename variables
* rename hook to get a user
* call useTimezone hook inside of cal provider
* minor refactors
* add variables for api endpoints
* use URL constructor for creating endpoints
* key prop not needed
* use URL constructor for creating endpoints
* chore: package json scripts
* fix(atoms): fix import path of useUpdateUserTimezone
* fix(atoms): build constants and fix ENDPOINTS const
* feat: v2 api event type endpoints (#13449)
* build platform-libraries
* make getEventTypeById compatible with default PrismaClient
* feat: fetch event type endpoint
* handle event type not found
* e2e test for GET
* test
* determine is user org admin for getEventTypeId correctly
* prisma type like before
* add negative test
* POST event-type and return event-type for api and atom
* POST event-type and return event-type for api and atom
* feat: create default user event types when creating managed user
* feat: v2 api me PUT endpoint (#13486)
* add timeZone to me endpoint
* feat: me endpoint PUT
* reset package.json
* standardize creation and updating of user
* user creation: capitalize timezones and week start
* default event type constants in const file
* refactor: defaultTimezone Europe/London in response schema
* refactor: validators
* refactor: default schedule in schedules endpoints
* refactor: patch instead of put
* fix: getEventTypeById organizationId (#13554)
* chore: transpile more libraries functions
* feat: overlay calendar busy dates events (#13581)
* feat: overlay calendar busy times events
* fixup! feat: overlay calendar busy times events
* fixup! fixup! feat: overlay calendar busy times events
* fixup! fixup! fixup! feat: overlay calendar busy times events
* refactor: schedules for atom (#13585)
* schedules get.handler transformers as util functions
* export schedule transformers from platform-libraries package
* schedules for atom
* refactor: schedules response service format response
* remove unused injected dependency
* fix: prevent duplicate calendar account linking (#13310)
* fix: prevent signing up multiple times from same account
* revert: lark calendar changes
* credential clean up if duplicate
* fix code duplication and check before credential creation
* feat: useRouterQuery allow unset queryParam
* feat: showToast on account duplication attempt
* Small tweak to copy
* Updated other calendars not to use checkDuplicateCalendar
* Add account already linked to apps/installed/calendar
---------
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
* Revert event-type profile based querying (#13588)
* test: Bookings: Add more automated tests for organization (#13576)
* Avoid selecting unused props
* Add automated tests
* Add existing user invite and booking
---------
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
* fix: organization user shouldn't be asked for payment for a premium username (#13535)
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
* chore: refactor handle new reccuring booking (#13597)
* chore: refactor handle new reccuring booking
* fixup! chore: refactor handle new reccuring booking
* fixup! fixup! chore: refactor handle new reccuring booking
* test: Create unit tests for the questions (teste2e-multiSelectQuestion) (#11569)
* Remove unnecessary changes
* add changes
* Requested changes
* Requested changes
* FIx failing tests
* FIx failing tests
* Update regularBookings.ts
* FIx failing tests
* Refactor
* add unit tests for all questions
---------
Co-authored-by: gitstart-calcom <gitstart-calcom@users.noreply.github.com>
Co-authored-by: GitStart-Cal.com <121884634+gitstart-calcom@users.noreply.github.com>
Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
* fix: update valid_for_secs (#13604)
* fix: Fixes teams UI load issue (#13593)
* fixes teams uiload issue
* revert: yarn.lock
---------
Co-authored-by: Udit Takkar <udit222001@gmail.com>
* chore: upgrades boxyhq jackson (#13477)
* chore: upgrades boxyhq jackson
* Update jackson.ts
reduces bundle size
* Update yarn.lock
* Update apps/web/next.config.js
* Upgrades again
---------
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
* upgrades copycat
* feat: PLA-47 Reserve Slots Handler (#13607)
* PLA-44 feat: Platform getPublicEvent (#13596)
* chore: getPublicEvent
* chore: fix
* feat: booker atom bookings platform endpoints (#13613)
* feat: handle new booking
* wip
* feat: handle recurring and instant booking
* fixup! feat: handle recurring and instant booking
---------
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
* fix: v2 not running (#13636)
* fix: import from platform-libraries instead of lib
* fix: typescript error
* fix: provide EventTypesRepository to SlotsService
* fix: small change
* Merge branch 'main' into platform
* fix: make v2 run after user model changes (#13653)
* feat: event type atom user connected and destination calendars endpoint (#13559)
* extract connected calendars logic in re-usable platform-libraries function
* extract connected calendars logic in re-usable platform-libraries function
* extract connected calendars logic in re-usable platform-libraries function
* calendars endpoints
* enable calendars endpoint
* calendars type form platform-libraries instead of lib
* finish merging platform branch
* fix dbWrite
* fix: issue after merge platform
* fix: new abstracted function export
* change ee/overlay-calendars to ee/calendars endpoint
* refactor: merge overlay service with calendars service
* ts fix
* body -> query
* chore: Platform get schedule (#13696)
* chore: get available slots
* chore: infer event type isTeam
* chore: nit
* chore: Delete selected slot (#13692)
Co-authored-by: Morgan Vernay <morgan@cal.com>
* feat: v2 endpoint for availability atom timezones (#13687)
* refactor: move cityTimezones handler to lib
* test: incorrect timezone when creating oauth user
* refactor: standardize time zone validation
* feat: schedules/time-zones endpoint returning possible time zones
* refactor: @IsValidTimezone load allowed timezones dynamically
* chore: split timezones to its own trpc router
---------
Co-authored-by: Morgan Vernay <morgan@cal.com>
* fix after merge main
* feat: platform useGetPublicEvent (#13752)
* feat: platform useGetPublicEvent
* chore: move public event type to libraries
* chore: use const for query key
* fixup CalendarBusyTimesInput optional params
* feat: platform use get available slots (#13756)
* feat: platform use get available slots
* fixup! feat: platform use get available slots
* feat: platform use get connected calendars (#13757)
* chore: platform enable cors (#13774)
* chore: enable cors
* fixup! chore: enable cors
* feat: platform use get calendars busy times (#13759)
* fixup! feat: platform use get calendars busy times (#13759)
* feat: platform use slots hooks (#13785)
* feat: platform use slots hooks
* fixup! feat: platform use slots hooks
* fixup! fixup! feat: platform use slots hooks
* fixup! fixup! fixup! feat: platform use slots hooks
* fixup! fixup! fixup! fixup! feat: platform use slots hooks
* fixup! feat: platform use slots hooks (#13785)
* feat: platform use create boookings hooks (#13797)
* feat: `Availability Settings` atom (#13762)
* styling and updating the examples app
* add custom hooks for availability settings atom
* update default exports
* minor updates
* update cal provider to use react query
* availability settings atom
* dialog from shadcn
* navbar for examples app
* add select skeleton loader in calcom ui packages
* refactors
* define rtl for cal provider
* fox trpc call to avoid merge conflicts
* fix issues caused by merges
* revert changes for rtl
* hook to fetch every city timezones
* implement useGetCityTimezones into timezone component
* minor fix
* update hooks
* add props and intergrate into avaialibility component
* add missing await
* remove logs
* add comments
* invalidate queries after settled
* toaster from shadcn
* add toaster into cal provider
* implement toast on event handlers
* add classnames prop to accept custom styles
* passing custom styles
* update packages
* remove comments
* fix: styling
* fix: useUpdateSchedule
* fixup! fix: useUpdateSchedule
* wip
* feat: availability setting atom
* fixup! feat: availability setting atom
* fixup! fixup! feat: availability setting atom
* fixup! fixup! fixup! feat: availability setting atom
* fixup! fixup! fixup! fixup! feat: availability setting atom
---------
Co-authored-by: Morgan Vernay <morgan@cal.com>
* fix: atoms import
* chore: lock
* fix: types
* fixup! fix: types
* refactor: v2 user timezones (#13944)
* fix: OAuth client form improvements (#13837)
* rename app to apps
* fix type errors, validate redirect url and other fixes
* enable user to add multiple redirect uris
* add id to input to make labels clickable
* translations for oauth form
* improve styles, add translations and add select all button for permissions
* add permissions for profile read and write
* fixes
* nit
* use `useFieldArray` for dynamic fields
---------
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
* refactor: check organizationId primarily on user profile (#13969)
* refactor: attach movedToProfile to user
* refactor: check organizationId primarily on user profile
* fix: resolve TS errors to build v2 for prod (#13858)
* feat: atoms typescript build (#13864)
* fix: atoms typescript build
* refactor: dayjs
* refactor: meticulous
* refactor: use vite for type generation
* tsconfig
* feat: given user timezone update update default schedule timezone (#13981)
* refactor: standardize schedules api response
* fix: schedules e2e tests
* refactor: use IsTimeZone class-validator instead of custom built one
* feat: validate managed user timezone
* feat: update default schedule when me schedule updated
* refactor: standardize v2 api returned data (#13984)
* feat: V2 api swagger (#13804)
* feat: v2 API swagger docs
* fix: query param not showing up in docs
* latest swagger.json
* refactor: remove scaffolded sample endpoint
* separate internal endpoints
* oauth-clients and oauth flow docs only in dev
* oauth-clients and oauth flow docs only in dev
* create oauth client response doc
* responses for oauth-clients
* document development only endpoints
* chore: consume auth token on exchange (#13993)
* feat: docker build for v2 (#13918)
* fix: resolve TS errors to build v2 for prod
* WIP: api v2 docker
* arg env dockerfile
* wip
* Revert "wip"
This reverts commit 232adf5b969ef004ae907f3e85b12c2715d9b6bc.
* wip
* wip
* fix docker
* fix docker
* fix docker
* docker
* docker
* expose port 80
* feat: oauth client permissions guard (#14020)
* feat: Permissions guard
* feat: Permissions guard
* tests
* feat: use permissions guard for event types
* extra permissions test
* fix tests
* bokings, gcal, me and schedules permissions
* chore: use availability settings atom and fix useTimezone platform hook (#13934)
* replace availabiilty settings with atom component
* add more props for custom styles
* replace intl with dayjs
* review feedback fixes
* fix: v2 api typescript errors (#14059)
* fix: start:prod script
* fix: v2 me module dependencies (#14073)
* feat: check v2 request origin (#14074)
* feat: check v2 request origin
* drive by: remove console log in test
---------
Co-authored-by: Lauris <lauris@Lauriss-Laptop.local>
* fix date overrides typing issues (#14091)
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
* fix: v2 e2e tests (#14088)
* fix: v2 e2e tests
* fix: yarn e2e tests run 1 after another
* fix gcal test
---------
Co-authored-by: Lauris <lauris@Lauriss-Laptop.local>
* fix: availability atom and access token origin strategy
* fix: availability atom get error from unknown
* feat: booker atom platform wrapper (#14036)
* feat: booker atom, fix hooks
* wip
* feat: booker atom platform wrapper
* fix conflicts
* fix: build v2 internal dependencies upon v2 build
* fix typing of useDeleteOAuth
* fix: isplatform timezone select improt booker event meta
* fixup! Merge branch 'platform' into feat-booker-atom-platform
* refactor
* add video call event types
* disable email and set managed user names
---------
Co-authored-by: supalarry <lauris.skraucis@gmail.com>
* update yarn.lock
* Update .prettierignore
* update post install
* fix: post install
* fix yarn lock
* fix: post install
* fix: types
* feat: enable user control over timezone changes and helpers for query params (#14049)
* helpers to get and set value of a query paramater
* add event handlers and props to figure out the timezone preference of a user
* make onTimeZoneChange handler optional
* fixup
* fix merge conflicts
* fixup
* revert changes
* fixup
* fixup
---------
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* fix: usetimezone import
* fix: prisma client import
* fix: prisma client import
* fix: prisma client import
* remove post install using vite
* ts fix attempt: pin prisma to same version
* Revert "ts fix attempt: pin prisma to same version"
This reverts commit 2c309f52e3a881e2dbda4185f45e77967bef6925.
* resolve v2 prisma to calcom prisma
* sync v2 and typescript deps
* sync atoms package
* lock file updat
* fix: platform web components move out of pages folder
* ui: allow experimental decorators to fix ts ci error
* app-store: allow experimental decorators to fix ts ci error
* web: allow experimental decorators to fix ts ci error
* fix: github actions v2 api secrets
* add license
* mock useIsPlatform for tests
* fix timezone select tests
* mock useLocale
* fix tests
* fix tests
* fix tests
* fix github actions
* chore: temporarily disable redis (#14142)
* fix: only one migration file for platform
* fix api v1 files location
* fix: disable apiv2 test in ci
---------
Co-authored-by: Ryukemeister <sahalrajiv-extc@atharvacoe.ac.in>
Co-authored-by: Lauris Skraucis <lauris.skraucis@gmail.com>
Co-authored-by: Erik <erik@erosemberg.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: Pratik Kumar <70286186+Pratik-Kumar-621@users.noreply.github.com>
Co-authored-by: Udit Takkar <udit222001@gmail.com>
Co-authored-by: Samyabrata Maji <116789799+samyabrata-maji@users.noreply.github.com>
Co-authored-by: Manpreet Singh <manpoffc@gmail.com>
Co-authored-by: Benny Joo <sldisek783@gmail.com>
Co-authored-by: Dmytro Hryshyn <dev.dmytroh@gmail.com>
Co-authored-by: DmytroHryshyn <125881252+DmytroHryshyn@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Varun Prahlad Balani <varunprahladbalani@gmail.com>
Co-authored-by: Mike Zhou <mikezhoudev@gmail.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: Haran Rajkumar <haranrajkumar97@gmail.com>
Co-authored-by: Harshith Pabbati <pabbatiharshith@gmail.com>
Co-authored-by: Brendan Woodward <73412688+bwoody13@users.noreply.github.com>
Co-authored-by: Amit Sharma <74371312+Amit91848@users.noreply.github.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
Co-authored-by: Alex van Andel <me@alexvanandel.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: gitstart-app[bot] <57568882+gitstart-app[bot]@users.noreply.github.com>
Co-authored-by: gitstart-calcom <gitstart-calcom@users.noreply.github.com>
Co-authored-by: GitStart-Cal.com <121884634+gitstart-calcom@users.noreply.github.com>
Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>
Co-authored-by: Anant Jain <75206987+anantJjain@users.noreply.github.com>
Co-authored-by: Lauris <lauris@Lauriss-Laptop.local>
Co-authored-by: supalarry <laurisskraucis@gmail.com>
* init page
* init insights frontend
* nit
* nit
* nit
* merge
* fixed icons
* i18n, needs features
* Init insights trpc
* Using trpc on client
* Added events timeline
* Seed analytics script
* connect ui with trpc
* Added and fixed event time lines
* WIP popular days and avg time duration event type
* added new metric graphs
* improved upgrade tip
* always show upgrade screen
* upgrade tremor.so and select inputs for page
* Remove log
* Move everything to components and add context
* Fix select types using calcom ui one
* Adding translations
* Add missing translations
* Add more translations
* min fix
* Fixes for date select
* Prefer early return and mobile design fixes
* Fix style for mobile
* Fix data with userId filter from popular events
* add user id to average time duration
* fix types for select-react
* Removed submodules
* Delete website
* Update yarn.lock
* Code organization and type fixes
* trpc fixes
* Builds are now passing
* Relocates server code
* Add url state in insights
* Update FiltersProvider.tsx
* Cleanup
* Update embed-iframe.ts
* Update FilterType.tsx
* Update seed-app-store.config.json
* Update index.tsx
* Renamed seeder
* Update FiltersProvider.tsx
* Fix for query params
* no wrap on lg screen
* Fix shadow borders from tremor components, fix title font
* Add ring-gray to match filters
* add cursor pointer
* copy improvements
* blue to black
* fixed date select focus
* Adds missing translation strings
* Fix url state for filter type
* Apply suggestions from code review
* Updated yarn lock
* Adds feature flag
* Type fix
---------
Co-authored-by: Peer Richelsen <peer@cal.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: zomars <zomars@me.com>
* init page
* init insights frontend
* nit
* nit
* nit
* merge
* fixed icons
* i18n, needs features
* Init insights trpc
* Using trpc on client
* Added events timeline
* Seed analytics script
* connect ui with trpc
* Added and fixed event time lines
* WIP popular days and avg time duration event type
* added new metric graphs
* improved upgrade tip
* always show upgrade screen
* upgrade tremor.so and select inputs for page
* Remove log
* Move everything to components and add context
* Fix select types using calcom ui one
* Adding translations
* Add missing translations
* Add more translations
* min fix
* Fixes for date select
* Prefer early return and mobile design fixes
* Fix style for mobile
* Fix data with userId filter from popular events
* add user id to average time duration
* Removed submodules
* Delete website
* Update yarn.lock
* Code organization and type fixes
* trpc fixes
* Builds are now passing
* Relocates server code
* Cleanup
* Medium size screen fixes
* Added TODO
---------
Co-authored-by: Alan <alannnc@gmail.com>
Co-authored-by: zomars <zomars@me.com>