From 9a4b898816d40e39056d888c1a07751ed4b9dff7 Mon Sep 17 00:00:00 2001 From: Ogbonna Nnamdi Christopher Date: Fri, 5 Dec 2025 13:54:08 +0000 Subject: [PATCH 1/6] Add amenities and rentable types actions to Booking Experts - Add listAmenities() method to fetch all amenities - Add getAmenity() method to fetch single amenity by ID - Add listRentableTypesForAdmin() method to list rentable types for administration - Create get_amenity action - Create list_amenities action - Create list_rentable_types action Co-authored-by: Ona --- .../actions/get_amenity/get_amenity.mjs | 0 .../actions/list_amenities/list_amennities.mjs | 13 +++++++++++++ .../list_rentable_types.mjs | 0 .../booking_experts/booking_experts.app.mjs | 18 ++++++++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 components/booking_experts/actions/get_amenity/get_amenity.mjs create mode 100644 components/booking_experts/actions/list_amenities/list_amennities.mjs create mode 100644 components/booking_experts/actions/list_rentable_types/list_rentable_types.mjs diff --git a/components/booking_experts/actions/get_amenity/get_amenity.mjs b/components/booking_experts/actions/get_amenity/get_amenity.mjs new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/components/booking_experts/actions/list_amenities/list_amennities.mjs b/components/booking_experts/actions/list_amenities/list_amennities.mjs new file mode 100644 index 0000000000000..7be808a10f586 --- /dev/null +++ b/components/booking_experts/actions/list_amenities/list_amennities.mjs @@ -0,0 +1,13 @@ +import bookingExperts from "../booking_experts.app.mjs"; + +export default { + key: "booking_experts-list-amenities", + name: "List Amenities", + description: "List amenities from BookingExperts API", + version: "0.0.1", + type: "action", + props: { + bookingExperts, + page: { type: "integer", optional: true } + } +} \ No newline at end of file diff --git a/components/booking_experts/actions/list_rentable_types/list_rentable_types.mjs b/components/booking_experts/actions/list_rentable_types/list_rentable_types.mjs new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/components/booking_experts/booking_experts.app.mjs b/components/booking_experts/booking_experts.app.mjs index 5ea3e0caf5648..347aa5bb9ff2e 100644 --- a/components/booking_experts/booking_experts.app.mjs +++ b/components/booking_experts/booking_experts.app.mjs @@ -484,5 +484,23 @@ export default { ...opts, }); }, + listAmenities(opt = {}){ + return this._makeRequest({ + path: "/amenities", + ...opts, + }); + }, + getAmenity({ id, ...opts }) { + return this._makeRequest({ + path: `/amenities/${id}`, + ...opts, + }); + }, + listRentableTypesForAdmin({ administrationId, ...opts }) { + return this._makeRequest({ + path: `/administrations/${administrationId}/rentable_types`, + ...opts, + }); + } }, }; From c280cdece4ea3a0897c1ae7e5244e8745cfbfb4e Mon Sep 17 00:00:00 2001 From: Ogbonna Nnamdi Christopher Date: Fri, 5 Dec 2025 22:03:12 +0000 Subject: [PATCH 2/6] Fix bugs in Booking Experts amenities and rentable types actions - Fix parameter name typo in listAmenities (opt -> opts) - Fix import path in list_amenities action - Fix parameter name in getAmenity (id -> amenityId) - Fix method name in list_rentable_types (listRentableTypes -> listRentableTypesForAdmin) - Fix parameter name in list_rentable_types (query -> params) - Rename misspelled file list_amennities.mjs to list_amenities.mjs - Add missing implementation to get_amenity and list_rentable_types actions Co-authored-by: Ona --- .../actions/get_amenity/get_amenity.mjs | 35 +++++++++++++ .../actions/list_amenities/list_amenities.mjs | 50 +++++++++++++++++++ .../list_amenities/list_amennities.mjs | 13 ----- .../list_rentable_types.mjs | 49 ++++++++++++++++++ .../booking_experts/booking_experts.app.mjs | 12 +++-- 5 files changed, 142 insertions(+), 17 deletions(-) create mode 100644 components/booking_experts/actions/list_amenities/list_amenities.mjs delete mode 100644 components/booking_experts/actions/list_amenities/list_amennities.mjs diff --git a/components/booking_experts/actions/get_amenity/get_amenity.mjs b/components/booking_experts/actions/get_amenity/get_amenity.mjs index e69de29bb2d1d..5390e2b62e306 100644 --- a/components/booking_experts/actions/get_amenity/get_amenity.mjs +++ b/components/booking_experts/actions/get_amenity/get_amenity.mjs @@ -0,0 +1,35 @@ +import bookingExperts from "../../booking_experts.app.mjs"; + +export default { + key: "booking_experts-get-amenity", + name: "Get Amenity", + description: "Retrieve a single amenity by ID.", + version: "0.0.1", + type: "action", + + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + + props: { + bookingExperts, + + amenityId: { + type: "string", + label: "Amenity ID", + description: "The ID of the amenity to retrieve.", + }, + }, + + async run({ $ }) { + const { data } = await this.bookingExperts.getAmenity({ + $, + amenityId: this.amenityId, + }); + + $.export("$summary", `Successfully retrieved amenity ${this.amenityId}`); + return data; + }, +}; diff --git a/components/booking_experts/actions/list_amenities/list_amenities.mjs b/components/booking_experts/actions/list_amenities/list_amenities.mjs new file mode 100644 index 0000000000000..7aa6cce0dd6d2 --- /dev/null +++ b/components/booking_experts/actions/list_amenities/list_amenities.mjs @@ -0,0 +1,50 @@ +import bookingExperts from "../../booking_experts.app.mjs"; + +export default { + key: "booking_experts-list-amenities", + name: "List Amenities", + description: "List amenities from BookingExperts. [See the documentation](https://developers.bookingexperts.com/reference/amenities-index)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + bookingExperts, + page: { + type: "integer", + label: "Page Number", + optional: true, + }, + perPage: { + type: "integer", + label: "Items Per Page", + optional: true, + }, + filters: { + type: "object", + label: "Filters", + optional: true, + description: "Additional query params to filter amenities", + }, + }, + + async run({ $ }) { + const params = { + "page[number]": this.page, + "page[size]": this.perPage, + ...this.filters, + }; + + const { data } = await this.bookingExperts.listAmenities({ + $, + params, + }); + + $.export("$summary", `Successfully retrieved ${data?.length ?? 0} amenities`); + + return data; + } +} \ No newline at end of file diff --git a/components/booking_experts/actions/list_amenities/list_amennities.mjs b/components/booking_experts/actions/list_amenities/list_amennities.mjs deleted file mode 100644 index 7be808a10f586..0000000000000 --- a/components/booking_experts/actions/list_amenities/list_amennities.mjs +++ /dev/null @@ -1,13 +0,0 @@ -import bookingExperts from "../booking_experts.app.mjs"; - -export default { - key: "booking_experts-list-amenities", - name: "List Amenities", - description: "List amenities from BookingExperts API", - version: "0.0.1", - type: "action", - props: { - bookingExperts, - page: { type: "integer", optional: true } - } -} \ No newline at end of file diff --git a/components/booking_experts/actions/list_rentable_types/list_rentable_types.mjs b/components/booking_experts/actions/list_rentable_types/list_rentable_types.mjs index e69de29bb2d1d..2278e0af7c904 100644 --- a/components/booking_experts/actions/list_rentable_types/list_rentable_types.mjs +++ b/components/booking_experts/actions/list_rentable_types/list_rentable_types.mjs @@ -0,0 +1,49 @@ +import bookingExperts from "../../booking_experts.app.mjs"; + +export default { + key: "booking_experts-list-rentable-types", + name: "List Rentable Types", + description: "List all rentable types for a given administration.", + + version: "0.0.1", + type: "action", + + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + + props: { + bookingExperts, + + administrationId: { + propDefinition: [ + bookingExperts, + "administrationId", + ], + }, + + query: { + type: "object", + label: "Query Filters", + description: "Optional filters passed to the API. Leave empty to fetch everything.", + optional: true, + }, + }, + + async run({ $ }) { + const { data } = await this.bookingExperts.listRentableTypesForAdmin({ + $, + administrationId: this.administrationId, + params: this.query, + }); + + $.export( + "$summary", + `Fetched ${data?.length ?? 0} rentable types for Administration #${this.administrationId}` + ); + + return data; + }, +}; diff --git a/components/booking_experts/booking_experts.app.mjs b/components/booking_experts/booking_experts.app.mjs index 347aa5bb9ff2e..2e2d52a30e48d 100644 --- a/components/booking_experts/booking_experts.app.mjs +++ b/components/booking_experts/booking_experts.app.mjs @@ -484,19 +484,23 @@ export default { ...opts, }); }, - listAmenities(opt = {}){ + listAmenities(opts = {}) { return this._makeRequest({ path: "/amenities", ...opts, }); }, - getAmenity({ id, ...opts }) { + getAmenity({ + amenityId, ...opts + }) { return this._makeRequest({ - path: `/amenities/${id}`, + path: `/amenities/${amenityId}`, ...opts, }); }, - listRentableTypesForAdmin({ administrationId, ...opts }) { + listRentableTypesForAdmin({ + administrationId, ...opts + }) { return this._makeRequest({ path: `/administrations/${administrationId}/rentable_types`, ...opts, From d60094b081ae55fab58aa390d0fcbbe1d826d3ae Mon Sep 17 00:00:00 2001 From: Ogbonna Nnamdi Christopher Date: Fri, 5 Dec 2025 22:09:39 +0000 Subject: [PATCH 3/6] Fix code style and conventions in Booking Experts actions - Rename directories to use hyphens (get-amenity, list-amenities, list-rentable-types) - Add documentation links to get-amenity and list-rentable-types descriptions - Update list-amenities to use propDefinitions for page and perPage props - Fix property order in get-amenity (move annotations before type) - Fix indentation in list-amenities (use 2-space indentation) - Standardize summary formatting in list-rentable-types All actions now follow established codebase conventions. Co-authored-by: Ona --- .../get_amenity.mjs | 6 +-- .../actions/list-amenities/list_amenities.mjs | 51 +++++++++++++++++++ .../list_rentable_types.mjs | 8 +-- .../actions/list_amenities/list_amenities.mjs | 50 ------------------ 4 files changed, 55 insertions(+), 60 deletions(-) rename components/booking_experts/actions/{get_amenity => get-amenity}/get_amenity.mjs (83%) create mode 100644 components/booking_experts/actions/list-amenities/list_amenities.mjs rename components/booking_experts/actions/{list_rentable_types => list-rentable-types}/list_rentable_types.mjs (78%) delete mode 100644 components/booking_experts/actions/list_amenities/list_amenities.mjs diff --git a/components/booking_experts/actions/get_amenity/get_amenity.mjs b/components/booking_experts/actions/get-amenity/get_amenity.mjs similarity index 83% rename from components/booking_experts/actions/get_amenity/get_amenity.mjs rename to components/booking_experts/actions/get-amenity/get_amenity.mjs index 5390e2b62e306..48ecb8001a502 100644 --- a/components/booking_experts/actions/get_amenity/get_amenity.mjs +++ b/components/booking_experts/actions/get-amenity/get_amenity.mjs @@ -3,16 +3,14 @@ import bookingExperts from "../../booking_experts.app.mjs"; export default { key: "booking_experts-get-amenity", name: "Get Amenity", - description: "Retrieve a single amenity by ID.", + description: "Retrieve a single amenity by ID. [See the documentation](https://developers.bookingexperts.com/reference/amenities-show)", version: "0.0.1", - type: "action", - annotations: { destructiveHint: false, openWorldHint: true, readOnlyHint: true, }, - + type: "action", props: { bookingExperts, diff --git a/components/booking_experts/actions/list-amenities/list_amenities.mjs b/components/booking_experts/actions/list-amenities/list_amenities.mjs new file mode 100644 index 0000000000000..e357efeaaad10 --- /dev/null +++ b/components/booking_experts/actions/list-amenities/list_amenities.mjs @@ -0,0 +1,51 @@ +import bookingExperts from "../../booking_experts.app.mjs"; + +export default { + key: "booking_experts-list-amenities", + name: "List Amenities", + description: "List amenities from BookingExperts. [See the documentation](https://developers.bookingexperts.com/reference/amenities-index)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + bookingExperts, + page: { + propDefinition: [ + bookingExperts, + "page", + ], + }, + perPage: { + propDefinition: [ + bookingExperts, + "perPage", + ], + }, + filters: { + type: "object", + label: "Filters", + optional: true, + description: "Additional query params to filter amenities", + }, + }, + async run({ $ }) { + const params = { + "page[number]": this.page, + "page[size]": this.perPage, + ...this.filters, + }; + + const { data } = await this.bookingExperts.listAmenities({ + $, + params, + }); + + $.export("$summary", `Successfully retrieved ${data?.length ?? 0} amenities`); + + return data; + }, +}; \ No newline at end of file diff --git a/components/booking_experts/actions/list_rentable_types/list_rentable_types.mjs b/components/booking_experts/actions/list-rentable-types/list_rentable_types.mjs similarity index 78% rename from components/booking_experts/actions/list_rentable_types/list_rentable_types.mjs rename to components/booking_experts/actions/list-rentable-types/list_rentable_types.mjs index 2278e0af7c904..60dc1bff3d0c5 100644 --- a/components/booking_experts/actions/list_rentable_types/list_rentable_types.mjs +++ b/components/booking_experts/actions/list-rentable-types/list_rentable_types.mjs @@ -3,8 +3,7 @@ import bookingExperts from "../../booking_experts.app.mjs"; export default { key: "booking_experts-list-rentable-types", name: "List Rentable Types", - description: "List all rentable types for a given administration.", - + description: "List all rentable types for a given administration. [See the documentation](https://developers.bookingexperts.com/reference/administration-rentabletypes-index)", version: "0.0.1", type: "action", @@ -39,10 +38,7 @@ export default { params: this.query, }); - $.export( - "$summary", - `Fetched ${data?.length ?? 0} rentable types for Administration #${this.administrationId}` - ); + $.export("$summary", `Successfully retrieved ${data?.length ?? 0} rentable types for Administration ${this.administrationId}`); return data; }, diff --git a/components/booking_experts/actions/list_amenities/list_amenities.mjs b/components/booking_experts/actions/list_amenities/list_amenities.mjs deleted file mode 100644 index 7aa6cce0dd6d2..0000000000000 --- a/components/booking_experts/actions/list_amenities/list_amenities.mjs +++ /dev/null @@ -1,50 +0,0 @@ -import bookingExperts from "../../booking_experts.app.mjs"; - -export default { - key: "booking_experts-list-amenities", - name: "List Amenities", - description: "List amenities from BookingExperts. [See the documentation](https://developers.bookingexperts.com/reference/amenities-index)", - version: "0.0.1", - annotations: { - destructiveHint: false, - openWorldHint: true, - readOnlyHint: true, - }, - type: "action", - props: { - bookingExperts, - page: { - type: "integer", - label: "Page Number", - optional: true, - }, - perPage: { - type: "integer", - label: "Items Per Page", - optional: true, - }, - filters: { - type: "object", - label: "Filters", - optional: true, - description: "Additional query params to filter amenities", - }, - }, - - async run({ $ }) { - const params = { - "page[number]": this.page, - "page[size]": this.perPage, - ...this.filters, - }; - - const { data } = await this.bookingExperts.listAmenities({ - $, - params, - }); - - $.export("$summary", `Successfully retrieved ${data?.length ?? 0} amenities`); - - return data; - } -} \ No newline at end of file From 86326c60873849e635f0f89b5b51dbf4a3c3f81a Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Mon, 8 Dec 2025 12:07:32 -0500 Subject: [PATCH 4/6] updates --- .../{get_amenity.mjs => get-amenity.mjs} | 9 +- .../actions/list-amenities/list-amenities.mjs | 108 ++++++++++++++++++ .../actions/list-amenities/list_amenities.mjs | 51 --------- .../list-rentable-types.mjs | 78 +++++++++++++ .../list_rentable_types.mjs | 45 -------- .../booking_experts/booking_experts.app.mjs | 62 +++++++++- components/booking_experts/common/utils.mjs | 27 +++++ components/booking_experts/package.json | 2 +- 8 files changed, 279 insertions(+), 103 deletions(-) rename components/booking_experts/actions/get-amenity/{get_amenity.mjs => get-amenity.mjs} (86%) create mode 100644 components/booking_experts/actions/list-amenities/list-amenities.mjs delete mode 100644 components/booking_experts/actions/list-amenities/list_amenities.mjs create mode 100644 components/booking_experts/actions/list-rentable-types/list-rentable-types.mjs delete mode 100644 components/booking_experts/actions/list-rentable-types/list_rentable_types.mjs create mode 100644 components/booking_experts/common/utils.mjs diff --git a/components/booking_experts/actions/get-amenity/get_amenity.mjs b/components/booking_experts/actions/get-amenity/get-amenity.mjs similarity index 86% rename from components/booking_experts/actions/get-amenity/get_amenity.mjs rename to components/booking_experts/actions/get-amenity/get-amenity.mjs index 48ecb8001a502..d24a3d59b7ad3 100644 --- a/components/booking_experts/actions/get-amenity/get_amenity.mjs +++ b/components/booking_experts/actions/get-amenity/get-amenity.mjs @@ -13,14 +13,13 @@ export default { type: "action", props: { bookingExperts, - amenityId: { - type: "string", - label: "Amenity ID", - description: "The ID of the amenity to retrieve.", + propDefinition: [ + bookingExperts, + "amenityId", + ], }, }, - async run({ $ }) { const { data } = await this.bookingExperts.getAmenity({ $, diff --git a/components/booking_experts/actions/list-amenities/list-amenities.mjs b/components/booking_experts/actions/list-amenities/list-amenities.mjs new file mode 100644 index 0000000000000..bf81b88ad6d58 --- /dev/null +++ b/components/booking_experts/actions/list-amenities/list-amenities.mjs @@ -0,0 +1,108 @@ +import bookingExperts from "../../booking_experts.app.mjs"; + +export default { + key: "booking_experts-list-amenities", + name: "List Amenities", + description: "List amenities from BookingExperts. [See the documentation](https://developers.bookingexperts.com/reference/amenities-index)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + bookingExperts, + page: { + propDefinition: [ + bookingExperts, + "page", + ], + }, + perPage: { + propDefinition: [ + bookingExperts, + "perPage", + ], + }, + sort: { + propDefinition: [ + bookingExperts, + "sort", + ], + }, + fields: { + propDefinition: [ + bookingExperts, + "fields", + ], + }, + include: { + propDefinition: [ + bookingExperts, + "include", + ], + }, + name: { + type: "string", + label: "Name", + description: "Filter by name", + optional: true, + }, + type: { + type: "string", + label: "Type", + description: "Filter by type", + optional: true, + }, + position: { + type: "string", + label: "Position", + description: "Filter by position", + optional: true, + }, + semanticAmenityType: { + type: "string", + label: "Semantic Amenity Type", + description: "Filter by semantic amenity type", + optional: true, + }, + amenityGroup: { + propDefinition: [ + bookingExperts, + "amenityGroupId", + ], + optional: true, + }, + amenityOptions: { + type: "string", + label: "Amenity Options", + description: "Filter on amenity_options. Specify a comma separated list of IDs to filter on.", + optional: true, + }, + }, + async run({ $ }) { + const params = { + "page[number]": this.page, + "page[size]": this.perPage, + "sort": this.sort, + "fields[amenity]": this.fields, + "include": this.include, + "filter[name]": this.name, + "filter[type]": this.type, + "filter[position]": this.position, + "filter[semantic_amenity_type]": this.semanticAmenityType, + "filter[amenity_group]": this.amenityGroup, + "filter[amenity_options]": this.amenityOptions, + }; + + const { data } = await this.bookingExperts.listAmenities({ + $, + params, + }); + + $.export("$summary", `Successfully retrieved ${data?.length ?? 0} amenities`); + + return data; + }, +}; diff --git a/components/booking_experts/actions/list-amenities/list_amenities.mjs b/components/booking_experts/actions/list-amenities/list_amenities.mjs deleted file mode 100644 index e357efeaaad10..0000000000000 --- a/components/booking_experts/actions/list-amenities/list_amenities.mjs +++ /dev/null @@ -1,51 +0,0 @@ -import bookingExperts from "../../booking_experts.app.mjs"; - -export default { - key: "booking_experts-list-amenities", - name: "List Amenities", - description: "List amenities from BookingExperts. [See the documentation](https://developers.bookingexperts.com/reference/amenities-index)", - version: "0.0.1", - annotations: { - destructiveHint: false, - openWorldHint: true, - readOnlyHint: true, - }, - type: "action", - props: { - bookingExperts, - page: { - propDefinition: [ - bookingExperts, - "page", - ], - }, - perPage: { - propDefinition: [ - bookingExperts, - "perPage", - ], - }, - filters: { - type: "object", - label: "Filters", - optional: true, - description: "Additional query params to filter amenities", - }, - }, - async run({ $ }) { - const params = { - "page[number]": this.page, - "page[size]": this.perPage, - ...this.filters, - }; - - const { data } = await this.bookingExperts.listAmenities({ - $, - params, - }); - - $.export("$summary", `Successfully retrieved ${data?.length ?? 0} amenities`); - - return data; - }, -}; \ No newline at end of file diff --git a/components/booking_experts/actions/list-rentable-types/list-rentable-types.mjs b/components/booking_experts/actions/list-rentable-types/list-rentable-types.mjs new file mode 100644 index 0000000000000..be61153e9bd78 --- /dev/null +++ b/components/booking_experts/actions/list-rentable-types/list-rentable-types.mjs @@ -0,0 +1,78 @@ +import bookingExperts from "../../booking_experts.app.mjs"; +import { parseObject } from "../../common/utils.mjs"; + +export default { + key: "booking_experts-list-rentable-types", + name: "List Rentable Types", + description: "List all rentable types for a given administration. [See the documentation](https://developers.bookingexperts.com/reference/administration-rentabletypes-index)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + bookingExperts, + administrationId: { + propDefinition: [ + bookingExperts, + "administrationId", + ], + }, + page: { + propDefinition: [ + bookingExperts, + "page", + ], + }, + perPage: { + propDefinition: [ + bookingExperts, + "perPage", + ], + }, + sort: { + propDefinition: [ + bookingExperts, + "sort", + ], + }, + fields: { + propDefinition: [ + bookingExperts, + "fields", + ], + }, + include: { + propDefinition: [ + bookingExperts, + "include", + ], + }, + filters: { + type: "object", + label: "Filters", + description: "Additional query params to filter rentable types. Example: `filter[name]=My Rentable Type` [See the documentation](https://developers.bookingexperts.com/reference/administration-rentabletypes-index) for available filters.", + optional: true, + }, + }, + async run({ $ }) { + const { data } = await this.bookingExperts.listRentableTypesForAdmin({ + $, + administrationId: this.administrationId, + params: { + "page[number]": this.page, + "page[size]": this.perPage, + "sort": this.sort, + "fields[rentable_type]": this.fields, + "include": this.include, + ...parseObject(this.filters), + }, + }); + + $.export("$summary", `Successfully retrieved ${data?.length ?? 0} rentable types for Administration ${this.administrationId}`); + + return data; + }, +}; diff --git a/components/booking_experts/actions/list-rentable-types/list_rentable_types.mjs b/components/booking_experts/actions/list-rentable-types/list_rentable_types.mjs deleted file mode 100644 index 60dc1bff3d0c5..0000000000000 --- a/components/booking_experts/actions/list-rentable-types/list_rentable_types.mjs +++ /dev/null @@ -1,45 +0,0 @@ -import bookingExperts from "../../booking_experts.app.mjs"; - -export default { - key: "booking_experts-list-rentable-types", - name: "List Rentable Types", - description: "List all rentable types for a given administration. [See the documentation](https://developers.bookingexperts.com/reference/administration-rentabletypes-index)", - version: "0.0.1", - type: "action", - - annotations: { - destructiveHint: false, - openWorldHint: true, - readOnlyHint: true, - }, - - props: { - bookingExperts, - - administrationId: { - propDefinition: [ - bookingExperts, - "administrationId", - ], - }, - - query: { - type: "object", - label: "Query Filters", - description: "Optional filters passed to the API. Leave empty to fetch everything.", - optional: true, - }, - }, - - async run({ $ }) { - const { data } = await this.bookingExperts.listRentableTypesForAdmin({ - $, - administrationId: this.administrationId, - params: this.query, - }); - - $.export("$summary", `Successfully retrieved ${data?.length ?? 0} rentable types for Administration ${this.administrationId}`); - - return data; - }, -}; diff --git a/components/booking_experts/booking_experts.app.mjs b/components/booking_experts/booking_experts.app.mjs index 2e2d52a30e48d..6acb8a1932540 100644 --- a/components/booking_experts/booking_experts.app.mjs +++ b/components/booking_experts/booking_experts.app.mjs @@ -260,6 +260,24 @@ export default { max: 100, optional: true, }, + sort: { + type: "string", + label: "Sort", + description: "Specify a comma separated list of attributes to sort on. Prefix attribute with a - to sort in descending order", + optional: true, + }, + fields: { + type: "string", + label: "Fields", + description: "Specify a comma separated list of attributes to return", + optional: true, + }, + include: { + type: "string", + label: "Include", + description: "Specify a comma separated list of resources to include", + optional: true, + }, customerId: { type: "string", label: "Customer ID", @@ -289,6 +307,42 @@ export default { })) || []; }, }, + amenityId: { + type: "string", + label: "Amenity ID", + description: "The ID of the amenity to retrieve", + async options({ page }) { + const { data } = await this.listAmenities({ + params: { + "page[number]": page + 1, + }, + }); + return data?.map(({ + id, attributes, + }) => ({ + label: attributes.name.en || attributes.semantic_amenity_type || id, + value: id, + })) || []; + }, + }, + amenityGroupId: { + type: "string", + label: "Amenity Group ID", + description: "Filter by amenity group", + async options({ page }) { + const { data } = await this.listAmenityGroups({ + params: { + "page[number]": page + 1, + }, + }); + return data?.map(({ + id, attributes, + }) => ({ + label: attributes.name.en || id, + value: id, + })) || []; + }, + }, }, methods: { _baseUrl() { @@ -505,6 +559,12 @@ export default { path: `/administrations/${administrationId}/rentable_types`, ...opts, }); - } + }, + listAmenityGroups(opts = {}) { + return this._makeRequest({ + path: "/amenity_groups", + ...opts, + }); + }, }, }; diff --git a/components/booking_experts/common/utils.mjs b/components/booking_experts/common/utils.mjs new file mode 100644 index 0000000000000..aa89b93b74762 --- /dev/null +++ b/components/booking_experts/common/utils.mjs @@ -0,0 +1,27 @@ +export const parseObject = (obj) => { + if (!obj) return undefined; + + if (typeof obj === "string") { + try { + return JSON.parse(obj); + } catch (e) { + return obj; + } + } + + if (Array.isArray(obj)) { + return obj.map((item) => parseObject(item)); + } + + if (typeof obj === "object") { + return Object.fromEntries(Object.entries(obj).map(([ + key, + value, + ]) => [ + key, + parseObject(value), + ])); + } + + return obj; +}; diff --git a/components/booking_experts/package.json b/components/booking_experts/package.json index 34e9385711cae..52ade66eaadb7 100644 --- a/components/booking_experts/package.json +++ b/components/booking_experts/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/booking_experts", - "version": "0.3.2", + "version": "0.4.0", "description": "Pipedream Booking Experts Components", "main": "booking_experts.app.mjs", "keywords": [ From 2f0670b6f62b3f4c32606eb7292b2d6501a69cdc Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Mon, 8 Dec 2025 12:11:16 -0500 Subject: [PATCH 5/6] versions --- .../add-guest-to-reservation/add-guest-to-reservation.mjs | 2 +- .../actions/create-agenda-period/create-agenda-period.mjs | 2 +- .../booking_experts/actions/delete-guest/delete-guest.mjs | 2 +- components/booking_experts/actions/get-booking/get-booking.mjs | 2 +- .../actions/get-complex-prices/get-complex-prices.mjs | 2 +- .../booking_experts/actions/get-reservation/get-reservation.mjs | 2 +- .../actions/list-availabilities/list-availabilities.mjs | 2 +- .../booking_experts/actions/list-bookings/list-bookings.mjs | 2 +- .../actions/list-inventory-objects/list-inventory-objects.mjs | 2 +- .../list-rentabletype-availabilities.mjs | 2 +- .../actions/list-reservations/list-reservations.mjs | 2 +- .../booking_experts/actions/search-contacts/search-contacts.mjs | 2 +- .../booking_experts/actions/update-guest/update-guest.mjs | 2 +- components/booking_experts/package.json | 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 +- 18 files changed, 18 insertions(+), 18 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 dd09800c83741..5787dca0cb3c1 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 @@ -5,7 +5,7 @@ export default { 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.7", + version: "0.0.8", annotations: { destructiveHint: false, openWorldHint: true, 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 9009c48c71e73..a9c9a9ce15719 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.6", + version: "0.0.7", 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 index 261d8298d0122..e0deda9c57d33 100644 --- a/components/booking_experts/actions/delete-guest/delete-guest.mjs +++ b/components/booking_experts/actions/delete-guest/delete-guest.mjs @@ -4,7 +4,7 @@ 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.4", + version: "0.0.5", annotations: { destructiveHint: true, openWorldHint: true, diff --git a/components/booking_experts/actions/get-booking/get-booking.mjs b/components/booking_experts/actions/get-booking/get-booking.mjs index 866da7eb4bfa7..5d109a72332ed 100644 --- a/components/booking_experts/actions/get-booking/get-booking.mjs +++ b/components/booking_experts/actions/get-booking/get-booking.mjs @@ -4,7 +4,7 @@ export default { key: "booking_experts-get-booking", name: "Get Booking", description: "Returns a booking. [See the documentation](https://developers.bookingexperts.com/reference/administration-bookings-show)", - version: "0.0.4", + version: "0.0.5", 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 a61b0a951f36e..65e1bf5bdd147 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.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/booking_experts/actions/get-reservation/get-reservation.mjs b/components/booking_experts/actions/get-reservation/get-reservation.mjs index 58f0ede2bc1fe..47ee671f30680 100644 --- a/components/booking_experts/actions/get-reservation/get-reservation.mjs +++ b/components/booking_experts/actions/get-reservation/get-reservation.mjs @@ -4,7 +4,7 @@ export default { name: "Get Reservation", description: "Fetches a reservation by ID from Booking Experts. [See the documentation](https://developers.bookingexperts.com/reference/reservations-show)", key: "booking_experts-get-reservation", - version: "0.0.3", + version: "0.0.4", type: "action", annotations: { destructiveHint: false, diff --git a/components/booking_experts/actions/list-availabilities/list-availabilities.mjs b/components/booking_experts/actions/list-availabilities/list-availabilities.mjs index cd6b2f6c8de6f..10ede3ff78d1c 100644 --- a/components/booking_experts/actions/list-availabilities/list-availabilities.mjs +++ b/components/booking_experts/actions/list-availabilities/list-availabilities.mjs @@ -10,7 +10,7 @@ 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.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/booking_experts/actions/list-bookings/list-bookings.mjs b/components/booking_experts/actions/list-bookings/list-bookings.mjs index 4548afa8dad05..a9f91f55a71e4 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.6", + version: "0.0.7", 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 b7e1abe159252..c4c471be149c9 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.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, 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 597934c4c3f5f..b4ea134892688 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 @@ -7,7 +7,7 @@ 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.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/booking_experts/actions/list-reservations/list-reservations.mjs b/components/booking_experts/actions/list-reservations/list-reservations.mjs index 0d8c5d7a5d0e7..922a227cc8341 100644 --- a/components/booking_experts/actions/list-reservations/list-reservations.mjs +++ b/components/booking_experts/actions/list-reservations/list-reservations.mjs @@ -4,7 +4,7 @@ export default { name: "List Reservations", description: "Lists all reservations for the current organization from Booking Experts. [See the documentation](https://developers.bookingexperts.com/reference/reservations-index)", key: "booking_experts-list-reservations", - version: "0.0.3", + version: "0.0.4", type: "action", annotations: { destructiveHint: false, diff --git a/components/booking_experts/actions/search-contacts/search-contacts.mjs b/components/booking_experts/actions/search-contacts/search-contacts.mjs index f80059bfc18da..ffb7985875cc9 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.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/booking_experts/actions/update-guest/update-guest.mjs b/components/booking_experts/actions/update-guest/update-guest.mjs index 8e04999bd4bab..0236579ac2284 100644 --- a/components/booking_experts/actions/update-guest/update-guest.mjs +++ b/components/booking_experts/actions/update-guest/update-guest.mjs @@ -5,7 +5,7 @@ export default { 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.5", + version: "0.0.6", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/booking_experts/package.json b/components/booking_experts/package.json index 52ade66eaadb7..ab6d3b958d985 100644 --- a/components/booking_experts/package.json +++ b/components/booking_experts/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/booking_experts", - "version": "0.4.0", + "version": "0.5.0", "description": "Pipedream Booking Experts Components", "main": "booking_experts.app.mjs", "keywords": [ diff --git a/components/booking_experts/sources/booking-updated/booking-updated.mjs b/components/booking_experts/sources/booking-updated/booking-updated.mjs index c81b57448f2f4..0913f7df4d708 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.5", + version: "0.0.6", 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 9ac7b7449dd4e..cf8ac8578fb80 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.5", + version: "0.0.6", 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 55842bcf5d70c..df28a585955ad 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.5", + version: "0.0.6", 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 3af0f7f1044e7..51ece5eb0fe4c 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.5", + version: "0.0.6", type: "source", dedupe: "unique", props: { From ab4422f6bc1d3790d70a46da12967cf8e6a8892f Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Mon, 8 Dec 2025 12:16:31 -0500 Subject: [PATCH 6/6] update --- .../booking_experts/booking_experts.app.mjs | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/components/booking_experts/booking_experts.app.mjs b/components/booking_experts/booking_experts.app.mjs index 62238e48a9b91..c911a73de6ebe 100644 --- a/components/booking_experts/booking_experts.app.mjs +++ b/components/booking_experts/booking_experts.app.mjs @@ -365,24 +365,6 @@ export default { })) || []; }, }, - amenityId: { - type: "string", - label: "Amenity ID", - description: "The ID of the amenity to retrieve", - async options({ page }) { - const { data } = await this.listAmenities({ - params: { - "page[number]": page + 1, - }, - }); - return data?.map(({ - id, attributes, - }) => ({ - label: attributes.name.en || attributes.semantic_amenity_type || id, - value: id, - })) || []; - }, - }, amenityGroupId: { type: "string", label: "Amenity Group ID", @@ -616,12 +598,6 @@ export default { ...opts, }); }, - listAmenities(opts = {}) { - return this._makeRequest({ - path: "/amenities", - ...opts, - }); - }, getAmenity({ amenityId, ...opts }) {