From 69c252009db58c3f5461ea6254b68182271750c9 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Thu, 13 Nov 2025 15:35:36 -0500 Subject: [PATCH 1/7] Enhance booking_experts component with new actions and properties - Added new actions: `getBooking`, `deleteGuest`, `updateGuest`, `listAvailabilities`, and `listRentableTypeAvailabilities`. - Introduced new properties for administration and booking IDs, guest details, and rentable type availability. - Updated existing actions to improve functionality and consistency. - Incremented package version to 0.2.0 and updated action versions accordingly. --- .../add-guest-to-reservation.mjs | 4 +- .../actions/delete-guest/delete-guest.mjs | 54 ++++++ .../actions/get-booking/get-booking.mjs | 41 +++++ .../list-availabilities.mjs | 24 +++ .../actions/list-bookings/list-bookings.mjs | 8 +- .../list-rentabletype-availabilities.mjs | 70 ++++++++ .../actions/update-guest/update-guest.mjs | 117 +++++++++++++ .../booking_experts/booking_experts.app.mjs | 159 +++++++++++++++++- components/booking_experts/package.json | 2 +- 9 files changed, 468 insertions(+), 11 deletions(-) create mode 100644 components/booking_experts/actions/delete-guest/delete-guest.mjs create mode 100644 components/booking_experts/actions/get-booking/get-booking.mjs create mode 100644 components/booking_experts/actions/list-availabilities/list-availabilities.mjs create mode 100644 components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs create mode 100644 components/booking_experts/actions/update-guest/update-guest.mjs diff --git a/components/booking_experts/actions/add-guest-to-reservation/add-guest-to-reservation.mjs b/components/booking_experts/actions/add-guest-to-reservation/add-guest-to-reservation.mjs index a02d93442f7a6..84f415d0d56ba 100644 --- a/components/booking_experts/actions/add-guest-to-reservation/add-guest-to-reservation.mjs +++ b/components/booking_experts/actions/add-guest-to-reservation/add-guest-to-reservation.mjs @@ -3,8 +3,8 @@ import bookingExperts from "../../booking_experts.app.mjs"; export default { key: "booking_experts-add-guest-to-reservation", name: "Add Guest to Reservation", - description: "Add a guest to a reservation.. [See the documentation](https://developers.bookingexperts.com/reference/administration-reservation-guests-create)", - version: "0.0.2", + description: "Add a guest to a reservation. [See the documentation](https://developers.bookingexperts.com/reference/administration-reservation-guests-create)", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/booking_experts/actions/delete-guest/delete-guest.mjs b/components/booking_experts/actions/delete-guest/delete-guest.mjs new file mode 100644 index 0000000000000..5bcd133b968a0 --- /dev/null +++ b/components/booking_experts/actions/delete-guest/delete-guest.mjs @@ -0,0 +1,54 @@ +import bookingExperts from "../../booking_experts.app.mjs"; + +export default { + key: "booking_experts-delete-guest", + name: "Delete Guest", + description: "Delete a guest for a reservation. [See the documentation](https://developers.bookingexperts.com/reference/administration-reservation-guests-delete)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + bookingExperts, + administrationId: { + propDefinition: [ + bookingExperts, + "administrationId", + ], + }, + reservationId: { + propDefinition: [ + bookingExperts, + "reservationId", + ({ administrationId }) => ({ + administrationId, + }), + ], + }, + guestId: { + propDefinition: [ + bookingExperts, + "guestId", + ({ + administrationId, reservationId, + }) => ({ + administrationId, + reservationId, + }), + ], + }, + }, + async run({ $ }) { + const response = await this.bookingExperts.deleteGuest({ + administrationId: this.administrationId, + reservationId: this.reservationId, + guestId: this.guestId, + }); + + $.export("$summary", `Successfully deleted guest with ID ${this.guestId}`); + return response; + }, +}; diff --git a/components/booking_experts/actions/get-booking/get-booking.mjs b/components/booking_experts/actions/get-booking/get-booking.mjs new file mode 100644 index 0000000000000..7f28e3c702afc --- /dev/null +++ b/components/booking_experts/actions/get-booking/get-booking.mjs @@ -0,0 +1,41 @@ +import bookingExperts from "../../booking_experts.app.mjs"; + +export default { + key: "booking_experts-get-booking", + name: "Get Booking", + description: "Returns a booking. [See the documentation](https://developers.bookingexperts.com/reference/administration-bookings-index)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + bookingExperts, + administrationId: { + propDefinition: [ + bookingExperts, + "administrationId", + ], + }, + bookingId: { + propDefinition: [ + bookingExperts, + "bookingId", + ({ administrationId }) => ({ + administrationId, + }), + ], + }, + }, + async run({ $ }) { + const { data } = await this.bookingExperts.getBooking({ + $, + administrationId: this.administrationId, + bookingId: this.bookingId, + }); + $.export("$summary", `Successfully retrieved booking with ID ${this.bookingId}`); + return data; + }, +}; diff --git a/components/booking_experts/actions/list-availabilities/list-availabilities.mjs b/components/booking_experts/actions/list-availabilities/list-availabilities.mjs new file mode 100644 index 0000000000000..0f32cfc04bfc1 --- /dev/null +++ b/components/booking_experts/actions/list-availabilities/list-availabilities.mjs @@ -0,0 +1,24 @@ +import bookingExperts from "../../booking_experts.app.mjs"; + +export default { + key: "booking_experts-list-availabilities", + name: "List Availabilities", + description: "List availabilities of a channel you have access to. [See the documentation](https://developers.bookingexperts.com/reference/availabilities-index)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + bookingExperts, + }, + async run({ $ }) { + const { data } = await this.bookingExperts.listAvailabilities({ + $, + }); + $.export("$summary", `Found ${data.length} availabilities`); + return data; + }, +}; diff --git a/components/booking_experts/actions/list-bookings/list-bookings.mjs b/components/booking_experts/actions/list-bookings/list-bookings.mjs index 7b928cf2ebedc..568769f250235 100644 --- a/components/booking_experts/actions/list-bookings/list-bookings.mjs +++ b/components/booking_experts/actions/list-bookings/list-bookings.mjs @@ -4,7 +4,7 @@ export default { key: "booking_experts-list-bookings", name: "List Bookings", description: "Returns a list of bookings for an administration. [See the documentation](https://developers.bookingexperts.com/reference/administration-bookings-index)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, @@ -29,10 +29,10 @@ export default { ], description: "Filter by owner", }, - channelId: { + listAdministrationChannels: { propDefinition: [ bookingExperts, - "channelId", + "listAdministrationChannels", (c) => ({ administrationId: c.administrationId, }), @@ -69,7 +69,7 @@ export default { administrationId: this.administrationId, params: { "filter[owner]": this.ownerId, - "filter[channel]": this.channelId, + "filter[channel]": this.listAdministrationChannels, "filter[reservations]": this.reservationId, "filter[created_at]": this.createdAt, "filter[updated_at]": this.updatedAt, diff --git a/components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs b/components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs new file mode 100644 index 0000000000000..14ec5b09f5365 --- /dev/null +++ b/components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs @@ -0,0 +1,70 @@ +import { ConfigurationError } from "@pipedream/platform"; +import bookingExperts from "../../booking_experts.app.mjs"; + +export default { + key: "booking_experts-list-rentabletype-availabilities", + name: "List RentableType Availabilities", + description: "List availabilities of a RentableType you have access to. [See the documentation](https://developers.bookingexperts.com/reference/channel-rentabletype-availabilities-index)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + bookingExperts, + administrationId: { + propDefinition: [ + bookingExperts, + "administrationId", + ], + }, + channelId: { + propDefinition: [ + bookingExperts, + "channelId", + ({ administrationId }) => ({ + administrationId, + }), + ], + optional: false, + }, + rentableTypeId: { + propDefinition: [ + bookingExperts, + "rentableTypeId", + ({ channelId }) => ({ + channelId, + }), + ], + }, + startDate: { + type: "string", + label: "Start Date", + description: "The start date of the availability. Yields availability for the given date range. Format: `YYYY-MM-DD`", + optional: true, + }, + endDate: { + type: "string", + label: "End Date", + description: "The end date of the availability. Will be capped to 2 years in the future. Max LOS is capped to 30. Format: `YYYY-MM-DD`", + optional: true, + }, + }, + async run({ $ }) { + if ((!this.startDate && this.endDate) || (this.startDate && !this.endDate)) { + throw new ConfigurationError("You should provide both the start and end date parameters."); + } + const { data } = await this.bookingExperts.listRentableTypeAvailabilities({ + $, + channelId: this.channelId, + rentableTypeId: this.rentableTypeId, + params: { + "date_range": `${this.startDate}..${this.endDate}`, + }, + }); + $.export("$summary", `Found ${data.length} rentable type availabilities`); + return data; + }, +}; diff --git a/components/booking_experts/actions/update-guest/update-guest.mjs b/components/booking_experts/actions/update-guest/update-guest.mjs new file mode 100644 index 0000000000000..7ab4e52ec75e8 --- /dev/null +++ b/components/booking_experts/actions/update-guest/update-guest.mjs @@ -0,0 +1,117 @@ +import bookingExperts from "../../booking_experts.app.mjs"; + +export default { + key: "booking_experts-update-guest", + name: "Update Guest", + description: "Update a guest for a reservation. [See the documentation](https://developers.bookingexperts.com/reference/administration-reservation-guests-update)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + bookingExperts, + administrationId: { + propDefinition: [ + bookingExperts, + "administrationId", + ], + }, + reservationId: { + propDefinition: [ + bookingExperts, + "reservationId", + ({ administrationId }) => ({ + administrationId, + }), + ], + }, + guestId: { + propDefinition: [ + bookingExperts, + "guestId", + ({ + administrationId, reservationId, + }) => ({ + administrationId, + reservationId, + }), + ], + }, + firstName: { + type: "string", + label: "First Name", + description: "The first name of the guest", + optional: true, + }, + lastName: { + type: "string", + label: "Last Name", + description: "The last name of the guest", + optional: true, + }, + email: { + type: "string", + label: "Email", + description: "The email of the guest", + optional: true, + }, + phone: { + type: "string", + label: "Phone", + description: "The phone number of the guest", + optional: true, + }, + address: { + type: "string", + label: "Address", + description: "The street address of the guest", + optional: true, + }, + city: { + type: "string", + label: "City", + description: "The city of the guest", + optional: true, + }, + postalCode: { + type: "string", + label: "Postal Code", + description: "The postal code of the guest", + optional: true, + }, + countryCode: { + type: "string", + label: "Country Code", + description: "The country code of the guest", + optional: true, + }, + }, + async run({ $ }) { + const { data } = await this.bookingExperts.updateGuest({ + administrationId: this.administrationId, + reservationId: this.reservationId, + guestId: this.guestId, + data: { + data: { + id: this.guestId, + type: "guest", + attributes: { + first_name: this.firstName, + last_name: this.lastName, + email: this.email, + phone: this.phone, + address: this.address, + city: this.city, + postal_code: this.postalCode, + country_code: this.countryCode, + }, + }, + }, + }); + $.export("$summary", "Guest updated"); + return data; + }, +}; diff --git a/components/booking_experts/booking_experts.app.mjs b/components/booking_experts/booking_experts.app.mjs index 8ac750fa35e20..54896eefcfb26 100644 --- a/components/booking_experts/booking_experts.app.mjs +++ b/components/booking_experts/booking_experts.app.mjs @@ -44,16 +44,79 @@ export default { })) || []; }, }, + administrationChannelId: { + type: "string", + label: "Administration Channel ID", + description: "The ID of a channel in the administration", + optional: true, + async options({ + page, administrationId, + }) { + const { data } = await this.listAdministrationChannels({ + administrationId, + params: { + "page[number]": page + 1, + }, + }); + return data?.map(({ + id, attributes, + }) => ({ + label: attributes.name, + value: id, + })) || []; + }, + }, + bookingId: { + type: "string", + label: "Booking ID", + description: "The ID of a booking", + async options({ + page, administrationId, + }) { + const { data } = await this.listBookings({ + administrationId, + params: { + "page[number]": page + 1, + }, + }); + return data?.map(({ + id, attributes, + }) => ({ + label: attributes.booking_nr, + value: id, + })) || []; + }, + }, channelId: { type: "string", label: "Channel ID", description: "The ID of a channel", - optional: true, async options({ - page, administrationId, + page, channelId, }) { const { data } = await this.listChannels({ - administrationId, + channelId, + params: { + "page[number]": page + 1, + }, + }); + return data?.map(({ + id, attributes, + }) => ({ + label: attributes.name, + value: id, + })) || []; + }, + }, + rentableTypeId: { + type: "string", + label: "Rentable Type ID", + description: "The ID of a rentable type", + async options({ + page, channelId, + }) { + const { data } = await this.listRentableTypes({ + channelId, params: { "page[number]": page + 1, }, @@ -87,6 +150,32 @@ export default { })) || []; }, }, + guestId: { + type: "string", + label: "Guest ID", + description: "The ID of a guest", + async options({ + page, administrationId, reservationId, + }) { + const { data } = await this.listGuests({ + administrationId, + reservationId, + params: { + "page[number]": page + 1, + }, + }); + return data?.map(({ + id, attributes: { + first_name, last_name, email, + }, + }) => ({ + label: `${first_name} ${last_name} ${email + ? `(${email})` + : ""}`, + value: id, + })) || []; + }, + }, masterPriceListId: { type: "string", label: "Master Price List ID", @@ -196,6 +285,14 @@ export default { ...opts, }); }, + getBooking({ + administrationId, bookingId, ...opts + }) { + return this._makeRequest({ + path: `/administrations/${administrationId}/bookings/${bookingId}`, + ...opts, + }); + }, listBookings({ administrationId, ...opts }) { @@ -212,7 +309,7 @@ export default { ...opts, }); }, - listChannels({ + listAdministrationChannels({ administrationId, ...opts }) { return this._makeRequest({ @@ -220,6 +317,42 @@ export default { ...opts, }); }, + listAvailabilities(opts = {}) { + return this._makeRequest({ + path: "/availabilities", + ...opts, + }); + }, + listChannels(opts = {}) { + return this._makeRequest({ + path: "/channels", + ...opts, + }); + }, + listGuests({ + administrationId, reservationId, ...opts + }) { + return this._makeRequest({ + path: `/administrations/${administrationId}/reservations/${reservationId}/guests`, + ...opts, + }); + }, + listRentableTypes({ + channelId, ...opts + }) { + return this._makeRequest({ + path: `/channels/${channelId}/rentable_types`, + ...opts, + }); + }, + listRentableTypeAvailabilities({ + channelId, rentableTypeId, ...opts + }) { + return this._makeRequest({ + path: `/channels/${channelId}/rentable_types/${rentableTypeId}/availabilities`, + ...opts, + }); + }, listReservations({ administrationId, ...opts }) { @@ -276,5 +409,23 @@ export default { ...opts, }); }, + updateGuest({ + administrationId, reservationId, guestId, ...opts + }) { + return this._makeRequest({ + path: `/administrations/${administrationId}/reservations/${reservationId}/guests/${guestId}`, + method: "PATCH", + ...opts, + }); + }, + deleteGuest({ + administrationId, reservationId, guestId, ...opts + }) { + return this._makeRequest({ + path: `/administrations/${administrationId}/reservations/${reservationId}/guests/${guestId}`, + method: "DELETE", + ...opts, + }); + }, }, }; diff --git a/components/booking_experts/package.json b/components/booking_experts/package.json index f636fb6f1ef6e..446bb0d1b60ae 100644 --- a/components/booking_experts/package.json +++ b/components/booking_experts/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/booking_experts", - "version": "0.1.0", + "version": "0.2.0", "description": "Pipedream Booking Experts Components", "main": "booking_experts.app.mjs", "keywords": [ From 5a4a1ceffb1624c7b118eef634b442d969e28428 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Thu, 13 Nov 2025 15:48:59 -0500 Subject: [PATCH 2/7] Update versions for booking_experts actions and sources to 0.0.3 and 0.0.2 respectively - Incremented version for actions: `create-agenda-period`, `get-complex-prices`, and `list-inventory-objects` to 0.0.3. - Updated version for sources: `booking-updated`, `inventory-object-updated`, `new-booking-created`, and `new-inventory-object-created` to 0.0.2. --- .../actions/create-agenda-period/create-agenda-period.mjs | 2 +- .../actions/get-complex-prices/get-complex-prices.mjs | 2 +- .../actions/list-inventory-objects/list-inventory-objects.mjs | 2 +- .../booking_experts/actions/search-contacts/search-contacts.mjs | 2 +- .../booking_experts/sources/booking-updated/booking-updated.mjs | 2 +- .../inventory-object-updated/inventory-object-updated.mjs | 2 +- .../sources/new-booking-created/new-booking-created.mjs | 2 +- .../new-inventory-object-created.mjs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/booking_experts/actions/create-agenda-period/create-agenda-period.mjs b/components/booking_experts/actions/create-agenda-period/create-agenda-period.mjs index 9a75220c44586..51008e23216a3 100644 --- a/components/booking_experts/actions/create-agenda-period/create-agenda-period.mjs +++ b/components/booking_experts/actions/create-agenda-period/create-agenda-period.mjs @@ -4,7 +4,7 @@ export default { key: "booking_experts-create-agenda-period", name: "Create Agenda Period", description: "Creates a new agenda period. [See the documentation](https://developers.bookingexperts.com/reference/administration-maintenance-agenda-periods-create)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/booking_experts/actions/get-complex-prices/get-complex-prices.mjs b/components/booking_experts/actions/get-complex-prices/get-complex-prices.mjs index 7ccd8883d8e38..135cfd368ab9a 100644 --- a/components/booking_experts/actions/get-complex-prices/get-complex-prices.mjs +++ b/components/booking_experts/actions/get-complex-prices/get-complex-prices.mjs @@ -4,7 +4,7 @@ export default { key: "booking_experts-get-complex-prices", name: "Get Complex Prices", description: "Returns all complex prices of a master price list. [See the documentation](https://developers.bookingexperts.com/reference/administration-masterpricelist-complexprices-index)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/booking_experts/actions/list-inventory-objects/list-inventory-objects.mjs b/components/booking_experts/actions/list-inventory-objects/list-inventory-objects.mjs index 88db8d769abda..2c8359e6c65b5 100644 --- a/components/booking_experts/actions/list-inventory-objects/list-inventory-objects.mjs +++ b/components/booking_experts/actions/list-inventory-objects/list-inventory-objects.mjs @@ -4,7 +4,7 @@ export default { key: "booking_experts-list-inventory-objects", name: "List Inventory Objects", description: "Returns inventory objects of the administration. [See the documentation](https://developers.bookingexperts.com/reference/administration-inventoryobjects-index)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/booking_experts/actions/search-contacts/search-contacts.mjs b/components/booking_experts/actions/search-contacts/search-contacts.mjs index 5fc871896a8a1..b55cc110304a1 100644 --- a/components/booking_experts/actions/search-contacts/search-contacts.mjs +++ b/components/booking_experts/actions/search-contacts/search-contacts.mjs @@ -5,7 +5,7 @@ export default { key: "booking_experts-search-contacts", name: "Search Contacts", description: "Search for contacts by email or phone. [See the documentation](https://developers.bookingexperts.com/reference/contact-search-first)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/booking_experts/sources/booking-updated/booking-updated.mjs b/components/booking_experts/sources/booking-updated/booking-updated.mjs index 0fe880729c969..73a0f3610bdb3 100644 --- a/components/booking_experts/sources/booking-updated/booking-updated.mjs +++ b/components/booking_experts/sources/booking-updated/booking-updated.mjs @@ -5,7 +5,7 @@ export default { key: "booking_experts-booking-updated", name: "Booking Updated", description: "Emit new event for each booking updated. [See the documentation](https://developers.bookingexperts.com/reference/administration-bookings-index)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", props: { diff --git a/components/booking_experts/sources/inventory-object-updated/inventory-object-updated.mjs b/components/booking_experts/sources/inventory-object-updated/inventory-object-updated.mjs index 27f12221f6a62..6485be1e1d0f6 100644 --- a/components/booking_experts/sources/inventory-object-updated/inventory-object-updated.mjs +++ b/components/booking_experts/sources/inventory-object-updated/inventory-object-updated.mjs @@ -5,7 +5,7 @@ export default { key: "booking_experts-inventory-object-updated", name: "Inventory Object Updated", description: "Emit new event when an inventory object is updated. [See the documentation](https://developers.bookingexperts.com/reference/administration-inventoryobjects-index)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", props: { diff --git a/components/booking_experts/sources/new-booking-created/new-booking-created.mjs b/components/booking_experts/sources/new-booking-created/new-booking-created.mjs index 41b124bfbf2a7..a0bd7d7378f50 100644 --- a/components/booking_experts/sources/new-booking-created/new-booking-created.mjs +++ b/components/booking_experts/sources/new-booking-created/new-booking-created.mjs @@ -5,7 +5,7 @@ export default { key: "booking_experts-new-booking-created", name: "New Booking Created", description: "Emit new event for each new booking created. [See the documentation](https://developers.bookingexperts.com/reference/administration-bookings-index)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", props: { diff --git a/components/booking_experts/sources/new-inventory-object-created/new-inventory-object-created.mjs b/components/booking_experts/sources/new-inventory-object-created/new-inventory-object-created.mjs index 32f2690021052..e829c6ed9a664 100644 --- a/components/booking_experts/sources/new-inventory-object-created/new-inventory-object-created.mjs +++ b/components/booking_experts/sources/new-inventory-object-created/new-inventory-object-created.mjs @@ -5,7 +5,7 @@ export default { key: "booking_experts-new-inventory-object-created", name: "New Inventory Object Created", description: "Emit new event when a new inventory object is created. [See the documentation](https://developers.bookingexperts.com/reference/administration-inventoryobjects-index)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", props: { From 83d39dac4632cd27ed739f511f00b7abdc8cd508 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Thu, 13 Nov 2025 23:25:13 -0300 Subject: [PATCH 3/7] Update components/booking_experts/actions/delete-guest/delete-guest.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../booking_experts/actions/delete-guest/delete-guest.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/booking_experts/actions/delete-guest/delete-guest.mjs b/components/booking_experts/actions/delete-guest/delete-guest.mjs index 5bcd133b968a0..3c089ad67bc6d 100644 --- a/components/booking_experts/actions/delete-guest/delete-guest.mjs +++ b/components/booking_experts/actions/delete-guest/delete-guest.mjs @@ -6,10 +6,11 @@ export default { description: "Delete a guest for a reservation. [See the documentation](https://developers.bookingexperts.com/reference/administration-reservation-guests-delete)", version: "0.0.1", annotations: { - destructiveHint: false, + destructiveHint: true, openWorldHint: true, readOnlyHint: false, }, + }, type: "action", props: { bookingExperts, From de345a2869ee6b24d2b03713340b0748438a4ea2 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Thu, 13 Nov 2025 21:31:19 -0500 Subject: [PATCH 4/7] Refactor booking_experts component for improved functionality - Simplified options method in booking_experts.app.mjs by removing unused channelId parameter. - Updated description in get-booking action to point to the correct documentation link. - Enhanced list-rentabletype-availabilities action to conditionally include date_range parameter based on start and end dates. - Removed unnecessary closing brace in delete-guest action for cleaner code. --- .../actions/delete-guest/delete-guest.mjs | 1 - .../booking_experts/actions/get-booking/get-booking.mjs | 2 +- .../list-rentabletype-availabilities.mjs | 5 ++++- components/booking_experts/booking_experts.app.mjs | 9 +++------ 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/components/booking_experts/actions/delete-guest/delete-guest.mjs b/components/booking_experts/actions/delete-guest/delete-guest.mjs index 3c089ad67bc6d..205fcd2111703 100644 --- a/components/booking_experts/actions/delete-guest/delete-guest.mjs +++ b/components/booking_experts/actions/delete-guest/delete-guest.mjs @@ -10,7 +10,6 @@ export default { openWorldHint: true, readOnlyHint: false, }, - }, type: "action", props: { bookingExperts, diff --git a/components/booking_experts/actions/get-booking/get-booking.mjs b/components/booking_experts/actions/get-booking/get-booking.mjs index 7f28e3c702afc..a393cdce7cbbf 100644 --- a/components/booking_experts/actions/get-booking/get-booking.mjs +++ b/components/booking_experts/actions/get-booking/get-booking.mjs @@ -3,7 +3,7 @@ import bookingExperts from "../../booking_experts.app.mjs"; export default { key: "booking_experts-get-booking", name: "Get Booking", - description: "Returns a booking. [See the documentation](https://developers.bookingexperts.com/reference/administration-bookings-index)", + description: "Returns a booking. [See the documentation](https://developers.bookingexperts.com/reference/administration-bookings-show)", version: "0.0.1", annotations: { destructiveHint: false, diff --git a/components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs b/components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs index 14ec5b09f5365..2d57520361d7f 100644 --- a/components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs +++ b/components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs @@ -61,7 +61,10 @@ export default { channelId: this.channelId, rentableTypeId: this.rentableTypeId, params: { - "date_range": `${this.startDate}..${this.endDate}`, + ...(this.startDate && this.endDate + && { + "date_range": `${this.startDate}..${this.endDate}`, + }), }, }); $.export("$summary", `Found ${data.length} rentable type availabilities`); diff --git a/components/booking_experts/booking_experts.app.mjs b/components/booking_experts/booking_experts.app.mjs index 54896eefcfb26..3eb7f2d11c799 100644 --- a/components/booking_experts/booking_experts.app.mjs +++ b/components/booking_experts/booking_experts.app.mjs @@ -91,11 +91,8 @@ export default { type: "string", label: "Channel ID", description: "The ID of a channel", - async options({ - page, channelId, - }) { + async options({ page }) { const { data } = await this.listChannels({ - channelId, params: { "page[number]": page + 1, }, @@ -169,8 +166,8 @@ export default { first_name, last_name, email, }, }) => ({ - label: `${first_name} ${last_name} ${email - ? `(${email})` + label: `${first_name} ${last_name}${email + ? ` (${email})` : ""}`, value: id, })) || []; From 07a2ae29391776b49935069d6e5047bc439b0d2a Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Fri, 14 Nov 2025 09:51:13 -0500 Subject: [PATCH 5/7] Refactor list-rentabletype-availabilities action to streamline props - Removed the administrationId prop definition and its associated logic from the list-rentabletype-availabilities action for improved clarity and simplicity. --- .../list-rentabletype-availabilities.mjs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs b/components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs index 2d57520361d7f..18aebdf29b363 100644 --- a/components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs +++ b/components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs @@ -14,19 +14,10 @@ export default { type: "action", props: { bookingExperts, - administrationId: { - propDefinition: [ - bookingExperts, - "administrationId", - ], - }, channelId: { propDefinition: [ bookingExperts, "channelId", - ({ administrationId }) => ({ - administrationId, - }), ], optional: false, }, From 75f14993623ea08fed3bce33e1a3a131af19fa42 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 17 Nov 2025 18:40:10 -0500 Subject: [PATCH 6/7] Enhance booking_experts actions with additional alerts and prop updates - Added warning alerts to listAvailabilities, deleteGuest, updateGuest, and listRentableTypeAvailabilities actions to inform users about API limitations. - Updated label formatting in booking_experts.app.mjs to include booking number for better identification. - Refactored administrationChannelId prop in list-bookings action for clarity. --- .../booking_experts/actions/delete-guest/delete-guest.mjs | 5 +++++ .../actions/list-availabilities/list-availabilities.mjs | 5 +++++ .../actions/list-bookings/list-bookings.mjs | 4 ++-- .../list-rentabletype-availabilities.mjs | 7 ++++++- .../booking_experts/actions/update-guest/update-guest.mjs | 5 +++++ components/booking_experts/booking_experts.app.mjs | 5 ++++- 6 files changed, 27 insertions(+), 4 deletions(-) diff --git a/components/booking_experts/actions/delete-guest/delete-guest.mjs b/components/booking_experts/actions/delete-guest/delete-guest.mjs index 205fcd2111703..98c3ee67ad23f 100644 --- a/components/booking_experts/actions/delete-guest/delete-guest.mjs +++ b/components/booking_experts/actions/delete-guest/delete-guest.mjs @@ -28,6 +28,11 @@ export default { }), ], }, + info: { + type: "alert", + alertType: "warning", + content: "**The API will only list guests created through the Booking Experts API.**", + }, guestId: { propDefinition: [ bookingExperts, diff --git a/components/booking_experts/actions/list-availabilities/list-availabilities.mjs b/components/booking_experts/actions/list-availabilities/list-availabilities.mjs index 0f32cfc04bfc1..fdae6239e9b81 100644 --- a/components/booking_experts/actions/list-availabilities/list-availabilities.mjs +++ b/components/booking_experts/actions/list-availabilities/list-availabilities.mjs @@ -13,6 +13,11 @@ export default { type: "action", props: { bookingExperts, + info: { + type: "alert", + alertType: "warning", + content: "**You must have at least one channel created through the Booking Experts API.**", + }, }, async run({ $ }) { const { data } = await this.bookingExperts.listAvailabilities({ diff --git a/components/booking_experts/actions/list-bookings/list-bookings.mjs b/components/booking_experts/actions/list-bookings/list-bookings.mjs index 568769f250235..f812f01d24982 100644 --- a/components/booking_experts/actions/list-bookings/list-bookings.mjs +++ b/components/booking_experts/actions/list-bookings/list-bookings.mjs @@ -29,10 +29,10 @@ export default { ], description: "Filter by owner", }, - listAdministrationChannels: { + administrationChannelId: { propDefinition: [ bookingExperts, - "listAdministrationChannels", + "administrationChannelId", (c) => ({ administrationId: c.administrationId, }), diff --git a/components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs b/components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs index 18aebdf29b363..3888249cf33fd 100644 --- a/components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs +++ b/components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs @@ -9,11 +9,16 @@ export default { annotations: { destructiveHint: false, openWorldHint: true, - readOnlyHint: false, + readOnlyHint: true, }, type: "action", props: { bookingExperts, + info: { + type: "alert", + alertType: "warning", + content: "**The API will only list channels created through the Booking Experts API.**", + }, channelId: { propDefinition: [ bookingExperts, diff --git a/components/booking_experts/actions/update-guest/update-guest.mjs b/components/booking_experts/actions/update-guest/update-guest.mjs index 7ab4e52ec75e8..47aa7175fee36 100644 --- a/components/booking_experts/actions/update-guest/update-guest.mjs +++ b/components/booking_experts/actions/update-guest/update-guest.mjs @@ -28,6 +28,11 @@ export default { }), ], }, + info: { + type: "alert", + alertType: "warning", + content: "**The API will only list guests created through the Booking Experts API.**", + }, guestId: { propDefinition: [ bookingExperts, diff --git a/components/booking_experts/booking_experts.app.mjs b/components/booking_experts/booking_experts.app.mjs index 3eb7f2d11c799..ae387e6560aac 100644 --- a/components/booking_experts/booking_experts.app.mjs +++ b/components/booking_experts/booking_experts.app.mjs @@ -97,6 +97,9 @@ export default { "page[number]": page + 1, }, }); + + console.log("data: ", data); + return data?.map(({ id, attributes, }) => ({ @@ -142,7 +145,7 @@ export default { return data?.map(({ id, attributes, }) => ({ - label: `${attributes.start_date} - ${attributes.end_date}`, + label: `(${attributes.booking_nr}) ${attributes.start_date} - ${attributes.end_date}`, value: id, })) || []; }, From a8375057b087aa5a6f4ef30f4d861a516150a9e0 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Mon, 17 Nov 2025 18:58:50 -0500 Subject: [PATCH 7/7] Refactor booking_experts actions to improve consistency and functionality - Removed unnecessary console log from booking_experts.app.mjs for cleaner code. - Added missing `$` parameter to addGuestToReservation, deleteGuest, listInventoryObjects, searchContacts, and updateGuest actions for better integration. - Updated readOnlyHint in listAvailabilities action to true for improved user guidance. --- .../add-guest-to-reservation/add-guest-to-reservation.mjs | 1 + .../booking_experts/actions/delete-guest/delete-guest.mjs | 1 + .../actions/list-availabilities/list-availabilities.mjs | 2 +- .../actions/list-inventory-objects/list-inventory-objects.mjs | 1 + .../actions/search-contacts/search-contacts.mjs | 3 ++- .../booking_experts/actions/update-guest/update-guest.mjs | 1 + components/booking_experts/booking_experts.app.mjs | 3 --- 7 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/booking_experts/actions/add-guest-to-reservation/add-guest-to-reservation.mjs b/components/booking_experts/actions/add-guest-to-reservation/add-guest-to-reservation.mjs index 84f415d0d56ba..e4b14404f43be 100644 --- a/components/booking_experts/actions/add-guest-to-reservation/add-guest-to-reservation.mjs +++ b/components/booking_experts/actions/add-guest-to-reservation/add-guest-to-reservation.mjs @@ -77,6 +77,7 @@ export default { }, async run({ $ }) { const { data } = await this.bookingExperts.addGuestToReservation({ + $, administrationId: this.administrationId, reservationId: this.reservationId, data: { diff --git a/components/booking_experts/actions/delete-guest/delete-guest.mjs b/components/booking_experts/actions/delete-guest/delete-guest.mjs index 98c3ee67ad23f..78edb7f3b0b8a 100644 --- a/components/booking_experts/actions/delete-guest/delete-guest.mjs +++ b/components/booking_experts/actions/delete-guest/delete-guest.mjs @@ -48,6 +48,7 @@ export default { }, async run({ $ }) { const response = await this.bookingExperts.deleteGuest({ + $, administrationId: this.administrationId, reservationId: this.reservationId, guestId: this.guestId, diff --git a/components/booking_experts/actions/list-availabilities/list-availabilities.mjs b/components/booking_experts/actions/list-availabilities/list-availabilities.mjs index fdae6239e9b81..234fbdd0376e7 100644 --- a/components/booking_experts/actions/list-availabilities/list-availabilities.mjs +++ b/components/booking_experts/actions/list-availabilities/list-availabilities.mjs @@ -8,7 +8,7 @@ export default { annotations: { destructiveHint: false, openWorldHint: true, - readOnlyHint: false, + readOnlyHint: true, }, type: "action", props: { diff --git a/components/booking_experts/actions/list-inventory-objects/list-inventory-objects.mjs b/components/booking_experts/actions/list-inventory-objects/list-inventory-objects.mjs index 2c8359e6c65b5..593228c3960dd 100644 --- a/components/booking_experts/actions/list-inventory-objects/list-inventory-objects.mjs +++ b/components/booking_experts/actions/list-inventory-objects/list-inventory-objects.mjs @@ -46,6 +46,7 @@ export default { }, async run({ $ }) { const { data } = await this.bookingExperts.listInventoryObjects({ + $, administrationId: this.administrationId, params: { "filter[name]": this.name, diff --git a/components/booking_experts/actions/search-contacts/search-contacts.mjs b/components/booking_experts/actions/search-contacts/search-contacts.mjs index b55cc110304a1..5f5da5593d547 100644 --- a/components/booking_experts/actions/search-contacts/search-contacts.mjs +++ b/components/booking_experts/actions/search-contacts/search-contacts.mjs @@ -1,5 +1,5 @@ -import bookingExperts from "../../booking_experts.app.mjs"; import { ConfigurationError } from "@pipedream/platform"; +import bookingExperts from "../../booking_experts.app.mjs"; export default { key: "booking_experts-search-contacts", @@ -34,6 +34,7 @@ export default { try { const { data } = await this.bookingExperts.searchContacts({ + $, params: { email: this.email, phone: this.phone, diff --git a/components/booking_experts/actions/update-guest/update-guest.mjs b/components/booking_experts/actions/update-guest/update-guest.mjs index 47aa7175fee36..b3b24908f19c6 100644 --- a/components/booking_experts/actions/update-guest/update-guest.mjs +++ b/components/booking_experts/actions/update-guest/update-guest.mjs @@ -96,6 +96,7 @@ export default { }, async run({ $ }) { const { data } = await this.bookingExperts.updateGuest({ + $, administrationId: this.administrationId, reservationId: this.reservationId, guestId: this.guestId, diff --git a/components/booking_experts/booking_experts.app.mjs b/components/booking_experts/booking_experts.app.mjs index ae387e6560aac..d46bc8593b00a 100644 --- a/components/booking_experts/booking_experts.app.mjs +++ b/components/booking_experts/booking_experts.app.mjs @@ -97,9 +97,6 @@ export default { "page[number]": page + 1, }, }); - - console.log("data: ", data); - return data?.map(({ id, attributes, }) => ({