-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[ACTION] Microsoft Booking - new components #19499
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
WalkthroughAdds a Microsoft Bookings integration: ten action modules (create/list/cancel) for businesses, staff, services, customers, and appointments; a reworked app module with centralized Graph request helpers and async propDefinitions; and package metadata/dependency updates. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Action as Action (run)
participant App as microsoft_bookings.app
participant Graph as Microsoft Graph API
Note right of Action: action gathers props and calls app helper
Action->>App: create/list/cancel/getCalendarView(...)
Note right of App: makeRequest builds request, uses _accessToken()
App->>Graph: HTTP request (GET/POST/PATCH/DELETE) + Authorization
Graph-->>App: HTTP response (value / created resource / error)
App-->>Action: returns response (and summary exported)
Note over App,Graph: propDefinitions use nextLink-based pagination when listing
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
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: 11
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (12)
components/microsoft_bookings/actions/cancel-appointment/cancel-appointment.mjs(1 hunks)components/microsoft_bookings/actions/create-appointment/create-appointment.mjs(1 hunks)components/microsoft_bookings/actions/create-business/create-business.mjs(1 hunks)components/microsoft_bookings/actions/create-customer/create-customer.mjs(1 hunks)components/microsoft_bookings/actions/create-service/create-service.mjs(1 hunks)components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs(1 hunks)components/microsoft_bookings/actions/list-appointments/list-appointments.mjs(1 hunks)components/microsoft_bookings/actions/list-businesses/list-businesses.mjs(1 hunks)components/microsoft_bookings/actions/list-services/list-services.mjs(1 hunks)components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs(1 hunks)components/microsoft_bookings/microsoft_bookings.app.mjs(1 hunks)components/microsoft_bookings/package.json(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
Applied to files:
components/microsoft_bookings/actions/create-customer/create-customer.mjscomponents/microsoft_bookings/actions/create-business/create-business.mjscomponents/microsoft_bookings/actions/create-staff-member/create-staff-member.mjscomponents/microsoft_bookings/actions/create-service/create-service.mjscomponents/microsoft_bookings/actions/create-appointment/create-appointment.mjs
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Applied to files:
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs
🧬 Code graph analysis (8)
components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (3)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)
response(29-31)components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
response(29-31)components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/list-services/list-services.mjs (3)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
response(20-20)components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
response(29-31)components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/create-business/create-business.mjs (4)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
content(96-100)response(125-128)components/microsoft_bookings/actions/create-service/create-service.mjs (2)
content(115-118)response(136-139)components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (2)
content(94-99)response(109-112)components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/create-service/create-service.mjs (4)
components/microsoft_bookings/actions/create-business/create-business.mjs (2)
content(105-107)response(116-118)components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
content(96-100)response(125-128)components/microsoft_bookings/actions/list-services/list-services.mjs (1)
response(29-31)components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
response(29-31)
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (8)
components/microsoft_bookings/actions/create-business/create-business.mjs (2)
content(105-107)response(116-118)components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
content(96-100)response(125-128)components/microsoft_bookings/actions/create-service/create-service.mjs (2)
content(115-118)response(136-139)components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (2)
content(94-99)response(109-112)components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1)
response(41-45)components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
response(20-20)components/microsoft_bookings/actions/list-services/list-services.mjs (1)
response(29-31)components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (3)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
response(20-20)components/microsoft_bookings/actions/list-services/list-services.mjs (1)
response(29-31)components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/microsoft_bookings.app.mjs (9)
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (2)
response(278-281)content(222-252)components/microsoft_bookings/actions/create-business/create-business.mjs (2)
response(116-118)content(105-107)components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
response(125-128)content(96-100)components/microsoft_bookings/actions/create-service/create-service.mjs (2)
response(136-139)content(115-118)components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (2)
response(109-112)content(94-99)components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1)
response(41-45)components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
response(20-20)components/microsoft_bookings/actions/list-services/list-services.mjs (1)
response(29-31)components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
response(29-31)
🪛 GitHub Actions: Pull Request Checks
components/microsoft_bookings/package.json
[error] 21-21: ESLint: 'eol-last' rule violated. Newline required at end of file but not found.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (14)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)
1-39: LGTM!The action follows the standard pattern for list operations and correctly normalizes the response, exports a summary, and returns the full response.
components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1)
41-52: LGTM!The action correctly calls the calendar view API and handles the response appropriately.
components/microsoft_bookings/package.json (1)
3-11: LGTM!The version bump to 0.1.0 is appropriate for the new Microsoft Bookings integration features, and the expanded keywords improve package discoverability.
components/microsoft_bookings/actions/cancel-appointment/cancel-appointment.mjs (1)
1-58: LGTM!The action correctly implements appointment cancellation with appropriate annotations (destructiveHint: true) and handles the void response by returning a success indicator.
components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (1)
1-118: LGTM!The action correctly handles optional boolean fields by explicitly checking for undefined (lines 102-107), which prevents false values from being incorrectly excluded. The role options are comprehensive and the @odata.type annotation is properly included.
components/microsoft_bookings/actions/create-customer/create-customer.mjs (1)
111-123: LGTM!The address building logic correctly handles optional fields and only creates the addresses array when at least one address field is provided.
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
1-28: LGTM!The action correctly implements the list businesses operation with appropriate minimal props and follows the established pattern for list operations.
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
1-39: LGTM!The action correctly implements the list staff members operation and follows the proper summary message format as per established patterns.
components/microsoft_bookings/actions/create-business/create-business.mjs (2)
3-13: LGTM!Metadata, annotations, and action structure follow Pipedream conventions correctly.
105-118: No action needed. Microsoft Graph API documentation for bookingBusiness POST omits@odata.typeat the root level, making its absence in this action correct. The other actions (create-service, create-customer, create-staff-member) include@odata.typebecause their respective entity types (bookingService, bookingCustomer, bookingStaffMember) have different API requirements—this is intentional variance, not an inconsistency to fix.Likely an incorrect or invalid review comment.
components/microsoft_bookings/actions/create-service/create-service.mjs (2)
3-13: LGTM!Action metadata and annotations are well-defined.
124-134: LGTM!Good use of
!== undefinedchecks for boolean fields to allowfalsevalues to be set explicitly.components/microsoft_bookings/microsoft_bookings.app.mjs (2)
1-2: LGTM!Proper imports for MS Graph client with isomorphic-fetch for Node.js compatibility.
179-264: LGTM!Well-structured CRUD methods with consistent patterns for all booking entities. The centralized request layer provides a clean abstraction over the MS Graph client.
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
Show resolved
Hide resolved
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
Show resolved
Hide resolved
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
Show resolved
Hide resolved
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
Show resolved
Hide resolved
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
Show resolved
Hide resolved
components/microsoft_bookings/actions/list-appointments/list-appointments.mjs
Show resolved
Hide resolved
6086b71 to
718e78d
Compare
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.
LGTM!
|
Hello everyone, I have tested this PR and there're some test cases failed or needed improvement. Please check test reports below for more information:
|
718e78d to
969ee61
Compare
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: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (12)
components/microsoft_bookings/actions/cancel-appointment/cancel-appointment.mjs(1 hunks)components/microsoft_bookings/actions/create-appointment/create-appointment.mjs(1 hunks)components/microsoft_bookings/actions/create-business/create-business.mjs(1 hunks)components/microsoft_bookings/actions/create-customer/create-customer.mjs(1 hunks)components/microsoft_bookings/actions/create-service/create-service.mjs(1 hunks)components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs(1 hunks)components/microsoft_bookings/actions/list-appointments/list-appointments.mjs(1 hunks)components/microsoft_bookings/actions/list-businesses/list-businesses.mjs(1 hunks)components/microsoft_bookings/actions/list-services/list-services.mjs(1 hunks)components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs(1 hunks)components/microsoft_bookings/microsoft_bookings.app.mjs(1 hunks)components/microsoft_bookings/package.json(1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
Applied to files:
components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjscomponents/microsoft_bookings/actions/create-business/create-business.mjscomponents/microsoft_bookings/actions/create-appointment/create-appointment.mjscomponents/microsoft_bookings/actions/create-service/create-service.mjscomponents/microsoft_bookings/actions/create-customer/create-customer.mjs
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Applied to files:
components/microsoft_bookings/actions/list-businesses/list-businesses.mjscomponents/microsoft_bookings/actions/list-staff-members/list-staff-members.mjscomponents/microsoft_bookings/actions/create-appointment/create-appointment.mjs
📚 Learning: 2025-09-11T01:53:51.070Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18334
File: components/buddee/actions/list-employees/list-employees.mjs:147-155
Timestamp: 2025-09-11T01:53:51.070Z
Learning: In Buddee list-employees action, the "manager" prop should be a boolean type to filter employees who have direct reports, not an employeeId propDefinition which would send an employee ID instead of the expected boolean value.
Applied to files:
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
📚 Learning: 2024-10-08T16:42:59.225Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14229
File: components/americommerce/actions/update-customer/update-customer.mjs:89-94
Timestamp: 2024-10-08T16:42:59.225Z
Learning: When defining boolean properties in AmeriCommerce components (e.g., in `update-customer.mjs`), ensure that the label and description are consistent and clearly indicate the intent, especially when using negations like "No Account", to avoid confusion.
Applied to files:
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
📚 Learning: 2025-01-29T22:59:38.825Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 15436
File: components/printful/printful.app.mjs:55-63
Timestamp: 2025-01-29T22:59:38.825Z
Learning: Console.log statements should be removed before merging PRs to maintain code quality and prevent potential security risks from exposing sensitive information in logs.
Applied to files:
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
🧬 Code graph analysis (8)
components/microsoft_bookings/actions/list-services/list-services.mjs (3)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
response(20-20)components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
response(29-31)components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (8)
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (1)
response(272-275)components/microsoft_bookings/actions/create-customer/create-customer.mjs (1)
response(125-128)components/microsoft_bookings/actions/create-service/create-service.mjs (1)
response(136-139)components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (1)
response(109-112)components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1)
response(41-45)components/microsoft_bookings/actions/list-services/list-services.mjs (1)
response(29-31)components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
response(29-31)components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/create-business/create-business.mjs (4)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
content(96-100)response(125-128)components/microsoft_bookings/actions/create-service/create-service.mjs (2)
content(115-118)response(136-139)components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (2)
content(94-99)response(109-112)components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (3)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)
response(29-31)components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
response(29-31)components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (7)
components/microsoft_bookings/actions/create-business/create-business.mjs (2)
content(105-107)response(116-118)components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
content(96-100)response(125-128)components/microsoft_bookings/actions/create-service/create-service.mjs (2)
content(115-118)response(136-139)components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
response(20-20)components/microsoft_bookings/actions/list-services/list-services.mjs (1)
response(29-31)components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
response(29-31)components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/create-service/create-service.mjs (5)
components/microsoft_bookings/actions/create-business/create-business.mjs (2)
content(105-107)response(116-118)components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
content(96-100)response(125-128)components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (2)
content(94-99)response(109-112)components/microsoft_bookings/actions/list-services/list-services.mjs (1)
response(29-31)components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (3)
components/microsoft_bookings/actions/create-business/create-business.mjs (3)
content(105-107)address(98-98)response(116-118)components/microsoft_bookings/actions/create-service/create-service.mjs (2)
content(115-118)response(136-139)components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (2)
content(94-99)response(109-112)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (19)
components/microsoft_bookings/actions/create-business/create-business.mjs (2)
1-81: LGTM!The action metadata and props are well-defined with appropriate types, labels, and descriptions.
82-104: LGTM!The address building logic correctly handles optional fields and prevents adding an empty address object.
components/microsoft_bookings/actions/create-service/create-service.mjs (4)
1-98: LGTM!The action metadata and props are correctly defined with appropriate types and propDefinitions.
99-121: LGTM!The content payload initialization and conditional field additions are correctly implemented.
123-134: LGTM!The conditional field additions correctly handle boolean props with undefined checks and array props with length validation.
136-144: LGTM!The API call and success summary follow the established pattern for create actions.
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (7)
1-30: LGTM!The action metadata and initial props (businessId, serviceId) are correctly defined.
42-86: LGTM!The customer-related props and appointment time props are well-defined with appropriate types and descriptions.
87-182: LGTM!The remaining props are appropriately defined with correct types and helpful descriptions.
183-210: LGTM!The prop destructuring is comprehensive and organized.
216-255: LGTM!The content payload structure correctly follows the Microsoft Graph bookingAppointment schema with proper @odata.type annotations and nested dateTimeTimeZone objects.
257-269: LGTM!The conditional field additions appropriately handle optional props with undefined checks for booleans.
271-276: LGTM!The API call follows the established pattern for create actions.
components/microsoft_bookings/microsoft_bookings.app.mjs (6)
1-31: LGTM!The imports and businessId propDefinition correctly implement pagination with nextLink handling.
32-63: LGTM!The staffMemberId propDefinition correctly implements pagination and provides a flexible mapper interface for custom field mappings.
64-119: LGTM!The serviceId and customerId propDefinitions consistently follow the established pagination pattern.
120-134: LGTM!The appointmentId propDefinition correctly implements pagination for listing appointments.
150-159: LGTM!The access token retrieval and Graph client initialization are correctly implemented.
179-262: LGTM!The API methods provide a clean, consistent interface for all Microsoft Bookings operations with correct endpoint paths.
components/microsoft_bookings/actions/cancel-appointment/cancel-appointment.mjs
Show resolved
Hide resolved
components/microsoft_bookings/actions/create-business/create-business.mjs
Show resolved
Hide resolved
|
Hi everyone, all test cases are passed! Ready for release! Test reports
|
969ee61 to
06b77ef
Compare
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: 2
♻️ Duplicate comments (13)
components/microsoft_bookings/package.json (1)
21-21: Verify the newline at end of file.This file had a previous review comment flagging a missing newline at EOF which violates the
eol-lastESLint rule. Ensure the file ends with a newline character to pass pipeline checks.components/microsoft_bookings/actions/create-customer/create-customer.mjs (1)
102-109: Simplify redundant phoneType fallback.The inline fallback
phoneType || "home"is redundant becausephoneTypealready hasdefault: "home"at line 48.Apply this diff to remove the redundant fallback:
if (phoneNumber) { content.phones = [ { number: phoneNumber, - type: phoneType || "home", + type: phoneType, }, ]; }components/microsoft_bookings/actions/cancel-appointment/cancel-appointment.mjs (1)
45-61: Fix misleading error handling that obscures API failures.The try-catch block has critical issues:
- The error message claims
cancellationMessageis missing, but it's a required prop (lines 31-35, nooptional: true), so the platform enforces it beforerun()executes.- All actual errors (authentication failures, invalid appointment IDs, network issues, API validation failures) are swallowed and replaced with the misleading message.
- Users cannot diagnose the real problem.
Apply this diff to preserve the original error:
- try { - await app.cancelAppointment({ - businessId, - appointmentId, - content: { - cancellationMessage, - }, - }); + await app.cancelAppointment({ + businessId, + appointmentId, + content: { + cancellationMessage, + }, + }); - $.export("$summary", "Successfully cancelled appointment"); + $.export("$summary", "Successfully cancelled appointment"); - return { - success: true, - }; - } catch (error) { - throw new Error("Failed to cancel appointment, you must provide a cancellation message"); - } + return { + success: true, + };components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1)
22-31: Consider validating date format.The
startDateandendDateprops accept any string without format validation. Invalid ISO 8601 dates will cause API errors rather than early validation feedback.Apply this diff to add basic pattern validation:
startDate: { type: "string", label: "Start Date", description: "The start date and time for the calendar view in ISO 8601 format (e.g., `2024-05-01T00:00:00Z`)", + pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$", }, endDate: { type: "string", label: "End Date", description: "The end date and time for the calendar view in ISO 8601 format (e.g., `2024-05-31T23:59:59Z`)", + pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$", },components/microsoft_bookings/actions/create-business/create-business.mjs (1)
105-107: Add missing@odata.typefield to content payload.Other create actions in this PR (create-service, create-customer, create-staff-member) include
@odata.typein the content object. Add it here for consistency with Microsoft Graph API conventions.const content = { + "@odata.type": "#microsoft.graph.bookingBusiness", displayName, };components/microsoft_bookings/actions/create-service/create-service.mjs (1)
122-122: Handle invaliddefaultPriceinput to avoidNaN.
parseFloat(defaultPrice)returnsNaNfor non-numeric strings, which could cause unexpected API behavior.- if (defaultPrice) content.defaultPrice = parseFloat(defaultPrice); + if (defaultPrice) { + const parsedPrice = parseFloat(defaultPrice); + if (!isNaN(parsedPrice)) { + content.defaultPrice = parsedPrice; + } + }components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (5)
31-41: WrongpropDefinitionused forcustomerId.This prop uses
staffMemberIdpropDefinition but the field is for selecting customers. The app module has acustomerIdpropDefinition that should be used here.customerId: { propDefinition: [ app, - "staffMemberId", + "customerId", ({ businessId }) => ({ businessId, }), ], label: "Customer ID", description: "Select an existing customer. **Important**: Customers must exist in the system before booking appointments.", },
212-214: Redundant validation for implicitly required prop.Since
customerIddoesn't haveoptional: true, Pipedream's framework already enforces it as required. This manual check is unnecessary.- if (!customerId) { - throw new Error("Customer ID is required. Please select an existing customer."); - }
256-256: Handle invalidpriceinput to avoidNaN.Same as create-service.mjs -
parseFloatreturnsNaNfor invalid input.- if (price) content.price = parseFloat(price); + if (price) { + const parsedPrice = parseFloat(price); + if (!isNaN(parsedPrice)) { + content.price = parsedPrice; + } + }
277-277: Summary may displayundefinedwhencustomerNameis not provided.
customerNameis optional, so the summary could show "Successfully created appointment for undefined".- $.export("$summary", `Successfully created appointment for ${customerName}`); + $.export("$summary", `Successfully created appointment${customerName ? ` for ${customerName}` : ""}`);
280-283: Avoid logging sensitive customer data.The error handler logs the full request payload which may contain PII (customer email, phone, name). This could violate privacy requirements.
} catch (error) { - console.error("Error creating appointment:", error); - console.error("Request payload:", JSON.stringify(content, null, 2)); + console.error("Error creating appointment:", error.message || error); throw new Error(`Failed to create appointment: ${error.message || error.toString()}`); }components/microsoft_bookings/microsoft_bookings.app.mjs (2)
135-138: Usecustomersarray for customer name instead of legacycustomerNamefield.The current Microsoft Graph API uses a
customersarray ofbookingCustomerInformationobjects. Access customer name viaappointment.customers?.[0]?.namewith fallback to the legacy field.const options = response.value?.map((appointment) => ({ - label: `${appointment.customerName} - ${appointment.serviceName}`, + label: `${appointment.customers?.[0]?.name || appointment.customerName || "Unknown"} - ${appointment.serviceName}`, value: appointment.id, })) || [];
160-178: Simplify method dispatch by removing redundant conditionals.The explicit
if/elsechecks are redundant since line 177 handles all methods via dynamic dispatch. Simplify to a single dispatch pattern.async makeRequest({ method = "get", path, content, }) { const api = this.client().api(path); - - if (method === "get") { - return api.get(); - } else if (method === "post") { - return api.post(content); - } else if (method === "patch") { - return api.patch(content); - } else if (method === "delete") { - return api.delete(); - } - - return api[method](content); + return content ? api[method](content) : api[method](); },
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (12)
components/microsoft_bookings/actions/cancel-appointment/cancel-appointment.mjs(1 hunks)components/microsoft_bookings/actions/create-appointment/create-appointment.mjs(1 hunks)components/microsoft_bookings/actions/create-business/create-business.mjs(1 hunks)components/microsoft_bookings/actions/create-customer/create-customer.mjs(1 hunks)components/microsoft_bookings/actions/create-service/create-service.mjs(1 hunks)components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs(1 hunks)components/microsoft_bookings/actions/list-appointments/list-appointments.mjs(1 hunks)components/microsoft_bookings/actions/list-businesses/list-businesses.mjs(1 hunks)components/microsoft_bookings/actions/list-services/list-services.mjs(1 hunks)components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs(1 hunks)components/microsoft_bookings/microsoft_bookings.app.mjs(1 hunks)components/microsoft_bookings/package.json(1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In `components/gainsight_px/actions/create-account/create-account.mjs`, the action name should be "Create Account" instead of "Create Memory".
Applied to files:
components/microsoft_bookings/actions/create-customer/create-customer.mjscomponents/microsoft_bookings/actions/create-appointment/create-appointment.mjscomponents/microsoft_bookings/actions/create-business/create-business.mjscomponents/microsoft_bookings/actions/create-staff-member/create-staff-member.mjscomponents/microsoft_bookings/actions/create-service/create-service.mjs
📚 Learning: 2025-09-11T01:53:51.070Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18334
File: components/buddee/actions/list-employees/list-employees.mjs:147-155
Timestamp: 2025-09-11T01:53:51.070Z
Learning: In Buddee list-employees action, the "manager" prop should be a boolean type to filter employees who have direct reports, not an employeeId propDefinition which would send an employee ID instead of the expected boolean value.
Applied to files:
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
📚 Learning: 2024-10-08T16:42:59.225Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14229
File: components/americommerce/actions/update-customer/update-customer.mjs:89-94
Timestamp: 2024-10-08T16:42:59.225Z
Learning: When defining boolean properties in AmeriCommerce components (e.g., in `update-customer.mjs`), ensure that the label and description are consistent and clearly indicate the intent, especially when using negations like "No Account", to avoid confusion.
Applied to files:
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the `run` method of an action, ensure the message is correctly formatted. For example, in the `hackerone-get-members` action, the correct format is `Successfully retrieved ${response.data.length} members`.
Applied to files:
components/microsoft_bookings/actions/create-appointment/create-appointment.mjscomponents/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs
📚 Learning: 2025-01-29T22:59:38.825Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 15436
File: components/printful/printful.app.mjs:55-63
Timestamp: 2025-01-29T22:59:38.825Z
Learning: Console.log statements should be removed before merging PRs to maintain code quality and prevent potential security risks from exposing sensitive information in logs.
Applied to files:
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs
🧬 Code graph analysis (7)
components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/create-customer/create-customer.mjs (3)
components/microsoft_bookings/actions/create-business/create-business.mjs (1)
content(105-107)components/microsoft_bookings/actions/create-service/create-service.mjs (1)
content(115-118)components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (1)
content(94-99)
components/microsoft_bookings/actions/list-services/list-services.mjs (4)
components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1)
response(41-45)components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
response(20-20)components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
response(29-31)components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (6)
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (2)
content(216-246)response(272-275)components/microsoft_bookings/actions/create-business/create-business.mjs (2)
content(105-107)response(116-118)components/microsoft_bookings/actions/create-service/create-service.mjs (2)
content(115-118)response(136-139)components/microsoft_bookings/actions/list-services/list-services.mjs (1)
response(29-31)components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
response(29-31)components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (9)
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (1)
response(272-275)components/microsoft_bookings/actions/create-business/create-business.mjs (1)
response(116-118)components/microsoft_bookings/actions/create-customer/create-customer.mjs (1)
response(125-128)components/microsoft_bookings/actions/create-service/create-service.mjs (1)
response(136-139)components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (1)
response(109-112)components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
response(20-20)components/microsoft_bookings/actions/list-services/list-services.mjs (1)
response(29-31)components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
response(29-31)components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
components/microsoft_bookings/actions/create-service/create-service.mjs (4)
components/microsoft_bookings/actions/create-business/create-business.mjs (2)
content(105-107)response(116-118)components/microsoft_bookings/actions/create-customer/create-customer.mjs (2)
content(96-100)response(125-128)components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (2)
content(94-99)response(109-112)components/microsoft_bookings/microsoft_bookings.app.mjs (5)
response(13-17)response(46-52)response(71-77)response(99-105)response(127-133)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
🔇 Additional comments (11)
components/microsoft_bookings/actions/list-services/list-services.mjs (1)
23-38: LGTM!The implementation follows the established pattern for list actions: calls the app method, normalizes the response, exports a summary with the count, and returns the full response. The defensive
|| []fallback forresponse.valueis good practice.components/microsoft_bookings/actions/list-businesses/list-businesses.mjs (1)
17-27: LGTM!The implementation is correct and follows the standard pattern for list actions. The defensive
|| []fallback ensures the summary count works even if the API response structure is unexpected.components/microsoft_bookings/actions/create-staff-member/create-staff-member.mjs (1)
101-107: LGTM!The conditional logic correctly uses
!== undefinedchecks for boolean properties, ensuring that explicitfalsevalues are properly included in the payload while omitting genuinely undefined values.components/microsoft_bookings/actions/list-staff-members/list-staff-members.mjs (1)
23-38: LGTM!The implementation is correct and consistent with the other list actions. The summary format properly uses template literals with the count, and the defensive
|| []fallback ensures robust handling of unexpected API responses.components/microsoft_bookings/actions/list-appointments/list-appointments.mjs (1)
33-52: LGTM!The implementation correctly calls
app.getCalendarViewwith the date range parameters, normalizes the response, and exports an appropriate summary. The pattern is consistent with the other list actions.components/microsoft_bookings/actions/create-business/create-business.mjs (1)
3-13: LGTM on action metadata.The action key, name, description with documentation link, version, type, and annotations are well-defined and consistent with the component pattern.
components/microsoft_bookings/actions/create-service/create-service.mjs (2)
3-13: LGTM on action metadata.The action descriptor is well-structured with appropriate key, name, description linking to Microsoft documentation, and correct annotations.
115-118: Good:@odata.typeincluded in content payload.The content object correctly includes the OData type annotation for Microsoft Graph API compliance.
components/microsoft_bookings/actions/create-appointment/create-appointment.mjs (1)
3-13: LGTM on action metadata.Well-structured action descriptor with appropriate key, name, description with documentation link, and correct annotations.
components/microsoft_bookings/microsoft_bookings.app.mjs (2)
1-2: LGTM on imports.Proper imports for Microsoft Graph client with isomorphic-fetch polyfill for Node.js environments.
7-31: LGTM on businessId propDefinition.Well-implemented async options with pagination support via
nextLink.
components/microsoft_bookings/actions/create-customer/create-customer.mjs
Show resolved
Hide resolved
|
/approve |
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.
LGTM!
WHY
Resolves #18231
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.