refactor: Break videoClient into two separate files in app-store and features#23992
refactor: Break videoClient into two separate files in app-store and features#23992keithwillcode merged 4 commits intomainfrom
Conversation
WalkthroughThis PR migrates imports of conferencing utilities from "@calcom/app-store/videoClient" to "@calcom/features/conferencing/lib/videoClient" across API routes, TRPC handlers, feature modules, platform re-exports, and tests (including mocks). It adds packages/app-store/getVideoAdapters.ts exporting Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (4)
🧰 Additional context used📓 Path-based instructions (3)**/*.ts📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Files:
**/*.{ts,tsx,js,jsx}⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
9f945bf to
1bfac86
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/app-store/getVideoAdapters.ts (1)
11-45: Consider filtering out undefined adapters.The function correctly centralizes adapter construction with good error handling and fallback logic. However, since
VideoApiAdaptercan beundefinedaccording to the type definition, andmakeVideoApiAdapter(cred)could potentially returnundefined, consider filtering out undefined values before returning:export const getVideoAdapters = async (withCredentials: CredentialPayload[]): Promise<VideoApiAdapter[]> => { const videoAdapters: VideoApiAdapter[] = []; for (const cred of withCredentials) { const appName = cred.type.split("_").join(""); // Transform `zoom_video` to `zoomvideo`; log.silly("Getting video adapter for", safeStringify({ appName, cred: getPiiFreeCredential(cred) })); let videoAdapterImport = VideoApiAdapterMap[appName as keyof typeof VideoApiAdapterMap]; // fallback: transforms zoom_video to zoom if (!videoAdapterImport) { const appTypeVariant = cred.type.substring(0, cred.type.lastIndexOf("_")); log.silly(`Adapter not found for ${appName}, trying fallback ${appTypeVariant}`); videoAdapterImport = VideoApiAdapterMap[appTypeVariant as keyof typeof VideoApiAdapterMap]; } if (!videoAdapterImport) { log.error(`Couldn't get adapter for ${appName}`); continue; } const videoAdapterModule = await videoAdapterImport; const makeVideoApiAdapter = videoAdapterModule.default as VideoApiAdapterFactory; if (makeVideoApiAdapter) { const videoAdapter = makeVideoApiAdapter(cred); - videoAdapters.push(videoAdapter); + if (videoAdapter) { + videoAdapters.push(videoAdapter); + } } else { log.error(`App ${appName} doesn't have a default VideoApiAdapter export`); } } return videoAdapters; };This would make the return type cleaner and avoid potential issues with undefined values in the array. The current implementation works because callers use optional chaining, but filtering here would be more defensive.
packages/app-store/wipemycalother/lib/reschedule.ts (1)
184-184: Consider using named export for better tree-shaking and refactoring.The default export could be replaced with a named export for consistency with the coding guidelines, which recommend named exports for better tree-shaking and easier refactoring.
Apply this diff to use a named export:
-export default Reschedule; +export { Reschedule };Alternatively, export it as a named export alongside the default if backward compatibility is required:
-export default Reschedule; +export { Reschedule }; +export default Reschedule;As per coding guidelines.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (24)
apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts(1 hunks)apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts(1 hunks)apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts(1 hunks)apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts(2 hunks)apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts(2 hunks)apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts(2 hunks)apps/web/app/api/recorded-daily-video/route.ts(1 hunks)apps/web/app/api/video/recording/__tests__/route.test.ts(1 hunks)apps/web/app/api/video/recording/route.ts(1 hunks)packages/app-store/getVideoAdapters.ts(1 hunks)packages/app-store/vital/lib/reschedule.ts(1 hunks)packages/app-store/wipemycalother/lib/reschedule.ts(1 hunks)packages/features/bookings/lib/EventManager.ts(1 hunks)packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts(1 hunks)packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts(1 hunks)packages/features/conferencing/README.md(1 hunks)packages/features/conferencing/lib/videoClient.ts(2 hunks)packages/features/instant-meeting/handleInstantMeeting.test.ts(1 hunks)packages/features/instant-meeting/handleInstantMeeting.ts(1 hunks)packages/platform/libraries/conferencing.ts(1 hunks)packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts(1 hunks)packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts(1 hunks)packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts(1 hunks)tests/libs/__mocks__/videoClient.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
**/*.ts: For Prisma queries, only select data you need; never useinclude, always useselect
Ensure thecredential.keyfield is never returned from tRPC endpoints or APIs
Files:
packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.tsapps/api/v1/pages/api/bookings/[id]/transcripts/_get.tsapps/web/app/api/video/recording/route.tsapps/api/v1/test/lib/bookings/[id]/recordings/_get.test.tspackages/features/instant-meeting/handleInstantMeeting.tspackages/app-store/vital/lib/reschedule.tsapps/web/app/api/recorded-daily-video/route.tspackages/features/instant-meeting/handleInstantMeeting.test.tspackages/features/bookings/lib/EventManager.tsapps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.tspackages/app-store/getVideoAdapters.tspackages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.tsapps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.tstests/libs/__mocks__/videoClient.tsapps/api/v1/pages/api/bookings/[id]/recordings/_get.tsapps/web/app/api/video/recording/__tests__/route.test.tspackages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.tspackages/app-store/wipemycalother/lib/reschedule.tspackages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.tsapps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.tspackages/features/conferencing/lib/videoClient.tspackages/platform/libraries/conferencing.tspackages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js
.utc()in hot paths like loops
Files:
packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.tsapps/api/v1/pages/api/bookings/[id]/transcripts/_get.tsapps/web/app/api/video/recording/route.tsapps/api/v1/test/lib/bookings/[id]/recordings/_get.test.tspackages/features/instant-meeting/handleInstantMeeting.tspackages/app-store/vital/lib/reschedule.tsapps/web/app/api/recorded-daily-video/route.tspackages/features/instant-meeting/handleInstantMeeting.test.tspackages/features/bookings/lib/EventManager.tsapps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.tspackages/app-store/getVideoAdapters.tspackages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.tsapps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.tstests/libs/__mocks__/videoClient.tsapps/api/v1/pages/api/bookings/[id]/recordings/_get.tsapps/web/app/api/video/recording/__tests__/route.test.tspackages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.tspackages/app-store/wipemycalother/lib/reschedule.tspackages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.tsapps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.tspackages/features/conferencing/lib/videoClient.tspackages/platform/libraries/conferencing.tspackages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts
**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.
Files:
packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.tsapps/api/v1/pages/api/bookings/[id]/transcripts/_get.tsapps/web/app/api/video/recording/route.tsapps/api/v1/test/lib/bookings/[id]/recordings/_get.test.tspackages/features/instant-meeting/handleInstantMeeting.tspackages/app-store/vital/lib/reschedule.tsapps/web/app/api/recorded-daily-video/route.tspackages/features/instant-meeting/handleInstantMeeting.test.tspackages/features/bookings/lib/EventManager.tsapps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.tspackages/app-store/getVideoAdapters.tspackages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.tsapps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.tstests/libs/__mocks__/videoClient.tsapps/api/v1/pages/api/bookings/[id]/recordings/_get.tsapps/web/app/api/video/recording/__tests__/route.test.tspackages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.tspackages/app-store/wipemycalother/lib/reschedule.tspackages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.tsapps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.tspackages/features/conferencing/lib/videoClient.tspackages/platform/libraries/conferencing.tspackages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts
🧬 Code graph analysis (1)
packages/app-store/getVideoAdapters.ts (3)
packages/types/VideoApiAdapter.d.ts (2)
VideoApiAdapter(19-49)VideoApiAdapterFactory(51-51)packages/lib/piiFreeData.ts (1)
getPiiFreeCredential(60-71)packages/app-store/video.adapters.generated.ts (1)
VideoApiAdapterMap(5-20)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Detect changes
🔇 Additional comments (27)
packages/features/instant-meeting/handleInstantMeeting.ts (1)
25-25: LGTM! Import path updated correctly.The import path for
createInstantMeetingWithCalVideohas been successfully migrated to the new location. The function usage remains unchanged throughout the file.apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts (1)
3-3: LGTM! Import path updated correctly.The import path for
getAllTranscriptsAccessLinkFromRoomNamehas been successfully migrated to the new location. The function usage remains unchanged.packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts (1)
13-13: LGTM! Import path updated correctly.The import path for
updateMeetinghas been successfully migrated to the new location. The function usage at line 103 remains unchanged.packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts (1)
5-5: LGTM! Import path updated correctly.The import path for
deleteMeetinghas been successfully migrated to the new location. The function usage at line 43 remains unchanged.packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts (1)
25-25: LGTM! Import path updated correctly.The import path for
deleteMeetinghas been successfully migrated to the new location. The function usage at line 259 remains unchanged.apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts (1)
3-6: LGTM! Import path updated correctly.The import path for
getRecordingsOfCalVideoByRoomNameandgetDownloadLinkOfCalVideoByRecordingIdhas been successfully migrated to the new location. The function usage remains unchanged.apps/web/app/api/video/recording/route.ts (1)
3-3: LGTM! Import path updated correctly.The import path for
getDownloadLinkOfCalVideoByRecordingIdhas been successfully migrated to the new location. The function usage remains unchanged.packages/app-store/vital/lib/reschedule.ts (1)
9-9: LGTM! Import path updated correctly.The import path for
deleteMeetinghas been successfully migrated to the new location. The function usage at line 152 remains unchanged.apps/web/app/api/recorded-daily-video/route.ts (1)
17-20: LGTM! Import path correctly updated.The import path has been properly updated to the new module location. Function usage throughout the file remains unchanged, which is correct for this refactoring.
packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts (1)
3-3: LGTM! Import path correctly updated.The import path has been properly updated to reflect the new module structure. The function usage and error handling remain unchanged.
packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts (1)
1-1: LGTM! Import path correctly updated.The import path has been properly migrated to the new module location. Function usage remains unchanged.
apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts (1)
9-9: LGTM! Import and mock paths correctly updated.Both the import path and the corresponding mock have been properly updated to reference the new module location. The mock implementation remains unchanged, ensuring test behavior is preserved.
Also applies to: 19-23
apps/web/app/api/video/recording/__tests__/route.test.ts (1)
4-4: LGTM! Import and mock paths correctly updated.The import and mock paths have been properly updated to the new module location. The mock implementation and test logic remain unchanged, preserving test functionality.
Also applies to: 9-11
packages/features/instant-meeting/handleInstantMeeting.test.ts (1)
23-30: LGTM! Mock path correctly updated.The mock path has been properly updated to reference the new module location. The mock implementation remains unchanged, which correctly preserves the test behavior.
apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts (1)
9-12: LGTM! Import and mock paths correctly updated.Both the import paths and the corresponding mocks have been properly updated to reference the new module location. The mock implementations remain unchanged, ensuring test consistency.
Also applies to: 25-30
apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts (1)
8-11: LGTM! Import and mock paths correctly updated.The import paths and corresponding mocks have been properly updated to the new module location. Mock implementations remain unchanged, preserving test behavior.
Also applies to: 22-27
apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts (2)
3-6: LGTM! Import path updated correctly.The import path has been successfully updated to the new location as part of the refactor to separate video client functionality.
62-66: Verify Prisma query follows coding guidelines.The Prisma query uses
include: { references: true }instead ofselect, which violates the coding guideline that states "only select data you need; never useinclude, always useselect". While this code predates the current PR, please verify if this should be refactored to useselectwith only the needed fields from references.As per coding guidelines.
tests/libs/__mocks__/videoClient.ts (1)
4-6: LGTM! Test mock updated correctly.The mock has been properly updated to reference the new module path, maintaining the same mock behavior.
packages/platform/libraries/conferencing.ts (1)
1-5: LGTM! Re-export path updated correctly.The re-export statement has been properly updated to the new module path, maintaining the same public API surface.
packages/features/bookings/lib/EventManager.ts (1)
40-40: LGTM! Import path updated correctly.The import has been successfully updated to reference the new video client location, maintaining the same function signatures and behavior.
packages/features/conferencing/lib/videoClient.ts (3)
6-6: LGTM! Adapter factory externalized correctly.The refactor to use an external
getVideoAdaptersfunction successfully centralizes the adapter construction logic, improving code organization and maintainability.
19-19: LGTM! Logger prefix updated correctly.The logger prefix has been updated to reflect the new module path, maintaining consistency in log output.
23-26: Good use of optional chaining for adapter calls.The code correctly uses optional chaining (
?.) when calling adapter methods, which safely handles cases wheregetVideoAdaptersmight return adapters with undefined values.packages/app-store/getVideoAdapters.ts (2)
14-26: LGTM! Fallback logic handles type variations well.The transformation logic and fallback mechanism correctly handles credential type variations (e.g.,
zoom_video→zoomvideo→zoom), making the adapter lookup more resilient.
28-31: LGTM! Appropriate error handling with continue.Continuing on missing adapters allows the function to process remaining credentials, which is the correct behavior for this use case where you want to collect all available adapters.
packages/app-store/wipemycalother/lib/reschedule.ts (1)
9-9: Approve import path migration. All occurrences of@calcom/app-store/videoClienthave been replaced with@calcom/features/conferencing/lib/videoClientacross the codebase.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (24)
apps/api/v1/pages/api/bookings/[id]/recordings/_get.ts(1 hunks)apps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.ts(1 hunks)apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts(1 hunks)apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts(2 hunks)apps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.ts(2 hunks)apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts(2 hunks)apps/web/app/api/recorded-daily-video/route.ts(1 hunks)apps/web/app/api/video/recording/__tests__/route.test.ts(1 hunks)apps/web/app/api/video/recording/route.ts(1 hunks)packages/app-store/getVideoAdapters.ts(1 hunks)packages/app-store/vital/lib/reschedule.ts(1 hunks)packages/app-store/wipemycalother/lib/reschedule.ts(1 hunks)packages/features/bookings/lib/EventManager.ts(1 hunks)packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts(1 hunks)packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts(1 hunks)packages/features/conferencing/README.md(1 hunks)packages/features/conferencing/lib/videoClient.ts(2 hunks)packages/features/instant-meeting/handleInstantMeeting.test.ts(1 hunks)packages/features/instant-meeting/handleInstantMeeting.ts(1 hunks)packages/platform/libraries/conferencing.ts(1 hunks)packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts(1 hunks)packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts(1 hunks)packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts(1 hunks)tests/libs/__mocks__/videoClient.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.ts
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
**/*.ts: For Prisma queries, only select data you need; never useinclude, always useselect
Ensure thecredential.keyfield is never returned from tRPC endpoints or APIs
Files:
packages/app-store/getVideoAdapters.tspackages/trpc/server/routers/viewer/bookings/requestReschedule.handler.tsapps/web/app/api/video/recording/route.tsapps/api/v1/test/lib/bookings/[id]/recordings/_get.test.tspackages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.tspackages/features/instant-meeting/handleInstantMeeting.test.tsapps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.tstests/libs/__mocks__/videoClient.tspackages/app-store/vital/lib/reschedule.tspackages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.tspackages/app-store/wipemycalother/lib/reschedule.tsapps/web/app/api/video/recording/__tests__/route.test.tspackages/features/instant-meeting/handleInstantMeeting.tspackages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.tsapps/web/app/api/recorded-daily-video/route.tsapps/api/v1/pages/api/bookings/[id]/recordings/_get.tspackages/platform/libraries/conferencing.tsapps/api/v1/pages/api/bookings/[id]/transcripts/_get.tsapps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.tspackages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.tspackages/features/bookings/lib/EventManager.tsapps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.tspackages/features/conferencing/lib/videoClient.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js
.utc()in hot paths like loops
Files:
packages/app-store/getVideoAdapters.tspackages/trpc/server/routers/viewer/bookings/requestReschedule.handler.tsapps/web/app/api/video/recording/route.tsapps/api/v1/test/lib/bookings/[id]/recordings/_get.test.tspackages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.tspackages/features/instant-meeting/handleInstantMeeting.test.tsapps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.tstests/libs/__mocks__/videoClient.tspackages/app-store/vital/lib/reschedule.tspackages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.tspackages/app-store/wipemycalother/lib/reschedule.tsapps/web/app/api/video/recording/__tests__/route.test.tspackages/features/instant-meeting/handleInstantMeeting.tspackages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.tsapps/web/app/api/recorded-daily-video/route.tsapps/api/v1/pages/api/bookings/[id]/recordings/_get.tspackages/platform/libraries/conferencing.tsapps/api/v1/pages/api/bookings/[id]/transcripts/_get.tsapps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.tspackages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.tspackages/features/bookings/lib/EventManager.tsapps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.tspackages/features/conferencing/lib/videoClient.ts
**/*.{ts,tsx,js,jsx}
⚙️ CodeRabbit configuration file
Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.
Files:
packages/app-store/getVideoAdapters.tspackages/trpc/server/routers/viewer/bookings/requestReschedule.handler.tsapps/web/app/api/video/recording/route.tsapps/api/v1/test/lib/bookings/[id]/recordings/_get.test.tspackages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.tspackages/features/instant-meeting/handleInstantMeeting.test.tsapps/api/v1/pages/api/bookings/[id]/transcripts/[recordingId]/_get.tstests/libs/__mocks__/videoClient.tspackages/app-store/vital/lib/reschedule.tspackages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.tspackages/app-store/wipemycalother/lib/reschedule.tsapps/web/app/api/video/recording/__tests__/route.test.tspackages/features/instant-meeting/handleInstantMeeting.tspackages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.tsapps/web/app/api/recorded-daily-video/route.tsapps/api/v1/pages/api/bookings/[id]/recordings/_get.tspackages/platform/libraries/conferencing.tsapps/api/v1/pages/api/bookings/[id]/transcripts/_get.tsapps/api/v1/test/lib/bookings/[id]/transcripts/[recordingId]/_get.test.tspackages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.tspackages/features/bookings/lib/EventManager.tsapps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.tspackages/features/conferencing/lib/videoClient.ts
🧬 Code graph analysis (1)
packages/app-store/getVideoAdapters.ts (3)
packages/types/VideoApiAdapter.d.ts (2)
VideoApiAdapter(19-49)VideoApiAdapterFactory(51-51)packages/lib/piiFreeData.ts (1)
getPiiFreeCredential(60-71)packages/app-store/video.adapters.generated.ts (1)
VideoApiAdapterMap(5-20)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Detect changes
🔇 Additional comments (19)
packages/features/conferencing/README.md (1)
3-3: Migration checkbox update looks good.Marking this task complete matches the refactor work in this PR.
packages/app-store/vital/lib/reschedule.ts (1)
9-9: LGTM! Import path migration completed.The import path for
deleteMeetinghas been correctly updated to the new module location.packages/app-store/getVideoAdapters.ts (1)
11-45: LGTM! Adapter factory logic is well-structured.The function correctly handles:
- Credential iteration and adapter name derivation
- Fallback logic for variant types (e.g., "zoom_video" → "zoom")
- Graceful error handling when adapters are not found
- PII-free logging for debugging
- Proper async/await for dynamic imports
The edge case where
lastIndexOf("_")returns -1 (no underscore) is handled gracefully—substring(0, -1)returns an empty string, which won't match in the map, and the error is logged appropriately.packages/features/instant-meeting/handleInstantMeeting.ts (1)
25-25: LGTM! Import path migration completed.The import path for
createInstantMeetingWithCalVideohas been correctly updated to the new module location.packages/features/bookings/lib/EventManager.ts (1)
40-40: LGTM! Import path migration completed.The import path for video client functions has been correctly updated to the new module location.
apps/api/v1/test/lib/bookings/[id]/recordings/_get.test.ts (2)
9-12: LGTM! Test imports updated correctly.The import path for video client test functions has been correctly updated to the new module location.
25-30: LGTM! Mock configuration updated correctly.The mock path has been correctly updated to match the new module location, ensuring test isolation is maintained.
packages/features/bookings/lib/handleSeats/cancel/cancelAttendeeSeat.ts (1)
13-13: LGTM! Import path migration completed.The import path for
updateMeetinghas been correctly updated to the new module location.packages/app-store/wipemycalother/lib/reschedule.ts (1)
9-9: LGTM! Import path migration completed.The import path for
deleteMeetinghas been correctly updated to the new module location.apps/web/app/api/video/recording/route.ts (1)
3-3: LGTM! Import path migration completed.The import path for
getDownloadLinkOfCalVideoByRecordingIdhas been correctly updated to the new module location.packages/trpc/server/routers/viewer/calVideo/getDownloadLinkOfCalVideoRecordings.handler.ts (1)
3-3: LGTM: Import path updated correctly.The import path change aligns with the module reorganization. Function usage remains unchanged.
apps/api/v1/pages/api/bookings/[id]/transcripts/_get.ts (1)
3-3: LGTM: Import path updated correctly.packages/features/bookings/lib/handleSeats/lib/lastAttendeeDeleteBooking.ts (1)
5-5: LGTM: Import path updated correctly.packages/trpc/server/routers/viewer/bookings/requestReschedule.handler.ts (1)
25-25: LGTM: Import path updated correctly.apps/api/v1/test/lib/bookings/[id]/transcripts/_get.test.ts (1)
9-9: LGTM: Import and mock paths updated correctly.Both the import statement and the mock configuration have been updated to use the new module path, maintaining consistency.
Also applies to: 19-23
packages/trpc/server/routers/viewer/calVideo/getCalVideoRecordings.handler.ts (1)
1-1: LGTM: Import path updated correctly.packages/features/instant-meeting/handleInstantMeeting.test.ts (1)
23-30: LGTM: Mock path updated correctly.apps/web/app/api/recorded-daily-video/route.ts (1)
18-20: LGTM: Import path updated correctly.packages/platform/libraries/conferencing.ts (1)
1-5: LGTM—confirmed that @calcom/features/conferencing/lib/videoClient exports getRecordingsOfCalVideoByRoomName, getDownloadLinkOfCalVideoByRecordingId, and getAllTranscriptsAccessLinkFromRoomName.
E2E results are ready! |
What does this PR do?
@calcom/app-store/videoClient.tsinto two files: (1)@calcom/app-store/getVideoAdapters.tsand (2)@calcom/features/conferencing/lib/videoClient.tsMandatory Tasks (DO NOT REMOVE)
How should this be tested?