-
Notifications
You must be signed in to change notification settings - Fork 5.5k
17077 app calcom #17172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
17077 app calcom #17172
Conversation
Actions - Get Bookable Slots
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
|
""" WalkthroughA new "Get Bookable Slots" action and supporting method were added to the Cal.com integration, enabling retrieval of available booking slots within a datetime range. Several action and source files had their version numbers incremented, and the package version was updated. No other logic or structural changes were made. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GetBookableSlotsAction
participant CalComApp
User->>GetBookableSlotsAction: Provide eventTypeId, startTime, endTime, etc.
GetBookableSlotsAction->>CalComApp: getBookableSlots(args)
CalComApp->>CalComApp: _makeRequest({ path: "slots", ...args })
CalComApp-->>GetBookableSlotsAction: Return slots data
GetBookableSlotsAction-->>User: Return slots data and summary
Assessment against linked issues
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/cal_com/actions/get-bookable-slots/get-bookable-slots.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
components/cal_com/cal_com.app.mjs (1)
160-165: Consider adding a thin parameter wrapper / docblock for clarity
getBookableSlotssimply forwards anyargsobject to_makeRequest, which is flexible but leaves the call-site responsible for remembering to put everything under aparamskey ({ params: { eventTypeId, start, end, … } }). A tiny wrapper (or at least a JSDoc comment) that takes the canonical arguments and builds theparamsobject would:
- make the public signature self-describing (
getBookableSlots({ eventTypeId, start, end, timeZone, teamEvent, $ }))- provide a good place to validate required params (ISO-8601, non-empty, etc.)
- avoid accidental leaking of unsupported keys into the request config
Example diff (optional):
- async getBookableSlots(args = {}) { - return this._makeRequest({ - path: "slots", - ...args, - }); - }, + /** + * Retrieve available slots for an event type. + * @param {Object} opts + * @param {string} opts.eventTypeId – required + * @param {string} opts.start – ISO-8601 + * @param {string} opts.end – ISO-8601 + * @param {string} [opts.timeZone] + * @param {boolean}[opts.teamEvent] + * @param {*} [opts.$] – Pipedream `$` for logging / retries + */ + async getBookableSlots({ + eventTypeId, + start, + end, + timeZone, + teamEvent, + $ = this, + } = {}) { + return this._makeRequest({ + path: "slots", + params: { + eventTypeId, + start, + end, + timeZone, + teamEvent, + }, + $, + }); + },components/cal_com/actions/get-bookable-slots/get-bookable-slots.mjs (2)
1-2: Avoid shadowing the importedappreference.
appis imported at the top-level and then re-declared inrun()via object destructuring, which can be confusing. Giving the import a distinct name (e.g.calCom) improves clarity and eliminates the shadowing.-import app from "../../cal_com.app.mjs"; +import calCom from "../../cal_com.app.mjs";Remember to update the
propsblock and later references (this.calCom.getBookableSlots) accordingly.
17-26: Provide stronger typing/validation for the datetime inputs.
startTimeandendTimeare plain strings, so invalid or non-ISO formats will silently pass through to the API. At minimum, add simple validation or leverage a date-picker/"datetime"UI type if supported.Example quick guard:
- startTime: { + startTime: { type: "string", label: "Start Time", description: "Start time of the slot lookup (ISO 8601 format)", + async validate(value) { + if (Number.isNaN(Date.parse(value))) { + throw new Error("startTime must be a valid ISO-8601 datetime"); + } + }, },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (10)
components/cal_com/actions/create-booking/create-booking.mjs(1 hunks)components/cal_com/actions/delete-booking/delete-booking.mjs(1 hunks)components/cal_com/actions/get-bookable-slots/get-bookable-slots.mjs(1 hunks)components/cal_com/actions/get-booking/get-booking.mjs(1 hunks)components/cal_com/cal_com.app.mjs(1 hunks)components/cal_com/package.json(1 hunks)components/cal_com/sources/booking-cancelled/booking-cancelled.mjs(1 hunks)components/cal_com/sources/booking-created/booking-created.mjs(1 hunks)components/cal_com/sources/booking-ended/booking-ended.mjs(1 hunks)components/cal_com/sources/booking-rescheduled/booking-rescheduled.mjs(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (10)
components/cal_com/actions/get-booking/get-booking.mjs (1)
7-7: Version bump looks good
No behavioural change – just metadata alignment with the package patch version.components/cal_com/package.json (1)
3-3: Package version updated to 0.0.6
Consistent with the individual action/source bumps. ✅components/cal_com/sources/booking-rescheduled/booking-rescheduled.mjs (1)
8-8: Source version bump acknowledged
Maintains internal consistency; no further comments.components/cal_com/actions/create-booking/create-booking.mjs (2)
2-2: Import re-ordering is harmless but watch linter rules
Many style guides expect third-party imports first, then local imports. The new order (ConfigurationError→ localcalCom) still satisfies that convention; just ensure it passes the repo’s lint step.
8-8: Version bump only
No functional changes introduced – LGTM.components/cal_com/sources/booking-ended/booking-ended.mjs (1)
8-8: Version bump looks good.No functional changes detected; incrementing the version keeps the source in sync with the rest of the package.
components/cal_com/sources/booking-cancelled/booking-cancelled.mjs (1)
8-8: Version bump looks good.Change is purely declarative and poses no risk.
components/cal_com/sources/booking-created/booking-created.mjs (1)
8-8: Version bump looks good.Consistent with related sources; nothing else to address.
components/cal_com/actions/delete-booking/delete-booking.mjs (1)
7-7: Version bump looks good.Action logic unchanged; update is purely metadata.
components/cal_com/actions/get-bookable-slots/get-bookable-slots.mjs (1)
7-7: Consider aligning the initial version with existing actions.Existing Cal.com actions are at
0.0.3. Starting this new action at0.0.3keeps a flat, easy-to-reason-about version surface for consumers.
If you want semantic independence, keeping0.0.1is fine—just double-check that your release process tolerates mixed versions.
GTFalcao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a prop description suggestion. Moving forward to QA
components/cal_com/actions/get-bookable-slots/get-bookable-slots.mjs
Outdated
Show resolved
Hide resolved
components/cal_com/actions/get-bookable-slots/get-bookable-slots.mjs
Outdated
Show resolved
Hide resolved
…ction to include example ISO 8601 format.
|
/approve |
Resolves #17077
Summary by CodeRabbit
New Features
Bug Fixes
Chores