* Revert "Revert "chore: rename DWD to DelegationCredential (#19703)" (#19734)"
This reverts commit 340b5ab061.
* chore: fix schema and types for now
* fix: domainWideDelegationCredentialId error type
* fix: cancelledby to work on api v1
* fix: scheduleId to work with hosts in eventtype api v1
* Update event-type.ts
---------
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
* 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 <udit222001@gmail.com>
* refactor: use repository
* chore: remove duplicate
* fix: More review fixes for domain wide delegation (#17969)
* Reuse buildCredentialPayloadForCalendar
* fixes
---------
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
* 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 <52925846+alishaz-polymath@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: Udit Takkar <udit222001@gmail.com>
Co-authored-by: Morgan Vernay <morgan@cal.com>
Co-authored-by: supalarry <laurisskraucis@gmail.com>
Co-authored-by: Somay Chauhan <somaychauhan98@gmail.com>
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
* Create `createUser` method in `userCreationService`
* Refactor `UserRepository` create method to accept prisma input and remove business logic
* API use `UserCreationService`
* Move slugify to service
* Use hashPassword instead
* Type fixes in `UserCreationService`
* Add `userCreationService` tests
* API accept data object
* Type fixes
* Add user _post test
* Add test for locked user
* Add locked param to log
* Add user repository tests
* Do not return locked status
* Explicitly pass `locked` prop
* Fix tests when locked isn't returned
* Fix tests
* Pass locked prop
* Edit test name
* Use logger
* Fix passing hashed password
* migration and init to accept creationSource for new bookings
* V1 create booking
* V1 user creation
* webapp booking + V1 user
* user creation in V1, V2 and webapp
* booking source V2 and fix for v1 user
* fit type
* --fix type
* add test -- WIP
* fix type
* fix type
* ^
* Need more sleep zzz
* -_-
* bump libraries platform
* adds for v2 recurring booking
* fix lint
* instant meetings
* fix: api v2 creation source
* fixup! fix: api v2 creation source
* bump libraries
* add user
* fix test
* fixup! fix test
* add more source
* more source...
* fix type & test --1
* fix type & test --2
* typefix
* fixup test
---------
Co-authored-by: Morgan Vernay <morgan@cal.com>
* fix: use userId as ratelimit identifier
Using raw api keys as identifiers is problematic because they are logged
and are accessible via Unkey's UI.
My first idea was to use the api key's primary key, which would solve
this just fine. But after looking at the implementation it seemed easier
to use the user's id, which is what most people are interested in
limiting, not the actual keys. Also the userId was already passed in the
requests context, which made it easier. Sean confirmed that ratelimiting
the user, not their keys made more sense, so here we are.
* Update rateLimitApiKey.ts
* Update rateLimitApiKey.ts
* Fix tests
* Fix tests
---------
Co-authored-by: Benny Joo <sldisek783@gmail.com>
Co-authored-by: Joe Au-Yeung <j.auyeung419@gmail.com>
* add delete to redis service
* auto lock + tests
* changes to autolock in api/book call
* remove log clutter
* add detection in api v1
* tpye changes
* throw error and add tests for API
* add response logic on locked + tests
* type response properly i hope?
* type fix
* add tests for counter not existing + redis errors
* remove IP - add sentry to track
* rename symbol
* fix type error
* fix tests
* remove sentry call spy
* fix type on sentry setUser call
---------
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* Add email domain array
* Create numbered email domain object
* Check email domain
* Rename function
* Add tests
* Frontend enable skip ownership check if free email domain
* Backend ignore adding ownership to return records if free email domain check is enabled
* feat: Only require confirmation for free email domains (#17917)
* Add requiresConfirmationForFreeEmail to db
* Add option to event type settings
* Get requiresConfirmationForFreeEmail for event type page
* Include requiresConfirmationForFreeEmail in fetching event type
* Pass bookerEmail to `getRequiresConfirmationFlags`
* Add free email domain check to `determineRequiresConfirmation`
* Add `requiresConfirmationForFreeEmail` to types
* Add severity to Watchlist table
* Add migration for watchlist severity
* Add `getEmailDomainInWatchlist` method to watchlist repository
* Use watchlist repository to check for free email domain
* Mock watchlist repository in test
* Update test
* Rename method
* Add severity to blocked list
* Move check free email domain to async
* Type checks
* Adjust for promise returned
* Fix tests
* Fix
* Fix tests
* lock users on signup if their email is in blacklist
* add to turbo env list
* prevent locked user or blocked email domain from using API
* Refactored to only run 1 query to find the user
* Fixing tests
* WIP
* WIP
* WIP
* Discard changes to turbo.json
* Fixed tests
* Update isLockedOrBlocked.test.ts
* Update isAdmin.integration-test.ts
* Update tsconfig.json
* chore: rename to watchlist
Signed-off-by: Omar López <zomars@me.com>
---------
Signed-off-by: Omar López <zomars@me.com>
Co-authored-by: sean-brydon <sean@cal.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* seed to org
* more org+routing form seed improvments
* add routing responses
* check if attributes already exist to prevent crash
* remove files not for PR
* fix type error
* fix connection
* assign manually
* fix seed
* update to match integration tests
* fix integration test to new user count
* chore: remove react-query as unneeded
* chore: Re-gen lockfile
* chore: Bump next.js to v13.5.6
* yarn.lock regen after apps/console next version bump
---------
Co-authored-by: Alex van Andel <me@alexvanandel.com>
* chore: Couple fixes to improve error reporting
* tweak: Fix error message
* refactor: Use findUniqueOrThrow instead of guard
* fix: Broken test, missing ID - suspect it passes because only one record exists
* chore: Minor refactor to split ZodEffect from ZodType
* fix: Satify typescript
* chore: Add summaries for all API v2 endpoints
* Updated to Get all calendars
* Fix build issues
* Removed unneeded Swagger UI options
* Fix issues with OpenAPI spec
* add booking booking to team settings
* add update mutation
* add missing export
* fix dirty state
* first version of global team limits in getUserAvailability
* add test setup
* create seperate test file for global limits
* add tests for all units
* move limitManager and booking limit functions outside of getUserAvailability
* add migration
* clean up code
* move yearly booking count to booking repository
* code clean up
* don't count rescheduling booking
* add test for getSchedule
* fix type error
* fix type error
* fix type error
* fix from and end date for fetching bookings
* reuse functions
* allow null for bookingLimits
* remove bookings from managed event type
* fix type error
* code clean up
* small fixes form clean up
* fix type issue
* same fixes in teams/_post
* fix existing tz issue
* tests for fix
* adds missingn await
* imrove description
* remove spreading
* fix reschedule issue with booking limits
* fix reschedule error with booking durations
* remove useeffect
* undo commit
* add bookingLimits to UpdateOrgTeamDto
* fix unit tests
* Prepare view for app router migration
* throw error if not in ascending order
* fix disabled update button
---------
Co-authored-by: CarinaWolli <wollencarina@gmail.com>
Co-authored-by: Joe Au-Yeung <j.auyeung419@gmail.com>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
* FEAT: Implement Dub.co for conversion tracking
* add link creation, @vercel/functions
* use refer.cal.com/:username instead of go.cal.com/r/:username
* sale conversion tracking
* add copy referral link
* limit to IS_CALCOM only
* Update yarn.lock
* fix DubAnalytics
* use workaround for isNewUser
* pass req to getOptions
* Update next-auth-options.ts
* fix ts errors
* only show DubAnalytics outside EU
* add Dub Analytics to /signup
* use WEBSITE_URL instead
* on-demand generate links
* add migration
* add check for existing link + change fetch method to poast
* remove refer.cal.com from PoweredByCal
* limit DubAnalytics to /signup only
* simplify generate-referral-link
* restore yarn.lock
* add yarn with dub sdk in
* add yarn with dub sdk in
* yarn
* Update yarn.lock
---------
Co-authored-by: sean <sean@brydon.io>
Co-authored-by: Peer Richelsen <peer@cal.com>
* chore: Add replexica for AI i18n
* Add write permission
* moved i18n to repo root
* Added checkout to i18n job
* Added contents:read
* Added actions: write for testing
* Updated contents: write
* feat: add missing translations
* Checking out the i18n files from PR head sha
* Added the rest of the languages
* Added i18n to list of required checks
* Added a comment explaining the custom common.json checkout
* Commented out languages to not crush Replexica usage
* Add a fetch-depth: 2
* Supporting fetch of external fork branch
* Put back the dynamic sha
* Added a check for null so this can run manually and not just on PRs
* Removed comments
* feat: update translations
* Reverted de and fr to re-run with new settings
* feat: update translations
* Reverted de and fr to re-run with new settings
* feat: update translations
* Removed crowdin
* Limited languages to major ones for 1st pass
* feat: update translations
* Fixing es test
* Reverted yarn.lock changes
---------
Co-authored-by: Replexica <support@replexica.com>
* feat: Add rescheduledBy & canceledBy fields in the DB
* fix: type check
* fix: type check
* fix: use session user email for reschedule
* fix: unit test
* feat: db field email validation
* feat: rescheduledBy and cancelledBy in webhooks
* revert unrelated changes.
* make session user secondary, default to Anonymous
* if condition not required
* Make cancelledBy optional
Co-authored-by: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com>
* update cancel booking type
* fix: update cancelledBy in db when requesting reschedule
* remove default value for fields
* fix: type check
* feat: manage fields via api v1
* fix: add fields in booking read api v1
* test: expand to cover new fields
* fix: use cancelledBy param on booking page
---------
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
Co-authored-by: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
* feat: Add upcoming bookings feature to GET /api/bookings endpoint
- Added support for filtering upcoming bookings by adding the `upcoming` query parameter to the GET /api/bookings endpoint.
- When `upcoming` is set to "true", only upcoming bookings are returned.
- Regular users can now retrieve only their upcoming bookings by setting `upcoming` to "true".
- System-wide admins and organization admins can also retrieve only upcoming bookings by setting `upcoming` to "true".
* feat: Add status filter to booking API endpoint
This commit adds a new `status` filter to the booking API endpoint. The `status` filter allows filtering bookings by their status, overriding the `dateFrom` and `dateTo` filters. The only valid value for the `status` filter is "upcoming".
* Update _get.ts
---------
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
* test: Add tests for POST /api/event-types endpoint
* revert: undo last unintended change in yarn.lock
* revert: undo last unintended change in package.json