Commit Graph
61 Commits
Author SHA1 Message Date
Zachariah K. Sharma dda6e1dcdd Expose team tRPC endpoint
Create PR containing updated CHANGELOG.md and release packages to NPM once PR is merged / Release (push) Has been cancelled
Run i18n AI automation / Run i18n (push) Has been cancelled
Next.js Bundle Analysis / analyze (push) Has been cancelled
2026-06-08 19:06:52 -06:00
Benny JooGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
ab21c7f805 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>
2026-04-15 09:52:36 -03:00
21d28c9747 refactor: apply biome formatting to packages/trpc (#27928)
Co-authored-by: Claude Opus 4.6 <[email protected]>
2026-02-16 12:46:42 -03:00
Eunjae LeeGitHubClaude Opus 4.5Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2364cff54d feat: custom feedback dialog for feature opt-in (#27578)
* feat: add delayed formbricks tracking for feature opt-in

Adds delayed Formbricks survey tracking for feature opt-in. When a user
opts into a feature, this allows triggering a Formbricks action after a
configurable delay (e.g., 24 hours later) to collect feedback once
they've had time to use the feature.

Key changes:
- Added `formbricks` config option to `OptInFeatureConfig` interface
  with `actionName` and `delayMs` properties
- Created `useFormbricksOptInTracking` hook that handles the delayed
  tracking logic
- Added `isFeatureTracked` / `setFeatureTracked` storage helpers to
  prevent duplicate tracking
- Integrated the tracking hook into `useFeatureOptInBanner`

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* upgrade formbricks

* feat: replace formbricks popup with custom feedback dialog

Instead of using Formbricks' built-in popup, we now show a custom
Cal.com-styled feedback dialog that submits responses directly to
Formbricks API via tRPC mutation.

- Add FeedbackDialog component with emoji rating selector
- Add feedback tRPC router for server-side Formbricks submission
- Update useFormbricksOptInTracking to return dialog state
- Add survey config fields (surveyId, questions) to config

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* feat: position feedback dialog at bottom-right corner

- Use base-ui Dialog primitives for custom positioning
- Position dialog at bottom-right to avoid Intercom overlap
- Use z-index 10000 (below Intercom's high z-index)
- Keep blocking backdrop for modal behavior
- Use i18n keys for title/description
- Add survey IDs for bookings-v3 feedback

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* feat: add i18n keys for feedback dialog title/description

Allow each feature to specify custom i18n keys for the feedback dialog
title and description via the formbricks config.

- Add titleKey/descriptionKey to formbricks config interface
- Pass i18n keys through feedbackDialogProps
- Add bookings_v3_feedback_title/description translation keys

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* refactor: move FeedbackDialog into FeatureOptInBannerWrapper

Better encapsulation - consumers of the feature opt-in banner
no longer need to handle the feedback dialog separately.

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* feat: add 5 second delay before showing feedback dialog

Ensures the page has time to finish loading before showing
the feedback dialog, avoiding showing it while skeletons
are still visible.

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* refactor: simplify feedback dialog UI

- Remove redundant question labels
- Add "(optional)" to comment placeholder

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* fix: remove emoji button borders and add footer gap

- Remove borders from rating emoji buttons
- Add proper gap between textarea and footer (pb-4)

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* fix: delayMs is opt-in waiting period, not setTimeout delay

delayMs represents the minimum time that must pass since opt-in
before showing the feedback form (e.g., 3 days). If not enough
time has passed, we skip showing the form entirely instead of
setting a long setTimeout.

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* feat: custom feedback dialog for feature opt-in

- Replace Formbricks popup with Cal.com-styled dialog
- Add configurable delay (waitAfterDays) before showing feedback
- Position dialog at bottom-right, non-blocking
- Add localStorage tracking to prevent duplicate feedback
- Add device targeting (showOn: desktop/mobile/all)
- Create tRPC endpoint for Formbricks API submission
- Use proper logger for error handling

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* refactor: rename tracking terminology to feedback

- Rename useFormbricksOptInTracking → useOptInFeedback
- Rename FormbricksOptInTrackingResult → OptInFeedbackState
- Rename formbricksTracking property → feedback
- Rename FormbricksTrackingState → FeedbackState

We no longer "track" events to Formbricks. Instead, we show
our custom feedback dialog when conditions are met.

Co-Authored-By: Claude Opus 4.5 <[email protected]>

* fix: set waitAfterDays to 3 for production feedback delay

Co-Authored-By: unknown <>

* fix: update formbricks JS SDK usage for v3.0.0

The @formbricks/js SDK v3.0.0 changed its API:
- setup() no longer accepts debug, userId, or attributes
- Use setUserId() and setAttributes() after setup instead
- track() now expects { hiddenFields: ... } or undefined

Co-Authored-By: Claude Opus 4.5 <[email protected]>

---------

Co-authored-by: Claude Opus 4.5 <[email protected]>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-02-05 11:01:14 +00:00
Volnei MunhozGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
e620264848 fix: resolve noNonNullAssertion and noImplicitAnyLet lint issues (#27021)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-01-19 20:07:18 -03:00
Eunjae LeeGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>sean-brydon
5c686d90f9 feat: add tri-state UI settings pages and auto opt-in preference (#25892)
* feat: add tri-state UI settings pages and auto opt-in preference

TASK 5: Tri-state UI with ToggleGroup
- Create shared TeamOrgFeaturesSettings component
- Create user features settings page (features-view.tsx)
- Create team features settings page
- Create org features settings page

TASK 6: Add auto opt-in preference
- Add autoOptInExperimentalFeatures field to User and Team models
- Add migration for new fields
- Add TRPC endpoints for auto opt-in preference (using repository pattern)
- Add auto opt-in checkboxes to settings pages

Also adds i18n keys for feature opt-in UI.

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

refactor: rename autoOptInExperimentalFeatures to autoOptInFeatures

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

refactor: apply PBAC procedure pattern to featureOptIn router

- Create createTeamPbacProcedure for team-scoped endpoints
- Create createOrgPbacProcedure for organization-scoped endpoints
- Refactor all team/org endpoints to use the new PBAC procedures
- Significantly reduces boilerplate code for permission checks

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

add features pages

implement hooks

update style

update style

rename slug to featureId

show Features page on the side bar only if OPT_IN_FEATURES.length > 0

revert unncessary renaming

revert some changes

remove some changes

* fix repository usage

* test: add unit tests for PBAC utility procedures

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

* feat: add 'disabled by organization' badge for Team Level Features page

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

* a little clean up

* feat: add effectiveReason to computeEffectiveStateAcrossTeams for better UI feedback

- Update computeEffectiveStateAcrossTeams to return both enabled state and reason
- Add EffectiveStateReason type with 6 possible values
- Update FeatureOptInService to include effectiveReason in resolved state
- Simplify useUserFeatureOptIn.getBlockedWarning to use effectiveReason directly
- Add feature_no_explicit_enablement_warning translation
- Invalidate feature list when auto-opt-in setting changes in all hooks

* test: add tests for FeatureOptInService.listFeaturesForTeam and refactor router to use TeamRepository

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

* make it clearer about auto opt in

* move hooks to apps/web/module

* fix

* fix: move types to packages/features/feature-opt-in, fix imports and test mocks

- Move types.ts from apps/web/modules/feature-opt-in/hooks to packages/features/feature-opt-in
- Update FeaturesSettings.tsx to import types from new location
- Update hooks to import types from @calcom/features/feature-opt-in/types
- Fix organization features-view import path (~/settings/organizations -> ~/ee/organizations)
- Fix PermissionCheckService mock in util.test.ts to use class syntax

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

* fix: add validation for team ID and remove isPublic from featureOptIn handler

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

* fix: resolve biome lint errors in feature-opt-in files

- Add explicit return types to functions and methods
- Replace ternary operators with if-else statements
- Replace forEach with for...of loops to avoid useIterableCallbackReturn
- Extract helper functions to reduce function complexity
- Add explicit type annotations to variables
- Move exports to end of file to satisfy useExportsLast rule

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

* fix: resolve type errors in featureOptIn router

- Replace ctx.organizationId with ctx.user.organization.id
- Add null checks for organizationId in org procedures
- Remove incorrect type annotation from featureOptInRouter

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

* refactor: address PR feedback on feature opt-in implementation

- Refactor createMutationCallbacks to useMutationCallbacks hook with useLocale internally
- Restore comment on featureOptIn prop in FeaturesSettings.tsx
- Revert getAllTeamIds helper, use ternary operator instead
- Use ctx.user.organizationId with proper guard clauses

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

* fix type error

* feat: disable toggle when feature is blocked by higher level

- Add isBlockedByHigherLevel function to UseFeatureOptInResult interface
- Implement blocking detection for user level (org/team disabled)
- Implement blocking detection for team level (org disabled)
- Organization level never blocked (top level)
- Update FeaturesSettings to disable ToggleGroup when blocked

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

* change order of toggle buttons

* feat: add policy field (permissive/strict) to feature opt-in config

- Add OptInFeaturePolicy type with 'permissive' and 'strict' modes
- Update computeEffectiveStateAcrossTeams to handle both policies:
  - Permissive: user opt-in can activate; disables only win if ALL teams disable
  - Strict: user opt-in alone not enough; ANY explicit disable blocks
- Add new EffectiveStateReason values for strict policy
- Update FeatureOptInService to read policy from config
- Add unit tests for all 9 policy scenarios from spec

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

* refactor: rewrite test file with scenario tables and make policy required

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

* fix type

* fix types

* make policy required

* disable toggle group if blocked by higher level

* refactor: move PBAC procedures to packages/trpc/server/procedures

- Move util.ts to pbacProcedures.ts in procedures folder for better reusability
- Move util.test.ts to pbacProcedures.test.ts alongside the main file
- Update imports in _router.ts to use new location

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

* fix: remove redundant null checks in featureOptIn router

The createOrgPbacProcedure middleware already validates organizationId
and throws if null. Use non-null assertion (!) instead of redundant
runtime checks since the middleware guarantees the value exists.

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

* refactor: improve middleware typing to avoid non-null assertions

Remove explicit return type from createOrgPbacProcedure to let TypeScript
infer the extended context type. This allows handlers to use ctx.organizationId
directly (typed as number) instead of ctx.user.organizationId! assertions.

The middleware validates organizationId and adds it to the context, so
downstream handlers can safely access ctx.organizationId as a number.

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

* feat(pbac): use featureOptIn permissions instead of generic team/org permissions

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

* feat(pbac): add PBAC to team features page and pass canEdit to views

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

* fix: add effectiveReason to IFeatureOptInService and update listFeaturesForTeam interface

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

* fix: add feature_any_team_disabled to isUserBlockedByHigherLevel check

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

* fix: add strict-policy reasons to warning helper function

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

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: sean-brydon <[email protected]>
2026-01-13 15:37:53 +01:00
Joe Au-YeungGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>Eunjae Lee
8dbe3848e7 feat: Create Integration Attribute Sync records (#26007)
* Add db schema

* Add `CredentialRepository.findByTeamIdAndSlugs`

* Add enabled app slugs for attribute syncing

* Create repository for `IntegrationAttributeSync`

* Create zod schemas

* Create `AttributeSyncUserRuleOutputMapper`

* Create `IntegrationAttributeSyncService`

* Create DI contianer

* Create trpc endpoints

* Create page

* Include team name in `CredentialRepository.findByTeamIdAndSlugs`

* Update schema and relations

* Update types and schemas

* Add more methods to IntegrationAttributeSyncRepository

* Add more services to `IntegrationAttributeSyncService`
- getById
- Init updateIncludeRulesAndMappings

* Refactor `getTeams.handler` to use repository

* Create `createAttributeSync` trpc endpoint

* Create `updateAttributeSync` trpc endpoint

* Add router to trpc

* Create attribute sync child components

* Pass custom actions to `FormCard`

* Create `IntegrationAttributeSyncCard`

* Pass inital props via server side

* Fix prop

* Only refetch on mutation

* Fixes

* Add form error when duplicate field and attribute combo

* Add `updateTransactionWithRUleAndMappings` logic

* Adjust zod schemas

* Service add `updateIncludeRulesAndMappings`

* Pass orgId from server to component

* Rename types

* Add deleteById method to repository

* Add name to integrationAttributeSync

* Add deleteById method to service

* Rename method

* Add deleteAttributeSync trpc endpoint

* Make the IntegrationAttributeSyncCard a dummy component

* test: add tests for IntegrationAttributeSync feature

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

* Move creating a attribute sync record to the service

* Add i18n strings

* Safe select credential in find by id and team

* Fix default credentialId value in form

* Update repository return types

* Add i18n string

* Make credentialId optional for form schema

* Fix label

* Add cascade deletes

* Add verification that syncs belong to org

* Create mapper for repository output

* Type fixes

* Remove old test file

* Pass `attributeOptions` from parent to children

* Infer types from zod schema

* Type fixes

* Type fix

* Clean up

* Add i18n strings

* Remove unused file

* Address feedback

* Add migration file

* Address feedback

* Add validation for new integration values

* Remove unused router

* Move away from z.infer to z.ZodType

* Clean up comments

* Type fix

* Type fixes

* Type fix

* fix: add passthrough to syncFormDataSchema to preserve extra fields

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

* fix: remove incorrect test that expected extra fields to pass through syncFormDataSchema

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

* Add indexes

* Add aria label

* Address feedback - consistent validation

* Fix import paths for attribute types

* refactor: change attributeSyncRules array to singular attributeSyncRule

The database schema enforces a one-to-one relationship between
IntegrationAttributeSync and AttributeSyncRule (via @unique constraint),
and the UI only supports a single rule. This change makes the TypeScript
type match the database schema and UI behavior.

Changes:
- Update IntegrationAttributeSync interface to use attributeSyncRule: AttributeSyncRule | null
- Update mapper to return singular rule instead of wrapping in array
- Update UI component to access sync.attributeSyncRule directly
- Update IIntegrationAttributeSyncUpdateParams Omit type
- Update tests to use attributeSyncRule: null instead of attributeSyncRules: []

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

* feat: implement FeatureOptInService (#25805)

* feat: implement FeatureOptInService WIP

* clean up

* feat: consolidate feature repositories and add updateFeatureForUser

- Implement updateFeatureForUser in FeaturesRepository (similar to updateFeatureForTeam)
- Move getUserFeatureState and getTeamFeatureState from PrismaFeatureOptInRepository to FeaturesRepository
- Update FeatureOptInService to use only FeaturesRepository
- Add setUserFeatureState and setTeamFeatureState methods to FeatureOptInService
- Update _router.ts to remove PrismaFeatureOptInRepository usage
- Remove PrismaFeatureOptInRepository.ts and FeatureOptInRepositoryInterface.ts
- Update features.repository.interface.ts and features.repository.mock.ts
- Add integration tests for updateFeatureForUser, getUserFeatureState, getTeamFeatureState
- Update service.integration-test.ts to use FeaturesRepository

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

* refactor: rename updateFeatureForUser to setUserFeatureState

Rename to match the convention used for setTeamFeatureState

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

* refactor: return FeatureState type from getUserFeatureState and getTeamFeatureState

* fix integration tests

* clean up logics

* update services and router

* refactor: change getUserFeatureState and getTeamFeatureState to accept featureIds array

- Renamed getUserFeatureState to getUserFeatureStates
- Renamed getTeamFeatureState to getTeamFeatureStates
- Changed parameter from featureId: string to featureIds: string[]
- Changed return type from FeatureState to Record<string, FeatureState>
- Updated FeatureOptInService to use the new batch methods
- Added tests for querying multiple features in a single call
- Optimized listFeaturesForTeam to fetch all feature states in one query

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

* feat: add getFeatureStateForTeams for batch querying multiple teams

- Added getFeatureStateForTeams method to query a single feature across multiple teams in one call
- Updated FeatureOptInService.resolveFeatureStateAcrossTeams to use the new batch method
- Replaces N+1 queries with a single database query for team states
- Added comprehensive integration tests for the new method

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

* refactor: combine org and team state queries into single call

- Include orgId in the teamIds array passed to getFeatureStateForTeams
- Extract org state and team states from the combined result
- Reduces database queries from 3 to 2 in resolveFeatureStateAcrossTeams

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

* refactor: use team.isOrganization and clarify computeEffectiveState comment

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

* refactor: use MembershipRepository.findAllByUserId with isOrganization

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

* feat: add featureId validation using isOptInFeature type guard

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

* less queries

* add fallback value

* fix type error

* move files

* add autoOptInFeatures column

* use autoOptInFeatures flag within FeatureOptInService

* add setUserAutoOptIn and setTeamAutoOptIn

* fix computeEffectiveState logic

* rewrite computeEffectiveState

* clean up integration tests

* clean up in afterEach

* fix type error

* refactor: use FeaturesRepository methods instead of direct Prisma calls

Replace all manual userFeatures and teamFeatures Prisma operations with
the new setUserFeatureState and setTeamFeatureState repository methods.

Changes include:
- Admin handlers (assignFeatureToTeam, unassignFeatureFromTeam)
- Test fixtures and integration tests
- Playwright fixtures
- Development scripts

This ensures consistent feature flag management through the repository
pattern and supports the new tri-state semantics (enabled/disabled/inherit).

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

* clean up

* fix the logic

* extract some logic into applyAutoOptIn()

* remove wrong code

* refactor: convert setUserFeatureState and setTeamFeatureState to object params with discriminated union

- Convert multiple positional parameters to single object parameter
- Use discriminated union types: assignedBy required for enabled/disabled, omitted for inherit
- Update all callers across repository, service, handlers, fixtures, and tests

* fix type error

* use Promise.all

* fix

---------

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

* Prevent duplicate field and attribute mappings

* Add validation that attribute belongs to the org

* fix: address Cubic AI review feedback

- Add @@index([credentialId]) to IntegrationAttributeSync model for efficient cascade deletes and credential-based queries (confidence: 9/10)
- Fix translation key from 'credential_required' to 'attribute_sync_credential_required' to match existing locale definition (confidence: 10/10)

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

* fix: address remaining cubic review feedback

- RuleBuilder.tsx: Use unique IDs for React keys instead of array index to prevent reconciliation bugs when removing conditions
- updateAttributeSync.handler.ts: Add early organization check before service calls for consistency
- createAttributeSync.handler.ts: Add CredentialNotFoundError class for type-safe error handling instead of string matching
- IntegrationAttributeSyncService.test.ts: Replace expect.fail() with proper Vitest rejects.toSatisfy() pattern

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

* Pull test file from main

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Eunjae Lee <[email protected]>
2026-01-12 22:57:28 +00:00
Keith WilliamsGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>Dhairyashil Shinde
51bce6763f refactor: split tRPC build into server and react phases (#26082)
* refactor: import AppRouter from generated types instead of server source

This change improves tRPC build performance by having the client-side code
import AppRouter from pre-generated type declarations instead of traversing
the entire server router tree.

Changes:
- Create type bridge file at packages/trpc/types/app-router.ts
- Update packages/trpc/react/trpc.ts to import from the bridge
- Update .gitignore to only ignore types/server (generated files)
- Update eslint.config.mjs to only ignore types/server (generated files)

The type bridge provides:
1. Faster typechecking - avoids parsing 458 server files
2. Stable import location that's easy to lint against
3. Single place to adjust if generated path changes

Build order is already enforced in turbo.json (type-check depends on @calcom/trpc#build).

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

* fix: move bridge file to react/ to avoid TS5055 error

Move the AppRouter type bridge file from types/app-router.ts to react/app-router.ts
to avoid the TS5055 'Cannot write file because it would overwrite input file' error.

The issue was that placing the bridge file in types/ caused TypeScript to treat
the generated .d.ts files as input files during the tRPC build, then fail when
trying to emit to the same location.

By placing the bridge in react/ (which is excluded from the tRPC server build),
the bridge file is only used by client code and doesn't interfere with the
server type generation.

Changes:
- Move bridge file from types/app-router.ts to react/app-router.ts
- Update import in react/trpc.ts to use ./app-router
- Revert .gitignore to ignore all of types/ (generated files)
- Revert eslint.config.mjs to ignore all of types/**

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

* refactor: split tRPC build into server and react phases

- Create tsconfig.server.json for server-only type generation
- Create tsconfig.react.json for react/client type generation
- Update build script to run server build first, then react build
- Remove || true so build properly fails on errors
- This allows react code to import from generated server types

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

* refactor: split @calcom/trpc exports to separate server and react entrypoints

- Remove react exports from @calcom/trpc root (index.ts)
- Update 89 files to import from @calcom/trpc/react instead of @calcom/trpc
- This fixes the boundary leak where server builds were pulling in react code
- Server build no longer compiles react/app-router.ts, fixing the chicken-and-egg
  issue where react code needed generated server types that didn't exist yet

This improves TypeScript build performance by preventing the server type
generation from traversing the entire react/client type graph.

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

* fix: import WorkflowType from lib/types instead of React component

This fixes a boundary leak where the server build was pulling in React
components through the WorkflowRepository import chain. By importing
WorkflowListType from lib/types instead of WorkflowListPage.tsx, the
server build no longer traverses React component files.

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

* fix: extract server-safe types to prevent boundary leaks in tRPC build

- Extract ChildrenEventType to lib/childrenEventType.ts (server-safe)
- Extract Slots type to calendars/lib/slots.ts (server-safe)
- Create types.server.ts files for eventtypes and bookings
- Update server code to import from server-safe type files
- Update DatePicker.tsx to use extracted Slots type
- Update app-store utils to use BookerEventForAppData type

This prevents the server build from pulling in React files through
transitive imports from @calcom/features barrel exports.

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

* fix: update Segment.test.tsx mock path to @calcom/trpc/react

The test was mocking @calcom/trpc but importing from @calcom/trpc/react.
After the entrypoint separation, the mock path needs to match the import path.

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

* fix: temporarily restore || true to unblock PR merge

The pre-existing Prisma type errors (~345 errors) will be addressed in a follow-up PR.
This allows the two-phase build architecture changes to be merged first.

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

* Run trpc build as part of API v2 build

* Removed the bridge file

* refactor: extract event type schemas to server-safe file

- Create packages/features/eventtypes/lib/schemas.ts with createEventTypeInput and EventTypeDuplicateInput
- Update types.ts to re-export schemas from the new server-safe location
- Update tRPC schema files to import from schemas.ts instead of types.server.ts
- Delete types.server.ts (was duplicating ~200 lines unnecessarily)

This keeps the server build graph clean while avoiding code duplication.

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

* Removed the optionality of the tRPC builds

* Removed the extra command for API v2

* refactor: rename calendars/lib/slots.ts to types.ts

Per Keith's feedback, renamed the file to types.ts since it contains type definitions.

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

* Added back tRPC build:server for API v2

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Dhairyashil Shinde <[email protected]>
2025-12-20 23:43:04 -03:00
Dhairyashil ShindeandGitHub 12e07f20d4 feat: Add Holidays feature to block availability on public holidays (#25561)
* feat: add holidays feature for automatic availability blocking- Add UserHolidaySettings model for storing user preferences- Generate static holiday data for 20 countries using date-holidays- Create HolidayService for runtime holiday queries- Add TRPC router with endpoints for country selection and holiday toggles- Create Holidays tab UI in Availability page with conflict warnings- Integrate holiday blocking into getUserAvailability calculation- Show holiday indicator on blocked dates in booker page- Add warning in OOO modal when dates overlap with holidays

* feat: add optimizations, tests, and code quality improvements

- Add memoization/caching to HolidayService for better performance
- Optimize checkConflicts DB query with OR conditions for specific dates
- Add HolidayService unit tests (10 tests)
- Add error handling with Alert component for failed queries
- Memoize HolidayListItem component to prevent unnecessary re-renders
- Extract magic numbers into constants.ts
- Use TRPCError consistently in handlers
- Add missing i18n keys for error messages
- Update handlers to follow Cal.com patterns (default exports, minimal comments)
- Add regeneration instructions in constants

* refactor: replace static JSON with Google Calendar API integration

- Add GoogleHolidayService to fetch holidays from Google Calendar public calendars
- Add HolidayCache Prisma model for caching API responses
- Add GOOGLE_CALENDAR_API_KEY and HOLIDAY_CACHE_DAYS env variables
- Support 38 countries via Google Calendar holiday calendars
- Update HolidayService methods to async with database caching
- Update all TRPC handlers for async holiday methods
- Fix UI to display holiday dates correctly
- Remove static holidays.json and generate script

* use we instead of calcom in i18n message

* address cubics comments

* move holidays from availability to ooo

* public holidays filter for holidays

* follow i18n _one and _other pattern

* remove holiday feature flag

* revert lint command code change

* revert lint command code change 2.0

* revert lint command code change 3.0

* bye bye my christmas emoji :crying-emoji

* remove comments

* refactor(holidays): add repository pattern, split services, and add tests

- Create HolidayRepository for database operations
- Split GoogleHolidayService into GoogleCalendarClient and HolidayCacheService
- Add dependency injection to HolidayService and HolidayCacheService
- Update TRPC handlers to use HolidayRepository
- Add tests for HolidayRepository and calculateHolidayBlockedDates
- Update calendar IDs to use official holiday format (244 countries + religions)

* fix: address PR review feedback

- Remove unused date-holidays package
- Add pluralization for and_more_holidays_with_conflicts translation
- DRY: spread GOOGLE_RELIGIOUS_HOLIDAY_CALENDARS into GOOGLE_HOLIDAY_CALENDARS
- Add select to userHolidaySettings query in getUserAvailability
- Optimize checkConflicts with pre-computed timestamps

* refactor(holidays): apply proxy pattern and move logic to service

- Rename HolidayCacheService to HolidayServiceCachingProxy (proxy pattern)
- Remove HOLIDAY_CACHE_DAYS env var, use constant directly
- Add isSupportedCountry() method to HolidayService
- Add getUserSettings() and updateSettings() to HolidayService
- Move toggleHoliday logic from handler to service
- Move checkConflicts logic from handler to service
- Add findBookingsInDateRanges() to HolidayRepository
- Simplify all handlers to just call service methods

* feat(bookings): add backend validation to prevent booking on holidays

Adds explicit holiday conflict validation during booking creation to
handle the race condition where a host enables a holiday after a guest
selects a date but before they submit the booking.

Changes:
- Add checkHolidayConflict validation with HolidayRepository integration
- Integrate ensureNoHolidayConflict in RegularBookingService
- Add BookingOnHoliday error code with proper HTTP 400 response
- Handle holiday error display in BookEventForm with name interpolation
- Hide trace ID for expected validation errors
- Add unit tests for holiday conflict validation

* fix failing type check

* fix: address PR review comments for holiday feature

- Change error code from BAD_REQUEST to INTERNAL_SERVER_ERROR in
  toggleHoliday handler (errors are internal failures, not bad input)
- Refactor ensureNoHolidayConflict to use Promise.all for parallel
  user checking instead of sequential loop

* refactor: use Promise.all with logging in loop for holiday check

- Check all users in parallel using Promise.all
- Log conflicts inside the loop as they are detected
- Wait for all checks to complete before throwing error

* fix(holidays): use host timezone for holiday conflict checks

The holiday feature was checking booking dates against holidays using
server/local timezone instead of the host's timezone. This caused
bookings near midnight boundaries to incorrectly pass or fail the
holiday check.

Example: A booking at Dec 24th 8PM UTC (which is Dec 25th in IST)
was not being blocked for an Indian host with Christmas as a holiday.

Changes:
- Add .utc() to holiday date formatting for consistency
- Fetch host's timezone in checkHolidayConflict
- Convert booking time to host's timezone before comparison
- Add findUserSettingsWithTimezone to HolidayRepository
- Update error message to clarify it's the host's local time
- Add timezone edge case tests

* fix(holidays): align holiday blocking with OOO pattern for consistent timezone handling

- Simplify calculateHolidayBlockedDates to match OOO pattern using dayjs.utc()
- Fix date range query to use full day bounds (startOfDay/endOfDay) so holidays
  stored at midnight UTC are correctly found during booking validation
- Remove separate checkHolidayConflict booking-time validation - holidays now
  block through oooExcludedDateRanges like OOO does
- Remove getHolidayOnDate from HolidayService (no longer needed)
- Remove findUserSettingsWithTimezone from HolidayRepository (no longer needed)
- Clean up related tests

Holiday blocking now works exactly like OOO:
1. Holidays are added to datesOutOfOffice in calculateHolidayBlockedDates
2. buildDateRanges processes them via processOOO with .tz(timeZone, true)
3. oooExcludedDateRanges excludes those dates from availability
4. ensureAvailableUsers uses oooExcludedDateRanges to block bookings

This ensures consistent timezone handling where Dec 25th blocks all hours
of Dec 25th in the host's timezone, regardless of booker's timezone.

* update test

* update .env.example file
2025-12-15 16:39:10 +00:00
sean-brydonGitHubKeith WilliamsAnik Dhabal BabuDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>[email protected] <[email protected]>
ae87fdcc9f perf: rename eventTypes.heavy to eventTypesHeavy (#24630)
* Rename eventTypes.heavy to eventTypesHeavy

* Update eventTypes lib types

* Remove trpc and trpc client heavy resolve endpoint

* Update shared file

* Fix comments

* Rename path

* Fix wait for URL path

* Fix API endpoint in event-types.e2e.ts test

* fix: Import WorkflowType from enums instead of client

The WorkflowType enum should be imported from @calcom/prisma/enums
rather than @calcom/prisma/client. This was causing integration tests
to fail with 'Cannot read properties of undefined (reading EVENT_TYPE)'
because the enum wasn't being properly exported from the client.

This fixes the remaining integration test failures after the Prisma 6.16
upgrade.

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

---------

Co-authored-by: Keith Williams <[email protected]>
Co-authored-by: Anik Dhabal Babu <[email protected]>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: [email protected] <[email protected]>
2025-10-23 07:32:06 -03:00
Keith WilliamsandGitHub 86dcd6f0ff perf: Create 'heavy' eventTypes router (#23664)
* perf: Create 'heavy' eventTypes router

* Fixing type checks

* Fixing platform libraries imports
2025-09-08 08:24:30 +00:00
d4bff9d6b1 feat: Cal.ai Self Serve #2 (#22995)
* feat: Cal.ai Self Serve #2

* chore: fix import and remove logs

* fix: update checkout session

* fix: type errors and test

* fix: imports

* fix: type err

* fix: type error

* fix: tests

* chore: save progress

* fix: workflow flow

* fix: workflow update bug

* tests: add unit tests for retell ai webhoo

* fix: status code

* fix: test and delete bug

* fix: add dynamic variables

* fix: type err

* chore: update unit test

* fix: type error

* chore: update default prompt

* fix: type errors

* fix: workflow permissions

* fix: workflow page

* fix: translations

* feat: add call duration

* chore: add booking uid

* fix: button positioning

* chore: update tests

* chore: improvements

* chore: some more improvements

* refactor: improvements

* refactor: code feedback

* refactor: improvements

* feat: enable credits for orgs (#23077)

* Show credits UI for orgs

* fix stripe callback url when buying credits

* give orgs 20% credits

* add test for calulating credits

---------

Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>

* fix: types

* fix: types

* chore: error

* fix: type error

* fix: type error

* chore: mock env

* feat: add idempotency key to prevent double charging

* chore: add userId and teamId

* fix: skip inbound calls

* chore: update tests

* feat: add feature flag for voice agent

* feat: finish test call and other improvements

* chore: add alert

* chore: update .env.example

* chore: improvements

* fix: update tests

* refactor: remove un necessary

* feat: add setup badge

* chore: improvements

* fix: use referene id

* chore: improvements

* fix: type error

* fix: type

* refactor: change pricing logic

* refactor: update tests

* fix: conflicts

* fix: billing link for orgs

* fix: types

* refactor: move feature flag up

* fix: alert and test call credit check

* fix: update unit tests

* fix: feedback

* refactor: improvements

* refactor: move handlers to separate files

* fix: types

* fix: missing import

* fix: type

* refactor: change general tools functions handling

* refactor: use repository

* refactor: improvements

* fix: types

* fix: type errorr

* fix: auth check

* feat: add creditFor

* fix: update defualt prompt

* fix: throw error on frontend

* fix: update unit tests

* fix: use deleteAllWorkflowReminders

* refactor: add connect phone number

* refactor: improvements

* chore: translation

* chore: update message

* chore: translation

* design improvements buy number dialog

* add translation for error message

* use translation key in error message

* refactor: improve connect phone number tab

* feat: support un saved workflow to tests

* chore: remove un used

* fix: remove un used

* fix: remove un used

* refactor: similify billing

---------

Co-authored-by: Carina Wollendorfer <[email protected]>
Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Keith Williams <[email protected]>
2025-08-29 05:04:05 +01:00
Volnei MunhozandGitHub f501ef3269 refactor: remove highperf endpoints (#23171)
* refactor: remove highperf endpoints

* fix trpc function name

* chore: remove isTeamEvent logic

* chore: remove isTeamEvent at all

* revert wrong change

* Revert "chore: remove isTeamEvent at all"

This reverts commit 6dbc8c31f16c40a7654a05240661d7892aa48bb8.

* revert wrong change
2025-08-20 15:12:31 +00:00
sean-brydonGitHubEunjae Leecubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
9dca13305f feat: pbac core ui (#21471)
* migration plus feature flag

* show navigation route + inital roles migration

* add a check permission use case to take in the feature flags for a team

* bulk update script

* inital frontend work for displaying roles

* move to a more "anemic domain models" approach

* update test to match new DDD strutcture

* fix tests

* update transaction call back types to include trx

* align fe types after transaction to DDD

* move away from usecases to a more domain tailored approach

* get permissions per resource and map them to domain permission string

* update permision logic

* correctly get the logic for *.* permissions on owner

* wip sheet logic for ssr

* role list

* use nuqs for sheet parsing on handle change

* fox

* improve hook usage

* enable PBAC router

* delete modal etc

* i18n and inital rough layout of roles + permisions creating

* add color to migrations

* add colors and new method to tests

* move hooks out of infra into client with provider

* move hooks out of infra into client with provider

* memo features and ensure render once

* remove comment

* seed color

* use role colours

* match i18n

* add custom color picker to edit/create form

* fix advanced mode toggle

* more work on adv permission group

* update migrations

* abstract lots of core form logic to a custom hook

* improve UX for selecting all and toggling all

* improve code quality and use domain mappers in role repositoryu

* call server action to revalidate cache

* call invalidate cache on delete

* fix re-render + improves update logic wip

* fix txn for assinging role to member

* wip on assigning users custom roles

* fix repo

* update logic for checking if users can update roles

* remove member from permission check

* check users permission and assign roles

* move to factory approach

* move default rolesIDs to constant

* add facuted values to table

* display custom role in table

* fix type error

* fix role filter

* check pbac feature flag to see what column to filter on

* push repo mocks and other mocks to fix unit tests

* fix and add test for empty permissions when creating a role

* pass updates to repo so we actually update roles

* fix types

* fix types

* restore lock changes

* fix role service test for new updates section

* fix updated at types

* update mocks to use feature repository mock

* remove roletype from db in model

* prevent multiple queries

* fix typeof in role model

* fix and migrate i18n to one registery

* fix and update i18n to be in registery

* fix type error + fall back in service instead of repo for BL

* more type errors

* update members faceted values to bennys refactor

* fix types

* remove the _resource from type conditionally

* fix managment factory types to expose PBAC enbaled obol

* narrow down types

* wip fix for types

* more fix types

* cast role

* fix tests

* attempt of fixing _resoucre key access type

* attempt of fixing _resoucre key access type

* seperate migraations to batches

* add invalidate time to team features

* restore router to main

* push main lock

* Update packages/features/pbac/domain/types/permission-registry.ts

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* Update packages/features/pbac/domain/mappers/PermissionMapper.ts

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* Update packages/prisma/migrations/20250527091330_add_color_to_pbac_role/migration.sql

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* Update packages/prisma/migrations/20250617070118_update_memberships_one_time/migration.sql

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* Update apps/web/app/(use-page-wrapper)/settings/(settings-layout)/organizations/roles/_components/AdvancedPermissionGroup.tsx

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* fix mapped type

* restore migration

* skip _resource

* use partical

* fix type errors in tests and hooks

* Simplified the role field in the editSchema to use z.nativeEnum(MembershipRole)

* fix type errors for editsheet

* fix type errors for editsheet

* Apply suggestion from comment 2151515295

* remove footer since we dont have docs yet

* add i18n

* lock all toggle chevron

* use prisma

* tidy up old manage permission

* fix i18n

* remove can manage from role permission check

* auto select read

* address benny feedback

* fix type

* fix type

* update function name due to merge

* fix types

* update tests to match new membership method from merge

* address cubic feedback

---------

Co-authored-by: Eunjae Lee <[email protected]>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-07-07 10:20:24 +01:00
Eunjae LeeandGitHub 6cccb1725f fix: provide timeZone to /insights from the server side (#21580) 2025-06-12 15:26:44 +00:00
08e35e4698 perf: stop merging routers twice. (#21538)
* move away from merging twice

* move to use loggedIn Router directly

* fix router outputs types

* fix mocks in create button with teasm tests

---------

Co-authored-by: Alex van Andel <[email protected]>
2025-05-27 15:42:14 +01:00
Eunjae LeeandGitHub 324ac691eb fix: use local date range on /insights (based on profile's timezone) (#21472)
* fix: use local date range on /insights (based on profile's timezone)

* update test case
2025-05-22 16:03:56 +00:00
fadfba8830 feat: Credit System (SMS) (#20126)
* Add credits section to billing

* create seperate router for credits

* add stripe checkout session

* schema changes + code improvements

* rename to creditBalance

* custom quantify input with error message

* add checkout session completed webhook endpoint

* fix typo

* UI fixes

* add payCredits handler

* add error toast message

* allow scheduling sms up as close to 15 minutes in the future

* schedule at most 2 hours in advance

* webhook to pay for sent sms

* continued work on twilio callback

* code clean up

* further implementation for credit handling

* add migration

* object as param for scheduleSMS

* object as param for sendSMS

* fix TrpcSessionUser imports

* fix imports

* add db changes

* add cron job for price setting

* twilio status callback to create expense log

* remove unused code

* set up low credit balance email

* fixes for buying credits

* fixes in api/twilio/webhook

* add test to save credits to credits balance

* fix typos

* add new helper function chargeCredits

* expand twilioProvider

* fix type errors

* adjust tests

* type errors

* clean up

* clean up

* fix subscription active check

* remove some user/org related code

* more changes to remove user/org support

* send emails seperatly to admins

* fixes for team billing page

* fix stripe success url

* fixes to creating expense log

* email imrovements and more

* get monthly team price from stripe

* fix import

* fix monthly credits calculation

* finsih low credit balance warning email

* credit balance limit reached email

* create CreditService

* cancel SMS and send as email instead

* add messageDispatcher

* fix type error

* fix type error

* fix type error

* fix import

* fix unit test

* clean up twilioProvider

* clean up chckSmsPrices/route

* add missing translations

* add skeleton loader

* add admin check to get handler

* code clean up + fixes

* improve scheduling with fallback

* fix type error

* add bookingUid to handleSendingSMS

* add unit tests for creditService

* add more tests to credit-service.test.ts

* add test for cancelScheduledMessagesAndScheduleEmails

* fix test and type error

* add back resolve

* fix empty resolve

* adjust limitReachedAt logic

* address mrge comment on styling

* add getAdminMembership to repository

* twilio/webhook clean up (feedback)

* feedback - clean up

* remove todo comment

* clean up twilio/webhook

* code clean up

* add use client

* add createOneTimeCheckout to stripe service

* refactor repository pattern

* small fixes + clean up

* fix type error

* add missing import

* fix hasAvailableCredits for user

* force-dynamic

* rename credits to creditBalance

* fix stripe import

* remove not needed code

* fix e2e tests

* improve low balance warning email

* dynamic-import CreditService

* index.ts

* fix e2e tests

* remove dynamic import CreditService

* Revert "remove dynamic import CreditService"

This reverts commit e272978a7ff3fc5a04139e656c9f8d2c84a40dda.

* no need to dynamic-import credit service

* Revert "no need to dynamic-import credit service"

This reverts commit ba5ae488d08979a65fb47b5d0722cda9f45d6ea0.

* only select id in getAdminMembership

* revert billing/package.json

* fix type checks

* fix type checks

---------

Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: hbjORbj <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
2025-05-13 09:11:44 +02:00
e86ad03cde perf: Slim down logged in round 2 (#20535)
* perf: Slim down loggedInViewer some more

* Move locationOptions to apps router

* Moved calVideo related handlers to separate router

* Moved calendar related handlers to separate router

* Rename

* Moved deleteCredential to new router

* Moved updateProfile to me router

* fix unit test

* fix e2e test

* tweak

* missing

---------

Co-authored-by: Anik Dhabal Babu <[email protected]>
Co-authored-by: unknown <[email protected]>
2025-04-04 15:33:14 -04:00
Eunjae LeeandGitHub f15d347804 feat: implement filter segment (#20066)
* feat: add filter segment

* add tests

* add ui

* provide tableIdentifier from context

* fix components

* update save button

* try to fix router

* add proper implementation

* update icon

* remove segmentId if invalid

* fix tests

* fix type errors

* fix type errors

* fix unit test

* clean up

* minor fixes

* clean up types

* avoid barrel imports

* fix imports

* minor improvements

* fix type error

* fix radio import

* fix little issues

* menu permission

* update icon snapshot

* fix: remember last used filter segment (#20261)

* fix: remember last used filter segment

* extract segments logic as a separate file

* remove unnecessary query

* apply feedback

* deep comparison
2025-03-31 08:53:48 +00:00
78ddf71823 perf: Move OOO-related tRPC procedures to new routers (#20136)
* perf: Move OOO-related tRPC procedures to new routers

* Moved test file

* push fix for import path in tests

* fix trpc response url that we wait for

---------

Co-authored-by: sean-brydon <[email protected]>
Co-authored-by: Anik Dhabal Babu <[email protected]>
Co-authored-by: sean-brydon <[email protected]>
2025-03-21 09:03:10 -07:00
30dce7bacd perf: Move apps procedures off of loggedInViewer (#20112)
* perf: Slim down loggedInViewer tRPC router

* Fixed trpc client calls for new routes

* Moved bookingUnconfirmedCount

* Moved getUserTopBanners to me router

* Moved shouldVerifyEmail to me router

* Moved i18n from public to its own router

* fix ssrInit

* fix ssrInit usage

* fix type check

* better naming

* fix

* fix

* Fix types

* Removed used of importHandler

* perf: Move apps procedures off of loggedInViewer

* Moved 2 more apps-related procedures

---------

Co-authored-by: hbjORbj <[email protected]>
2025-03-17 17:18:19 +00:00
20d6eb5200 perf: Slim down loggedInViewer tRPC router (#20111)
* perf: Slim down loggedInViewer tRPC router

* Fixed trpc client calls for new routes

* Moved bookingUnconfirmedCount

* Moved getUserTopBanners to me router

* Moved shouldVerifyEmail to me router

* Moved i18n from public to its own router

* fix ssrInit

* fix ssrInit usage

* fix type check

* better naming

* fix

* fix

* Fix types

* Removed used of importHandler

---------

Co-authored-by: hbjORbj <[email protected]>
2025-03-16 18:22:48 -07:00
MorganandGitHub 524c0d81a7 chore: rename DWD to DelegationCredential (#19744)
* Revert "Revert "chore: rename DWD to DelegationCredential (#19703)" (#19734)"

This reverts commit 340b5ab061.

* chore: fix schema and types for now

* fix: domainWideDelegationCredentialId error type
2025-03-05 10:42:20 -03:00
MorganandGitHub 340b5ab061 Revert "chore: rename DWD to DelegationCredential (#19703)" (#19734)
This reverts commit 7a9ddf2194.
2025-03-05 10:30:23 +00:00
MorganandGitHub 7a9ddf2194 chore: rename DWD to DelegationCredential (#19703)
* chore: rename DWD to DelegationCredential

* fixup! chore: rename DWD to DelegationCredential

* fixup! fixup! chore: rename DWD to DelegationCredential

* fixup! Merge branch 'main' into rename-domain-wide-delegation

* fixup! fixup! Merge branch 'main' into rename-domain-wide-delegation

* fixup! fixup! fixup! Merge branch 'main' into rename-domain-wide-delegation
2025-03-04 09:45:39 -03:00
bec83b2342 chore: remove TRPC barrel exports (#19598)
* remove barrel export for client

* fix more imports

* remove server barrel

* remove more barrel exporst and fix tssconfig

* fix types

* fix imports for removed barrels

* fig ssg createserverside helpers

* restore lock

* new yarn lock

* remove barel exports

* remove barrel

* replace client with react in tsconfig

* fix yarn lock

* Update exports for trpc to not be types

* add ENDPOINTS export to the correct location

* other exports fixes lost due to barrel

* fix client error export

* more imports

---------

Co-authored-by: hbjORbj <[email protected]>
Co-authored-by: Keith Williams <[email protected]>
2025-03-03 15:33:32 -03:00
be77ac133c feat: Domain-wide delegation for Google Calendar and Google Meet (#16622)
* Add endpoints for testing the flow

* Add MVP

* new route

* Fixes

* Fixes

* Remove enable toggle support from domainWideDelegation

* Fixes

* Revert "Remove enable toggle support from domainWideDelegation"

This reverts commit c29e729206cd1fa063f9c9ce0cf148ef1577d60b.

* Revert yarn.lock

* More fixes

* Fix new workspace platform add

* refactor: improvements

* refactor: bug fixes and improvements

* fix: type errors

* fix: conflicts

* chore: update test

* fix: logic

* chore: improvements

* fix: toglle

* fix: bugs

* fix: type err

* chore: check number type

* fix: after conflicts

* chore: fix type err

* fix: type errors and tests

* fix: tets

* test

* chore: remove unused

* fix: google meet url on booking page and secondary calendar

* fix: add property

* fix: type err

* fix: re assingment bug

* fix: use getAllCredentials

* chore: fix import

* fix: installed count

* fix: pass event type

* fix: import

* fix: [Stacked PR] Review fixes (#17958)

* Review fixes

* fix: destination calendar bug

---------

Co-authored-by: Udit Takkar <[email protected]>

* refactor: use repository

* chore: remove duplicate

* fix: More review fixes for domain wide delegation (#17969)

* Reuse buildCredentialPayloadForCalendar

* fixes

---------

Co-authored-by: Udit Takkar <[email protected]>

* fix ts error

* Fix getSchedule not using dwd credentials (#17995)

* fix: Remove direct DWD table access from google-calendar and remove delegatedToId column from Credential (#18015)

* Remove fn rename to reduce number of files changed

* chore: check feature globally

* test: add unit tests

* chore: move function

* test: add booking test

* wip

* Remove domain-wide-delegation team feature flag

* Make sure duplicate calendars are not shown due to DWD. Show DWD when there is conflict

* Fix tests and their ts errors

* Fix more tests

* Move findUsersForAvailabilityCheck to separate file as it has AppStore dependency causing problem with Routing Forms. Build crashes

* fix: Multiple calendar connections from Google not showing up in apps/installed

* DestinationCalendar must have either credentialId or domainWideDeelgationId. Also handle the case when DWD is disabled and there was a non-dwd credential that could be used

* Disable deletetion of DWD as it is destructive and prefer disabling instead

* Show DWD credential calendars at the top

* Fixed tests

* Calendar Cache DWD support

* Self-Review: Verify email required and add more selectedCalendar tests

* Self Review: shorten names

* Self ReviewL Dead code removal

* Revert "Calendar Cache DWD support"

This reverts commit 009f236470fa21eba5986117d4f6e4d4c5e38c34.

* Some misc fixes

* fixes

* Performance improvememt in slots loading and booking

* More cases for handling dwd credentials

* simplify the logic. Ensure that EventManager and the modules below it in the flow have CredentialForCalendarService available

* Fix tests

* Fix installed/conferencing not showing gogole meet

* Shorten name

* Fix ApI v2 tests

* Add some more tests

* add getSchedule tests

* Improve tests

* Make Google Meet default when DWD for google is enabled

* Enable feature flagging for DWD

* chore: bump libraries

* Encrypt serviceaccount private key

* Fix ts errors

* bump platform libraries

* org add dwd

* org add dwd

* bump platform libraries

* fix selected calendars

* fix remove selected dwd calendar

* remove oauthclient id aliad in authedCalendar

* remove oauthclient id aliad in authedCalendar

* refactor: OrganizationsDwdController

* chore: export toggleDwdEnabled from platform-libraries

* feat: v2 update (enable / disable) dwd

* refactor: SelectedCalendarsController check if user belongs to dwd org & for not dwd use previous logic

* wip: DestinationCalendar send domainWideDelegationCredentialId from frontend to api

* try fix set destination calendar api v2

* fixup! try fix set destination calendar api v2

* setting google meet as default location working for dwd

* bump platform libraries version

* allow office 365 workspace slug

* allow office 365 workspace slug

* chore: v2 create dwd MS and Google service keys input

* fix: CreateDwdInput serviceAccountKey

* fix: CredentialForCalendarService type

* fix: check workspace slug

* feat: update serviceAccessKey of DWD

* testing

* fixup! testing

* fix: getAuthUtl bug

* fix: unit tests

* fix: type err and unit test

* fix: e2e test

* fix: credentials bug and failing unit tests

* Update CalendarService.ts

* chore: refactor office365 calendar service and add testDomainWideDelegationSetup

* fix: office365Calendar use correct clientId/Secret for DWD

* fix: office365Calendar dwd no need refresh token

* test: add unit test for outlook dwd and setup

* feat: added dwd support for office365 calendar

* feat: added dwd support for office365 video

* test: finish test for outlook dwd

* fix: create dialog bug

* chore: remove console logs

* fix: refreshToken bug

* bump version libraries

* refactor: fetch dwd credentials only in findQualifiedHosts

* fixup! refactor: fetch dwd credentials only in findQualifiedHosts

* fix: type err

* fix: type err

* fix: getUserDisplayName

* fix: unit test

* chore: bump platform lib

---------

Co-authored-by: Syed Ali Shahbaz <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Morgan Vernay <[email protected]>
Co-authored-by: supalarry <[email protected]>
Co-authored-by: Somay Chauhan <[email protected]>
Co-authored-by: Morgan <[email protected]>
2025-03-02 16:52:57 -03:00
be3e580107 feat: domain wide delegation UI (#18013)
Co-authored-by: Hariom <[email protected]>
2024-12-09 08:27:16 +05:30
3eaccb8738 fix: Preview queue position and contact owner in preview (#17552)
* wip

* Add preview mode in router

* only fetch bookings of this month for weighted rr

* test set up

* only get bookings of current month

* reverts test setup

* first changes for weight adjustments

* reset booking count + adjust calibration

* depreciate weightAdjustment

* get only bookings created this month

* fix typo

* make sure createdAt for hosts is correct

* use earliest possibel date as fallback

* add missing createdAt date to tests

* fix typo

* clean up changes in tests

* fix typo

* change end date to current date

* fix: Fall back to empty host array when no hosts are found

* fix: Restructure code a little

* fixed test, incorrectly used now outdated var

* perf: remove Dayjs from getLuckyUser

* Refactor getHostsWithCalibration for optimised performance, intentionally break test as findMany is always an array

* Better mock for host.findMany

* Remove team-event-types.test.ts, move to appropriate package

* TypeScript cannot auto-infer that an array is non-empty when assigning to a var

* fix: Type Fixes and DistributionMethod enum add

* Optimise tests

* Added test to show that bookings made before a newHost was added affect the lucky user result

* Throw error when the usersWithHighestPriority is empty, which should never happen

* WIP

* remove comment

* update migrations

* get attributes weights and virtual queue data

* use attribute weights and use bookings of virtual queue only

* clean up migrations

* Add shortfall column and add tests

* code clean up from feedback

* wrapper function for getLuckyUser

* code clean up

* fetch routingFormResponse in handleNewBooking

* fix type errors

* fix type errors in tests

* fix getAttributesQueryValue import for tests

* fix totalWeight

* add test for attributes weights and virtual queues

* clean up code

* add test for prepareQueuesAndAttributesData

* remove console.log

* use lazy import

* Add more tests and more columns to matching members queue

* fix issue from merge

* always send usersAndTheirBookingShortfalls

---------

Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
2024-11-15 20:39:46 +00:00
Keith WilliamsandGitHub b38d8e7ae4 perf: New getTeamSchedule route with higher vCPUs (#17277) 2024-10-23 13:38:15 -07:00
Omar LópezandGitHub 8e76d7bd10 chore: fix formatting (#16750) 2024-09-21 02:10:12 +00:00
Syed Ali ShahbazandGitHub c4a1382982 chore: add granular logging to the logger (#16734)
* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update turbo.json

* Update trpc-provider.tsx

* Update logger.ts

* update prisma index

* Update trpc.ts

* Update trpc-provider.tsx

* Update trpc.ts

* Update .env.example

* Update logger.ts
2024-09-20 09:06:37 +00:00
08e1b0a9c8 feat: attributes (#15964)
Co-authored-by: Joe Au-Yeung <[email protected]>
Co-authored-by: Omar López <[email protected]>
2024-08-15 14:49:05 -07:00
+24 0a15483c46 feat: platform atoms + api v2 (#14106)
* 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 <[email protected]>
Co-authored-by: Morgan Vernay <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
Co-authored-by: DmytroHryshyn <[email protected]>
Co-authored-by: zomars <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Crowdin Bot <[email protected]>
Co-authored-by: Pratik Kumar <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Samyabrata Maji <[email protected]>
Co-authored-by: Manpreet Singh <[email protected]>
Co-authored-by: Benny Joo <[email protected]>
Co-authored-by: Dmytro Hryshyn <[email protected]>
Co-authored-by: DmytroHryshyn <[email protected]>
Co-authored-by: zomars <[email protected]>
Co-authored-by: Varun Prahlad Balani <[email protected]>
Co-authored-by: Mike Zhou <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Haran Rajkumar <[email protected]>
Co-authored-by: Morgan Vernay <[email protected]>
Co-authored-by: Harshith Pabbati <[email protected]>
Co-authored-by: Brendan Woodward <[email protected]>
Co-authored-by: Morgan <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
Co-authored-by: Ryukemeister <[email protected]>

* 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 <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>

* 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 <[email protected]>

* fix: organization user shouldn't be asked for payment for a premium username (#13535)

Co-authored-by: Joe Au-Yeung <[email protected]>

* 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 <[email protected]>
Co-authored-by: GitStart-Cal.com <[email protected]>
Co-authored-by: gitstart-calcom <[email protected]>
Co-authored-by: Morgan <[email protected]>
Co-authored-by: Joe Au-Yeung <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* fix date overrides typing issues (#14091)

Co-authored-by: Morgan <[email protected]>

* fix: v2 e2e tests (#14088)

* fix: v2 e2e tests

* fix: yarn e2e tests run 1 after another

* fix gcal test

---------

Co-authored-by: Lauris <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>
Co-authored-by: Lauris Skraucis <[email protected]>
Co-authored-by: Erik <[email protected]>
Co-authored-by: sean-brydon <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Crowdin Bot <[email protected]>
Co-authored-by: Pratik Kumar <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Samyabrata Maji <[email protected]>
Co-authored-by: Manpreet Singh <[email protected]>
Co-authored-by: Benny Joo <[email protected]>
Co-authored-by: Dmytro Hryshyn <[email protected]>
Co-authored-by: DmytroHryshyn <[email protected]>
Co-authored-by: zomars <[email protected]>
Co-authored-by: Varun Prahlad Balani <[email protected]>
Co-authored-by: Mike Zhou <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Haran Rajkumar <[email protected]>
Co-authored-by: Harshith Pabbati <[email protected]>
Co-authored-by: Brendan Woodward <[email protected]>
Co-authored-by: Amit Sharma <[email protected]>
Co-authored-by: Keith Williams <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
Co-authored-by: Hariom Balhara <[email protected]>
Co-authored-by: Joe Au-Yeung <[email protected]>
Co-authored-by: gitstart-app[bot] <57568882+gitstart-app[bot]@users.noreply.github.com>
Co-authored-by: gitstart-calcom <[email protected]>
Co-authored-by: GitStart-Cal.com <[email protected]>
Co-authored-by: gitstart-calcom <[email protected]>
Co-authored-by: Anant Jain <[email protected]>
Co-authored-by: Lauris <[email protected]>
Co-authored-by: supalarry <[email protected]>
2024-03-20 13:23:19 +02:00
1064e1181d feat: SCIM 2.0 Automatic User provisioning (#11169)
Co-authored-by: Alex van Andel <[email protected]>
Co-authored-by: Keith Williams <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Joe Au-Yeung <[email protected]>
Co-authored-by: Joe Au-Yeung <[email protected]>
Co-authored-by: sean-brydon <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
2024-03-06 16:34:21 -07:00
+1 30ba168fc3 chore: bump @trpc/* and @tanstack/react-query (#13335)
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Omar López <[email protected]>
Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
Co-authored-by: zomars <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Benny Joo <[email protected]>
Co-authored-by: Carina Wollendorfer <[email protected]>
Co-authored-by: Gergő Móricz <[email protected]>
Co-authored-by: Keith Williams <[email protected]>
2024-01-23 16:42:29 -07:00
ca78be011c chore: [app-router-migration-1] migrate the pages in settings/admin to the app directory (#12561)
Co-authored-by: Dmytro Hryshyn <[email protected]>
Co-authored-by: DmytroHryshyn <[email protected]>
Co-authored-by: zomars <[email protected]>
2023-12-01 13:07:26 -07:00
3e08c66888 refactor: Use template literal instead of '+' operator (#11444)
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: zomars <[email protected]>
2023-10-03 11:52:19 -07:00
+16 68bd877c5b feat: OAuth provider for Zapier (#11465)
Co-authored-by: Alex van Andel <[email protected]>
Co-authored-by: sajanlamsal <[email protected]>
Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: alannnc <[email protected]>
Co-authored-by: Leo Giovanetti <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: Hariom Balhara <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: Nitin Panghal <[email protected]>
Co-authored-by: Omar López <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: zomars <[email protected]>
Co-authored-by: Shivam Kalra <[email protected]>
Co-authored-by: Richard Poelderl <[email protected]>
Co-authored-by: Crowdin Bot <[email protected]>
Co-authored-by: Joe Au-Yeung <[email protected]>
Co-authored-by: Nafees Nazik <[email protected]>
Co-authored-by: Chiranjeev Vishnoi <[email protected]>
Co-authored-by: Denzil Samuel <[email protected]>
Co-authored-by: Syed Ali Shahbaz <[email protected]>
Co-authored-by: nitinpanghal <[email protected]>
Co-authored-by: Ahmad <[email protected]>
Co-authored-by: Annlee Fores <[email protected]>
Co-authored-by: Keith Williams <[email protected]>
Co-authored-by: Vijay <[email protected]>
2023-09-28 12:41:28 -07:00
3b50fe075d fix: remove kyc and make text messages to attendee org only (#11389)
* add orgs upgrade badge to select

* don't allow updating to if no teams or orgs plan

* make sure only paying users can request verification codes

* add new action helper function

* remove kyc code

* code clean up

* fix verify button UI

* fix type errors

* add eventTypeRequiresConfirmation everywhere

* address feedback

---------

Co-authored-by: CarinaWolli <[email protected]>
2023-09-20 23:22:05 -07:00
f80e9b2558 feat: add basecamp integration to cal.com (#9195)
* feat: installing the app works

* Update yarn.lock

* feat: /api/callback now gets user auth info from basecamp

* feat: updated basecamp logo

* feat: added project dropdown on event apps page

* feat: basecamp event creation and deletion working

* feat: basecamp event rescheduling now works

* refactor(CalendarService): basecamp CaldendarService code clean up

* refactor: code cleanup for basecamp app API

* feat: updated event summary text sent to basecamp

* chore: updated basecamp images and contact info

* fix: fixed typescript errors and added logic to refresh tokens on event settings

* refactor(CaldendarService): used refreshAccessToken from helpers.ts instead

* chore: updated basecamp description

* fix: fixed incorrect import

* fix: accidentally deleted props to toggle app for event

* chore: updated .env.appStore.example and added README for app

* Update .env.appStore.example

Co-authored-by: Leo Giovanetti <[email protected]>

* feat: added basecamp userAgent in env instead of hardcoded value

* feat: updated README to include how to set basecamp user agent env

* fix: removed unused import

* feat: used URLSearchParams to construct url params

* fix: fixed typescript errors

* chore: updated README to include an example on how to set basecamp user-agent

* feat: using TRPC instead of REST

* chore: removed old projects REST code

---------

Co-authored-by: Leo Giovanetti <[email protected]>
2023-08-19 17:04:56 -03:00
c7dfa7bc89 fix: add extra security layers for sending messages to attendees (#10636)
Co-authored-by: CarinaWolli <[email protected]>
2023-08-10 11:52:36 -07:00
57384eb921 perf: Replace un-needed context fetching (#10657)
* Replace ctx.user.credentials to fetch in their own usecases

* Remove rawavatar from return

* Remove avatar rawAvatar from handler

* Fix fallback avatars

* fix: profile.slug already includes /team

* perf: Deprecate useAvatarQuery hook

* Extract to reusable credential func

* Fix type errors for credentials

* credentialOwner was inferred incorrectly, string non-nullable

---------

Co-authored-by: Keith Williams <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
2023-08-10 18:07:09 +01:00
sean-brydonandGitHub 0969d5960a feat: temp admin user management
## What does this PR do?
Loom: https://www.loom.com/share/361ca6ca9b5748079cba59ed2f348d90

Not all items on edit from update the user. This is very temp page to help Milos

How to test:
Login as admin user
settings > admin > users
search - see filtered users
scroll to bottom of list - notice we refetch before you hit the bottom so you dont notice items loading
delete user -> user is deleted and removed from list (radix bug in main causes dialog to freeze refresh to make this go away)
edit user -> Edit users email/username/identityprovider. Not all items on this update work just yet. These will be picked up when we come to implement the proper user table.
2023-07-07 18:25:21 +05:30
c5483c81de feat: Organizations (#8993)
* Initial commit

* Adding feature flag

* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)

* Change scopedMembers to orgMembers

* Change to orgUsers

* Letting duplicate slugs for teams to support orgs

* Covering null on unique clauses

* Supporting having the orgId in the session cookie

* feat: organization event type filter (#9253)

Signed-off-by: Udit Takkar <[email protected]>

* Missing changes to support orgs schema changes

* feat: Onboarding process to create an organization (#9184)

* Desktop first banner, mobile pending

* Removing dead code and img

* WIP

* Adds Email verification template+translations for organizations (#9202)

* First step done

* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding

* Step 2 done, avatar not working

* Covering null on unique clauses

* Onboarding admins step

* Last step to create teams

* Moving change password handler, improving verifying code flow

* Clearing error before submitting

* Reverting email testing api changes

* Reverting having the banner for now

* Consistent exported components

* Remove unneeded files from banner

* Removing uneeded code

* Fixing avatar selector

* Using meta component for head/descr

* Missing i18n strings

* Feedback

* Making an org avatar (temp)

* Check for subteams slug clashes with usernames

* Fixing create teams onsuccess

* feedback

* Making sure we check requestedSlug now

---------

Co-authored-by: sean-brydon <[email protected]>

* feat: [CAL-1816] Organization subdomain support (#9345)

* Desktop first banner, mobile pending

* Removing dead code and img

* WIP

* Adds Email verification template+translations for organizations (#9202)

* First step done

* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding

* Step 2 done, avatar not working

* Covering null on unique clauses

* Onboarding admins step

* Last step to create teams

* Moving change password handler, improving verifying code flow

* Clearing error before submitting

* Reverting email testing api changes

* Reverting having the banner for now

* Consistent exported components

* Remove unneeded files from banner

* Removing uneeded code

* Fixing avatar selector

* Using meta component for head/descr

* Missing i18n strings

* Feedback

* Making an org avatar (temp)

* Check for subteams slug clashes with usernames

* Fixing create teams onsuccess

* Covering users and subteams, excluding non-org users

* Unpublished teams shows correctly

* Create subdomain in Vercel

* feedback

* Renaming Vercel env vars

* Vercel domain check before creation

* Supporting cal-staging.com

* Change to have vercel detect it

* vercel domain check data message error

* Remove check domain

* Making sure we check requestedSlug now

* Feedback and unneeded code

* Reverting unneeded changes

* Unneeded changes

---------

Co-authored-by: sean-brydon <[email protected]>

* Vercel subdomain creation in PROD only

* Making sure we let localhost still work

* Feedback

* Type check fixes

* feat: Organization branding in side menu (#9279)

* Desktop first banner, mobile pending

* Removing dead code and img

* WIP

* Adds Email verification template+translations for organizations (#9202)

* First step done

* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding

* Step 2 done, avatar not working

* Covering null on unique clauses

* Onboarding admins step

* Last step to create teams

* Moving change password handler, improving verifying code flow

* Clearing error before submitting

* Reverting email testing api changes

* Reverting having the banner for now

* Consistent exported components

* Remove unneeded files from banner

* Removing uneeded code

* Fixing avatar selector

* Org branding provider used in shell sidebar

* Using meta component for head/descr

* Missing i18n strings

* Feedback

* Making an org avatar (temp)

* Using org avatar (temp)

* Not showing org logo if not set

* User onboarding with org branding (slug)

* Check for subteams slug clashes with usernames

* Fixing create teams onsuccess

* feedback

* Feedback

* Org public profile

* Public profiles for team event types

* Added setup profile alert

* Using org avatar on subteams avatar

* Making sure we show the set up profile on org only

* Profile username availability rely on org hook

* Update apps/web/pages/team/[slug].tsx

Co-authored-by: sean-brydon <[email protected]>

* Update apps/web/pages/team/[slug].tsx

Co-authored-by: sean-brydon <[email protected]>

---------

Co-authored-by: sean-brydon <[email protected]>

* feat: Organization support for event types page (#9449)

* Desktop first banner, mobile pending

* Removing dead code and img

* WIP

* Adds Email verification template+translations for organizations (#9202)

* First step done

* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding

* Step 2 done, avatar not working

* Covering null on unique clauses

* Onboarding admins step

* Last step to create teams

* Moving change password handler, improving verifying code flow

* Clearing error before submitting

* Reverting email testing api changes

* Reverting having the banner for now

* Consistent exported components

* Remove unneeded files from banner

* Removing uneeded code

* Fixing avatar selector

* Org branding provider used in shell sidebar

* Using meta component for head/descr

* Missing i18n strings

* Feedback

* Making an org avatar (temp)

* Using org avatar (temp)

* Not showing org logo if not set

* User onboarding with org branding (slug)

* Check for subteams slug clashes with usernames

* Fixing create teams onsuccess

* feedback

* Feedback

* Org public profile

* Public profiles for team event types

* Added setup profile alert

* Using org avatar on subteams avatar

* Processing orgs and children as profile options

* Reverting change not belonging to this PR

* Making sure we show the set up profile on org only

* Removing console.log

* Comparing memberships to choose the highest one

---------

Co-authored-by: sean-brydon <[email protected]>

* Type errors

* Refactor and type fixes

* Update orgDomains.ts

* Feedback

* Reverting

* NIT

* fix issue getting org slug from domain

* Improving orgDomains util

* Host comes with port

* Update useRouterQuery.ts

* Feedback

* Feedback

* Feedback

* Feedback: SSR for user event-types to have org context

* chore: Cache node_modules (#9492)

* Adding check for cache hit

* Adding a separate install step first

* Put the restore cache steps back

* Revert the uses type for restoring cache

* Added step to restore nm cache

* Removed the cache-hit check

* Comments and naming

* Removed extra install command

* Updated the name of the linting step to be more clear

* Removes the need for useEffect here

* Feedback

* Feedback

* Cookie domain needs a dot

* Type fix

* Update apps/web/public/static/locales/en/common.json

Co-authored-by: Omar López <[email protected]>

* Update packages/emails/src/templates/OrganizationAccountVerifyEmail.tsx

* Feedback

---------

Signed-off-by: Udit Takkar <[email protected]>
Co-authored-by: Joe Au-Yeung <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
Co-authored-by: sean-brydon <[email protected]>
Co-authored-by: zomars <[email protected]>
Co-authored-by: Efraín Rochín <[email protected]>
Co-authored-by: Keith Williams <[email protected]>
2023-06-14 21:40:20 +00:00
9e70a985e4 feat: email verification (#9081)
* Verify - inital email commit

* Add token type - api redirect - migration

* Redirect and valid api callback route

* Update email design

* Change signup URL to redirect to verify-email

* Add feature flag - add a11y text to email - add top banner

* Shell shouldnt redirect to onboarding if the user needs to verify account

* Move flag check to server

* Cleanup

* Rate limit

* Fix redirects

* Remove api signup mess

* Double negation for forced bool

* Fix props

* Update packages/emails/templates/account-verify-email.ts

* Enable migration by default

* Fix typos

* Fix google verify issue

* Update packages/features/auth/lib/verifyEmail.ts

Co-authored-by: Hariom Balhara <[email protected]>

* NITS: @harioms addressed

* Remove schema changes

* Fix NITs+ improvments

* Update apps/web/pages/api/auth/verify-email.ts

Co-authored-by: Omar López <[email protected]>

* Update packages/features/ee/common/components/LicenseRequired.tsx

Co-authored-by: Omar López <[email protected]>

* Update apps/web/pages/api/auth/verify-email.ts

Co-authored-by: Omar López <[email protected]>

* Always preloads feature flags

* Update verifyEmail.ts

* Update schema.prisma

* Type fix

---------

Co-authored-by: Hariom Balhara <[email protected]>
Co-authored-by: Omar López <[email protected]>
2023-06-07 07:27:48 +00:00
fbbc573f33 chore: remove deprecated metamask and rainbow (#9299)
* Remove deprecated code related to rainbow

* Remove translations for rainbow specific features

* Remove english translations for metamask

* Remove translations for metamask

* Fix lint issues

* Fix prettier issues

* update yarn lock

* Generated yarn.lock with submodules

* Added auth submodule deps

---------

Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: alannnc <[email protected]>
Co-authored-by: Alex van Andel <[email protected]>
2023-06-06 11:18:44 +00:00
d63e7372cb [Feat] Bulk Invite of Users + Google Workspace (#8969)
* Base UI work

* Bulk invite users

* WIP workspace oauth implementation

* Seperate components - add existing gcal check

* Move callback session to getServerSession

* Implementation of state redirect back to teams on login

* Add callback to populate text field

* Change error message

* Redirect from callback and open modal

* Fix bulk translations

* Fix translations for google button

* Delete Query

* Feature flag this

* Update packages/trpc/server/routers/viewer/teams/inviteMember.handler.ts

* Check if Gcal in installed globally

* Add new router

* Add missing [trpc] route

* Feedback

* Update packages/trpc/server/routers/viewer/googleWorkspace/googleWorkspace.handler.ts

* Typefixes

* More typefixes

---------

Co-authored-by: Hariom Balhara <[email protected]>
Co-authored-by: zomars <[email protected]>
2023-05-24 01:01:31 +00:00
3239976e18 Fix: Profile update refresh issues (#8570)
* profile update refresh fixes

* updated avatar based on logged in user

* lint & types check fixes

* fixed settings layout to fetch udpated session

* pushing the 8448 changes to separate PR

* removing hook not required

* Removed extra code

---------

Co-authored-by: Keyur Patel <[email protected]>
Co-authored-by: Alan <[email protected]>
2023-05-20 00:37:58 +00:00