Commit Graph
382 Commits
Author SHA1 Message Date
dda4b17a7c feat: Platform OAuthClient Webhooks (#16134)
* wip

* fixup! Merge branch 'main' into platform-oauth-client-webhooks

* wip

* fixup! Merge branch 'main' into platform-oauth-client-webhooks

* fixup! fixup! Merge branch 'main' into platform-oauth-client-webhooks

* fixup! fixup! fixup! Merge branch 'main' into platform-oauth-client-webhooks

* fixup! fixup! fixup! fixup! Merge branch 'main' into platform-oauth-client-webhooks

* fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into platform-oauth-client-webhooks

* fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into platform-oauth-client-webhooks

* fixup! fixup! fixup! fixup! fixup! fixup! fixup! Merge branch 'main' into platform-oauth-client-webhooks

* fixup! Merge branch 'platform-oauth-client-webhooks' of github.com:calcom/cal.com into platform-oauth-client-webhooks

* fixup! fixup! Merge branch 'platform-oauth-client-webhooks' of github.com:calcom/cal.com into platform-oauth-client-webhooks

---------

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2024-08-09 17:02:39 +02:00
Lauris SkraucisandGitHub ac0930a11f test: v2 new event-types endpoints handle legacy event-types (#16144)
* test: v2 new event-types endpoints return legacy event-types

* Update event-types.repository.fixture.ts
2024-08-09 13:14:28 +00:00
Lauris SkraucisandGitHub 2b9bdb9c80 fix: v2 event-types (#16132)
* refactor: have system and user booking fields schemas and united schema

* fix: event-types output service filter out system booking fields for response

* chore: v2 update platform-libraries to 0.0.25

* chore: platform-libraries export types and update changelog

* chore: add updated lock file
2024-08-08 20:21:56 +03:00
fba3f46779 fix: use singleton in license key service (#16131)
* use singleton

* fix typo

* Fix getInstance call

---------

Co-authored-by: Alex van Andel <me@alexvanandel.com>
2024-08-08 15:08:11 +00:00
MorganandGitHub b9a1522abc chore: oAuth Client Guard apv2 (#16130)
* chore: oAuh Client Guard apv2

* fixup! chore: oAuh Client Guard apv2

* fixup! Merge branch 'oauth-client-guard-' of github.com:calcom/cal.com into oauth-client-guard-

* fixup! fixup! Merge branch 'oauth-client-guard-' of github.com:calcom/cal.com into oauth-client-guard-

* fixup! fixup! fixup! Merge branch 'oauth-client-guard-' of github.com:calcom/cal.com into oauth-client-guard-
2024-08-08 14:45:22 +02:00
96b58422fd feat: Add upcoming bookings feature to GET /api/bookings endpoint (#16060)
* 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>
2024-08-07 13:08:04 +02:00
Udit TakkarandGitHub e075dcdeaa feat: create new markNoShow endpoint (#15738)
* feat: create new markNoShow endpoint

* chore: add schema

* chore: update name

* chore: save progress

* refactor: improve code and types

* fix: unit test

* chore: improvements

* chore: move query to booking repository

* fix: type error
2024-08-07 15:16:31 +05:30
Peer RichelsenandGitHub 629b9391dd Update README.md (#16049) 2024-08-06 16:02:08 +00:00
Pedro Henrique BragaandGitHub 253d0174be test: Create 5 tests cases for POST /api/event-types endpoint (#16082)
* 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
2024-08-06 15:36:21 +00:00
VijayandGitHub 7f1e20fe19 fix: #16041 team eventtype create from api (#16058)
* update for teameventType creation from api

* update to set userid null for team event
2024-08-06 13:48:01 +02:00
8fa39f2ae5 feat: Round robin reassignment via round robin algorithm [CAL-3138] (#14308)
* add reassign host to edit dropdown

* add dialog to reassign rr host

* Design improvements

* add translations

* only show reassign for admin/owner

* add first version of email template

* Init rr assign endpoint

* Pass booking information to rr assign endpoint

* Only allow attendee of booking to reassign themselves

* Send email to reassigned and cancelled member

* On reassign change calendar events

* Add workflows for new host

* On reassign new host - rr

* Fix icon

* Abstract reassignment logic

* Update calendar invite

* Add tests

* Clean up

* Merge with `main`

* Type fixes

* Add back dialog and handle no available hosts

* Handle if rr host is not organizer

* Fix calendar invites when organizer doesn't change

* Clean up

* Clean up

* Type fixes

* Type fixes

* Type fixes

* Type fixes

* Type fix

* Type fixes

* Type fixes

* Add custom responses to evt object

* Type fixes

* Type fix

* Type fix

* Type fixes

* Type fixes

* Type fix

* Type fix

* Update tests

* Type fixes

* Fix tests

* Fix tests

* Add booking repository

* Fix tests

* Fix tests

* Add doesUserIdHaveAccessToBooking for user

* Add check if user is team admin

* Check user permission tRPC route

* Type fixes

* Correct Promise.all

* UI fixes

* UI fixes

* Remove unused assigned hosts prop

* Type fix

* Remove unused frontend code

* Include user priority

* Fallback to event type users for older event types

* Get booking workflow reminder

* Revert back to eventType.hosts

* Fix lint

* Handle changing workflows

* Type fixes

* Type fixes

* Type fix

* Fix tests

* Update new booking imports

* Fix imports

* Type fix

* Type fix

* Fix adding all members to reassignment emails

* Fix cancelled RR emails to show old host

* Ensure consistent event titles

* Send new event workflows to new host

* Change event name if organizer changed

* Fix query error

* Delete old booking reference when reassigning

* Type fixes

* Type fixes

* Fix test

* Rename func isAdminOfTeamOrParentOrg

* Select specific workflow fields

* Address workflow feedback

* Delete const

* Address feedback

---------

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
2024-08-06 13:42:46 +02:00
Lauris SkraucisandGitHub 23eb77b8ac fix: re-booked booking metadata (#16074)
* fix: rescheduled booking metadata is overwritten by original booking metadata

* chore: bump v2 platform libraries to 0.0.23

* tests: re-scheduled booking metadata update
2024-08-06 11:15:32 +02:00
MorganandGitHub c059d79a51 feat: api v2 webhooks for users and event-types (#15996)
* feat: webhooks for users

* fixup! feat: webhooks for users

* feat: webhooks for user event types

* feat: webhooks for user event types

* fixup! Merge branch 'main' into feat-webhooks-api-v2

* doc

* chore: split webhook service

* chore: webhook repo only depends on prisma

* chore: split webhook outputs

* fixup! chore: split webhook outputs

* chore: describe payload template

* chore: pipe webhook input and output

* chore: use partialType for update dtos

* chore: improve dto
2024-08-02 12:18:35 +00:00
b91c767d0c feat: SysAdmin API Guard for Org Admins (#15867)
* adds column in schema

* adds org setting to enable/disable admin api

* adds guard to v1 v2

* add update query for isAdminAPIEnabled to be true for existing orgs

* adds contact sales

* fix typo

* fix tests

* fixup v2 guard

* v1 fix

* fix and add integration test

* fixes tests --WIP

* fix test --WIP

* fixupgit add src/modules

* WIP

* fix

* fix: e2e test org teams

* fix: e2e test org users

* review feedback

* requested change

* fix

---------

Co-authored-by: Keith Williams <keithwillcode@gmail.com>
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Morgan Vernay <morgan@cal.com>
2024-08-02 14:35:54 +04:00
MorganandGitHub 76377d2d2c chore: disconnect prisma on module destroy apiv2 (#16018) 2024-08-01 09:41:50 +00:00
MorganandGitHub a561b805fd chore: add doc + test reschedule booking api v1 (#15907)
* chore: add doc + test reschedule booking api v1

* fixup! Merge branch 'main' into fix-reschedule-booking-api-v1
2024-07-31 00:22:25 +03:00
41e565fcf8 refactor: platform org event types (#15961)
* chore: platform-libraries export updateNewTeamMemberEventTypes

* chore: platform-libraries export updateNewTeamMemberEventTypes

* chore: v2 api bump platform-libraries to 0.0.22

* fix: add created managed user to assignAllMembers: true team event-types

* fix: add created organizations user to assignAllMembers: true team event-types

* refactor: organization teams chose if team creator is auto-accepted

* refactor: managed users have only 2 default event types with video

* refactor: lowercase schedulingType for creating team event-types

* refactor: lowercase schedulingType for creating team event-types

* feat: separate platform teams by OAuth client

* swagger regenerate

* refactor: delete platform team when oauth client deleted

* revert: keep 4 default event-types

* fix: tests && merge of main into this branch

* fix: typecheck

---------

Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
2024-07-30 22:23:31 +03:00
2f946fc5da feat: platform team event-types (#15928)
* fix: dont check OrganizationSettings.orgAutoAcceptEmail uniqueness for platform teams

* feat: display organizationId in OAuthClientCard

* feat: ApiAuthStrategy handle oauth credentials

* refactor: clean up ApiAuthStrategy test

* refactor: use ApiAuthGuard in OauthClientsUsersController and OAuthFlowController

* fix: copying org id

* refactor: more specific error message when api auth

* refactor: auto accept team creator membership

* feat: useTeamEventType and useTeamEventTypes hooks

* refactor: make team event-types public & searchable by eventSlug

* feat: include host name in team event-types hosts response

* fix: isFixed=true by default for COLLECTIVE event hosts

* fix: useTeamEventType eventSlug access

* feat: BookerPlatformWrapper enable team events by exposting orgId and teamId props

* refactor: provide orgId in atoms context

* refactor: use orgId from context in team event-types hooks

* refactor: return teams in useMe

* chore: examples app teams setup

* Revert "refactor: return teams in useMe"

This reverts commit de992ddc9af6ee9a2111938069f5b9c34cc2d8ea.

* Revert "chore: examples app teams setup"

This reverts commit 0766aa21acc25efa2361d38c3f87ddba773a0245.

* feat: useTeams hook

* chore: setup examples app with team event-type

* fix: small fixes

* swagger

* Revert "refactor: provide orgId in atoms context"

This reverts commit f053a498ee6f8fa8ece5ec8d8630c59eda8873e3.

* feat: orgId in atoms context

* feat: PlatformBilling guard

* chore: delete test of the deleted oauth-client-credentials.guard

* refactor: org event-types collective events isFixed always true and priority medium

* refactor: org event-types COLLECTIVE response ignore isFixed and priority as they are same

* fix: organizations event-types e2e

* fix: billing guard

* refactor: tests cleanup

* fix: platform plan guard spec

* refactor: e2e test cleanup

* seed error if not team

* refactor: rename authenticateApiKey to authenticateBearerToken

* refactor: transforming response hosts

* refactor: rename findUniqueByMatchingAutoAcceptEmail to findUniqueNonPlatformOrgsByMatchingAutoAcceptEmail

* refactor: rename findUniqueByMatchingAutoAcceptEmail to findUniqueNonPlatformOrgsByMatchingAutoAcceptEmail

---------

Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
2024-07-30 16:58:39 +02:00
MorganandGitHub 0ddcc068ce fix: bullMq redis connection string apiv2 (#15970)
* fix: bullMq redis connection string apiv2

* fixup! fix: bullMq redis connection string apiv2
2024-07-30 08:27:27 +00:00
baaa1fa71e chore: add global rate limiting to prevent abuse apiv2 (#15971)
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2024-07-30 06:34:31 +00:00
99a6b1c7eb refactor: v1 orgs unlimited teams (#15908)
* refactor: v1 orgs unlimited teams

* fix: response message ownerId

---------

Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2024-07-29 16:31:18 +03:00
e16662e655 feat: usage base billed - license key check - move to private api (#15222)
Co-authored-by: Omar López <zomars@me.com>
2024-07-25 13:20:24 -07:00
MorganandGitHub 64ef2703a5 feat: org members can fetch their teams apiv2 (#15910)
* feat: org members can fetch their teams apiv2

* fixup! feat: org members can fetch their teams apiv2

* feat: org members can fetch their teams apiv2

* fixup! feat: org members can fetch their teams apiv2

* fixup! fixup! feat: org members can fetch their teams apiv2

* fixup! fixup! fixup! feat: org members can fetch their teams apiv2

* fixup! fixup! fixup! fixup! feat: org members can fetch their teams apiv2
2024-07-25 10:39:43 +00:00
a997edd8db chore: update dtos for v2 calendars endpoint (#15904)
* init calendars input

* update request body input type

* fix incorrect naming

* update imprts

* fixup! update imprts

* fixup! fixup! update imprts

---------

Co-authored-by: Morgan Vernay <morgan@cal.com>
2024-07-25 08:49:18 +00:00
MorganandGitHub e8b36d5b0b chore: platform api usage based billing using queue (#15085)
* chore: platform api usage based billing using queue

* fixup! chore: platform api usage based billing using queue

* fixup! fixup! chore: platform api usage based billing using queue

* fixup! Merge branch 'chore-platformapi-billing-queue' of github.com:calcom/cal.com into chore-platformapi-billing-queue

* fixup! fixup! Merge branch 'chore-platformapi-billing-queue' of github.com:calcom/cal.com into chore-platformapi-billing-queue

* fixup! Merge branch 'main' into chore-platformapi-billing-queue

* chore: platform billing by userId

* fix: fix tests requirement team subscirption

* fixup! Merge branch 'main' into chore-platformapi-billing-queue

* fixup! fixup! Merge branch 'main' into chore-platformapi-billing-queue

* fixup! Merge branch 'main' into chore-platformapi-billing-queue

* improve tests logs

* fix: silently close redis and queue

* fixup! Merge branch 'main' into chore-platformapi-billing-queue

* fixup! Merge branch 'main' into chore-platformapi-billing-queue

* fixup! fixup! Merge branch 'main' into chore-platformapi-billing-queue

* fix: upgrade libraries version
2024-07-24 17:10:22 +02:00
Lauris SkraucisandGitHub dcc62c6db0 fix: CreateAvailabilityInput_2024_04_15 Cannot read properties of undefined (#15885) 2024-07-24 12:52:42 +00:00
07f14e4e14 test: test cases for POST selected-calendars (#15873)
* test-selected_calendars

* Update _post.test.ts

---------

Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
2024-07-24 14:29:09 +02:00
Keith WilliamsandGitHub ca5dcfd1e8 chore: Add v2 API test suite (#15865)
* chore: Add v2 API test suite

* Changed oauth credentials guard to e2e spec

* Uploading e2e artifacts

* Removed commented line
2024-07-24 11:02:03 +02:00
Lauris SkraucisandGitHub 324728d4ec refactor: v2 organizations event-types e2e tests (#15886) 2024-07-24 07:15:26 +00:00
Lauris SkraucisandGitHub 01dead9a1d refactor: auto-accept membership for v2 org team creator (#15866) 2024-07-23 12:34:33 +00:00
MorganandGitHub c209c22b98 chore: add cleanup to api auth strategy e2e test apiv2 (#15875) 2024-07-23 12:22:46 +00:00
b8610dc2d1 test: Create 4 test cases to POST Attendees (#15856)
* Create 4 test cases to POST Attendees

* Adjusted commented tips on PR

* Adjusted isAdmin to isSystemWideAdmin

* Removed req.isAdmin

* Delete test-insights.csv

---------

Co-authored-by: Amit Sharma <74371312+Amit91848@users.noreply.github.com>
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
2024-07-23 14:19:36 +02:00
b46a902a3d feat: api endpoints for calendar settings atom (#15761)
* calendars repository

* add disconnect endpoint

* update platform libraries to include getCalendar fn

* cleanup

* fix typings

* update calendars service to include delete credentials handler

* update typings

* add missing return

* refactor delete calendar credentials handler

* update disconnect endpoint

* fix typing

* fixup

* add handlers to insert and remove selected calendar

* init selected calendars controller

* fix naming

* output response dto for deleting calendar credentials

* fix typing

* fix merge conflicts

* resolve merge conflicts

* fixup

* cleanup

* capitalize controller name

* include selected calendars controller in selected calendars module

* fix type error

* cleanup

* fixup

* add calendars repository

* custom hook for calendar credentials

* fix typing

* cleanup

* take input from query params instead of body in delete request

* custom hook to add selected calendar

* custom hook to remove selected calendar

* better naming

* fix typo

* fixup

* update input for delete calendar query params

* address PR feedback

* add method to check calendar credentials

* abstract logic to check calendar credentials in calendars service

* resolve module errors

* export custom hooks for calendar settings

* e2e for deleting calendar credentials endpoint

* fix typo

* set authorization header to calendars post

* e2e tests for selected calendars controller

* fix output typing

* better error messages

* restructuring

* fix imports

* remove unused not found exception

* fixup! remove unused not found exception

---------

Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
Co-authored-by: Morgan Vernay <morgan@cal.com>
2024-07-22 17:26:39 +00:00
Lauris SkraucisandGitHub de2f51e104 feat: v2 API enable updating event type schedule (#15803)
* refactor: event-types CREATE, UPDATE accept scheduleId and return scheduleId

* chore: enable passing scheduleId to event-types create handler

* chore: use platform-libraries at version 0.0.20

* fix: remove team output schedule

* finish merge main into this branch

* fix: dont allow adding scheduleId to event-type if user does not own schedule
2024-07-22 20:09:54 +03:00
5becc95fc4 feat: Add a fresh signup to matching organization after email verification (#15705)
* Support automatically adding user to organization

* Use Repository

* Fix unit test

* Code Improvements

* Fix type error

---------

Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
2024-07-20 12:22:42 +05:30
Lauris SkraucisandGitHub 8b23e41954 feat: v2 organizations event types endpoints (#15775)
* fix: event-types input service transform length property

* feat: create organizations event-types controller, service and repository

* feat: enable organizations event types

* fix: create team request user isOrgAdmin check

* refactor: hosts array required in team input and output

* chore: use platform-libraries at version 0.0.19

* tests: test organizations event-types

* feat: enable managed event-types

* chore: fix main merge into this branch

* feat: assign all team members for managed event-types

* refactor: gathering managed event-type users ids

* chore: include assignAllTeamMembers in team event response

* test: assign all team members db event

* chore: delete unused files

* docs: swagger create and update request body objects

* revert: event-types platform-libraries update

* refactor: organisations event-types endpoints accessible by TEAM_ADMIN and up

* fix: managed event types output hosts array empty

* fix: dont allow creating event-type for non-team member

* chore: delete unused variables

* tests: negative tests

* chore: finish main merge
2024-07-19 15:12:05 +00:00
MorganandGitHub 94873ea3cb fix: api-auth-strategy tests are e2e apiv2 (#15837) 2024-07-19 14:51:50 +00:00
MorganandGitHub 03366d2337 feat: api v2 org team memberships endpoints (#15820)
* feat: api v2 org team memberships endpoints

* fixup! feat: api v2 org team memberships endpoints
2024-07-19 11:44:16 +00:00
MorganandGitHub 5b97d3bf52 fix: revert libraries version event-types controller apiv2 (#15831) 2024-07-19 08:50:15 +00:00
MorganandGitHub 7cdecf57e0 fix: PATCH /me formatted timezone incorrectly (#15830) 2024-07-19 08:49:59 +00:00
22fc47f69f feat: V2 Org Memberships (#15578)
* init

* --WIP

* WIP

* ...

* more wip

* doc

* address feedback --WIP

* further requested changes

* fix

* add missing parseIntPipe

* chore: code review comments + e2e tests

* fixup! chore: code review comments + e2e tests

* fixup! fixup! chore: code review comments + e2e tests

* fix: don't allow passing teamId for org membership create/update

* fix: improve docs and DTOs

---------

Co-authored-by: Morgan Vernay <morgan@cal.com>
2024-07-18 03:43:20 +00:00
MorganandGitHub af3d2e6879 chore: set managed user locale via api v2 (#15794) 2024-07-17 12:56:37 +00:00
MorganandGitHub 58e61cb18e fix: findOrgUser use profiles instead of organizationId apiv2 (#15808) 2024-07-17 12:51:42 +00:00
MorganandGitHub 5ef1b22c87 fix: remove permission blocking public apiv2 event-types endpoint (#15801) 2024-07-16 14:05:51 +00:00
41cde8e384 feat: API org user scope (#15739)
* Init organizations users GET endpoint

* Fix get users endpoint

* Add create user input

* Add POST to organization user endpoint

* Creating a user make email mandatory

* Move DTOs out of platform types

* Use plainToInstance for data filtering

* POST create user and org membership

* Add email check

* Filter update user call

* Add getOrg decorator to endpoints

* Add update endpoint

* Add delete endpoint

* Fix merge changes to create new org user

* Init tests

* Send org signup email

* Abstract username check

* Implement email service

* WIP E2E test

* Rename methods

* Update update org user DTO

* Remove unused inputs

* chore: add ApiProperty decorator to users class validators

* Type fix

* Update tests

* chore: code review comments

* chore: code review comments

* chore: code review comments

---------

Co-authored-by: Morgan Vernay <morgan@cal.com>
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
2024-07-16 10:50:46 +00:00
9fec77e345 fix: creating organization team should add owner (#15779)
* chore: platform libraries versions cleanup api v2

* fix: create membership to created org team apiv2

* chore: add test check owner membership

---------

Co-authored-by: Lauris Skraucis <lauris.skraucis@gmail.com>
2024-07-16 10:31:29 +00:00
Lauris SkraucisandGitHub 003af9a69d chore: specify platform-libraries version for event-types (#15785) 2024-07-16 09:47:37 +00:00
Lauris SkraucisandGitHub 77519a077c refactor: allow system admins to create event-type without membership (#15774) 2024-07-16 06:08:28 +00:00
MorganandGitHub 539a2ea301 chore: platform libraries versions cleanup api v2 (#15768)
* chore: platform libraries versions cleanup api v2

* fixup! chore: platform libraries versions cleanup api v2
2024-07-15 17:03:15 +00:00
MorganandGitHub 9ff10877e7 chore: fix apiv2 org teams doc (#15746) 2024-07-15 10:27:33 +00:00