-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Cloudbeds - new components #19529
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
Cloudbeds - new components #19529
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
WalkthroughThe PR introduces webhook support to the Cloudbeds component with API helper methods, a reusable base webhook lifecycle management class, and four concrete webhook sources (guest creation, reservation creation, transaction creation, reservation status change) with corresponding test events. Changes
Sequence DiagramsequenceDiagram
participant User
participant Source as Webhook Source
participant App as cloudbeds.app
participant API as Cloudbeds API
participant DB as Database
participant HTTP as HTTP Response
User->>Source: activate()
activate Source
Source->>App: createWebhook({endpoint, object, action})
App->>API: POST /postWebhook with API key
API-->>App: {subscriptionID, ...}
App->>DB: setWebhookId(subscriptionID)
DB-->>Source: webhookId stored
deactivate Source
API->>Source: Incoming webhook event
activate Source
Source->>HTTP: 200 OK (immediate)
Source->>Source: isRelevant(body)?
alt relevant
Source->>Source: generateMeta(body)
Source->>User: emit event with body + metadata
else not relevant
Source->>Source: exit
end
deactivate Source
User->>Source: deactivate()
activate Source
Source->>DB: getWebhookId()
DB-->>Source: webhookId
Source->>App: deleteWebhook({webhookId})
App->>API: DELETE /deleteWebhook with API key
API-->>App: success
deactivate Source
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
⏰ 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)
🔇 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 |
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: 5
📜 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 (11)
components/cloudbeds/cloudbeds.app.mjs(1 hunks)components/cloudbeds/package.json(2 hunks)components/cloudbeds/sources/common/base-webhook.mjs(1 hunks)components/cloudbeds/sources/new-guest-created/new-guest-created.mjs(1 hunks)components/cloudbeds/sources/new-guest-created/test-event.mjs(1 hunks)components/cloudbeds/sources/new-reservation-created/new-reservation-created.mjs(1 hunks)components/cloudbeds/sources/new-reservation-created/test-event.mjs(1 hunks)components/cloudbeds/sources/new-transaction-created/new-transaction-created.mjs(1 hunks)components/cloudbeds/sources/new-transaction-created/test-event.mjs(1 hunks)components/cloudbeds/sources/reservation-status-changed/reservation-status-changed.mjs(1 hunks)components/cloudbeds/sources/reservation-status-changed/test-event.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-10-20T01:01:02.970Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 18744
File: components/slack_v2/actions/send-large-message/send-large-message.mjs:49-64
Timestamp: 2025-10-20T01:01:02.970Z
Learning: In components/slack_v2/actions/send-large-message/send-large-message.mjs, the metadata_event_payload prop is typed as string, so the code only needs to handle string-to-JSON parsing and does not need to handle object inputs.
Applied to files:
components/cloudbeds/sources/new-guest-created/test-event.mjs
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream PR: 14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.
Applied to files:
components/cloudbeds/package.json
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Applied to files:
components/cloudbeds/sources/new-transaction-created/new-transaction-created.mjscomponents/cloudbeds/cloudbeds.app.mjscomponents/cloudbeds/sources/new-guest-created/new-guest-created.mjscomponents/cloudbeds/sources/reservation-status-changed/reservation-status-changed.mjscomponents/cloudbeds/sources/common/base-webhook.mjscomponents/cloudbeds/sources/new-reservation-created/new-reservation-created.mjs
📚 Learning: 2025-09-15T22:01:11.472Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 18362
File: components/leonardo_ai/actions/generate-image/generate-image.mjs:103-105
Timestamp: 2025-09-15T22:01:11.472Z
Learning: In Pipedream components, pipedream/platform's axios implementation automatically excludes undefined values from HTTP requests, so there's no need to manually check for truthiness before including properties in request payloads.
Applied to files:
components/cloudbeds/cloudbeds.app.mjs
⏰ 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: pnpm publish
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (14)
components/cloudbeds/package.json (1)
3-3: LGTM! Version bump and dependency addition are appropriate.The version bump to 0.1.0 correctly reflects new feature additions, and the @pipedream/platform dependency is required for the axios imports used in cloudbeds.app.mjs.
Also applies to: 15-17
components/cloudbeds/sources/new-reservation-created/test-event.mjs (1)
1-10: LGTM! Test payload structure is consistent.The test event payload structure is appropriate and consistent with the pattern used in other Cloudbeds test events.
components/cloudbeds/sources/new-reservation-created/new-reservation-created.mjs (1)
14-26: LGTM! Source implementation follows expected patterns.The getObject/getAction pattern and generateMeta implementation are consistent with Pipedream webhook source conventions. The timestamp conversion using Math.floor is appropriate for the float timestamp format.
components/cloudbeds/sources/new-transaction-created/new-transaction-created.mjs (2)
14-26: LGTM! Source implementation follows expected patterns.The getObject/getAction pattern and generateMeta implementation are consistent with Pipedream webhook source conventions. The use of Date.parse for the ISO datetime string is appropriate.
1-1: Thebase-webhook.mjsfile exists atcomponents/cloudbeds/sources/common/base-webhook.mjsin the codebase. The import path is valid and the file is already present, so there is no issue to address.Likely an incorrect or invalid review comment.
components/cloudbeds/sources/reservation-status-changed/test-event.mjs (1)
1-13: > Likely an incorrect or invalid review comment.components/cloudbeds/sources/new-guest-created/test-event.mjs (1)
1-9: > Likely an incorrect or invalid review comment.components/cloudbeds/cloudbeds.app.mjs (2)
24-37: Webhook endpoint paths are correct per Cloudbeds API documentation.The paths
/postWebhookand/deleteWebhookmatch the official Cloudbeds API v1.3 specifications and require no changes.
8-10: The base URL uses the current API version. API version 1.3 is the current version in the Cloudbeds API documentation, so no update is needed.components/cloudbeds/sources/common/base-webhook.mjs (2)
45-56: LGTM! Abstract method pattern is correct.The unimplemented methods that throw
ConfigurationErrorfollow the established pattern for base classes that are meant to be extended, as confirmed by the retrieved learnings.Based on learnings, this is the expected pattern for extensible base classes in this codebase.
14-24: No action needed—Content-Type header is correct.The webhook creation endpoint correctly uses
application/x-www-form-urlencoded. The JavaScript object payload will be properly serialized as form data by the HTTP client.components/cloudbeds/sources/reservation-status-changed/reservation-status-changed.mjs (2)
32-36: No changes needed. The webhook values are correct:getObject()returns"reservation"andgetAction()returns"status_changed", matching the Cloudbeds API specification for reservation status change webhooks.
18-26: Verify if the status options list includes "inquiry" and confirm "in_progress" is valid.The Cloudbeds PMS documentation lists reservation statuses as "Confirmed, Confirmation Pending, Canceled, In-house, Checked out, or No Show," with "Inquiry" mentioned as a temporary status for 3DS-authorized reservations. The current code list (in_progress, confirmed, not_confirmed, canceled, checked_in, checked_out, no_show) appears to be missing the "inquiry" status. Additionally, "in_progress" does not appear in the official documentation and may not be a valid API status value. Cross-reference the current list against the Cloudbeds API reference documentation to ensure completeness.
components/cloudbeds/sources/new-guest-created/new-guest-created.mjs (1)
14-18: Verify the object and action values match the Cloudbeds webhook API.The Cloudbeds postWebhook API endpoint uses
objectandactionparameters, which aligns with the code structure. Documentation confirms "guest" is a valid webhook object (e.g., "guest/details_changed"), and the "created" action follows the documented pattern. Ensure these values are confirmed against the current Cloudbeds API Available Events documentation to verify support for guest/created events.
components/cloudbeds/sources/reservation-status-changed/reservation-status-changed.mjs
Show resolved
Hide resolved
components/cloudbeds/sources/reservation-status-changed/reservation-status-changed.mjs
Show resolved
Hide resolved
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!
For Integration QA: |
|
Hi everyone, all test cases are passed! Ready for release! Test reports
|
|
/approve |
Resolves #17837
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.