Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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.4",
version: "0.0.5",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.4",
version: "0.0.5",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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.2",
version: "0.0.3",
annotations: {
destructiveHint: true,
openWorldHint: true,
Expand All @@ -28,7 +28,7 @@
}),
],
},
info: {

Check warning on line 31 in components/booking_experts/actions/delete-guest/delete-guest.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a description. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 31 in components/booking_experts/actions/delete-guest/delete-guest.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a label. See https://pipedream.com/docs/components/guidelines/#props
type: "alert",
alertType: "warning",
content: "**The API will only list guests created through the Booking Experts API.**",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.2",
version: "0.0.3",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.4",
version: "0.0.5",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.1",
version: "0.0.2",
type: "action",
annotations: {
destructiveHint: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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.2",
version: "0.0.3",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand All @@ -13,7 +13,7 @@
type: "action",
props: {
bookingExperts,
info: {

Check warning on line 16 in components/booking_experts/actions/list-availabilities/list-availabilities.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a description. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 16 in components/booking_experts/actions/list-availabilities/list-availabilities.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a label. See https://pipedream.com/docs/components/guidelines/#props
type: "alert",
alertType: "warning",
content: "**You must have at least one channel created through the Booking Experts API.**",
Expand Down
119 changes: 108 additions & 11 deletions components/booking_experts/actions/list-bookings/list-bookings.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.4",
version: "0.0.5",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down Expand Up @@ -39,15 +39,28 @@ export default {
],
description: "Filter by channel",
},
reservationId: {
reservationIds: {
type: "string[]",
label: "Reservation IDs",
description: "Filter by reservation IDs",
propDefinition: [
bookingExperts,
"reservationId",
(c) => ({
administrationId: c.administrationId,
}),
],
description: "Filter by reservation",
},
createdAt: {
type: "string",
label: "Created At",
description: "Filter by created at (ISO 8601 format, e.g., `2024-01-01T00:00:00Z`)",
optional: true,
},
updatedAt: {
type: "string",
label: "Updated At",
description: "Filter by updated at (ISO 8601 format, e.g., `2024-01-01T00:00:00Z`)",
optional: true,
},
page: {
Expand All @@ -62,19 +75,103 @@ export default {
"perPage",
],
},
filterId: {
optional: true,
propDefinition: [
bookingExperts,
"bookingId",
({ administrationId }) => ({
administrationId,
}),
],
},
customerIds: {
type: "string[]",
label: "Customer IDs",
description: "Filter by customer IDs",
propDefinition: [
bookingExperts,
"customerId",
({ administrationId }) => ({
administrationId,
}),
],
},
bookingNr: {
label: "Booking Number",
description: "Filter by booking number",
optional: true,
propDefinition: [
bookingExperts,
"bookingId",
({ administrationId }) => ({
administrationId,
mapper: ({ attributes: { booking_nr: value } }) => value,
}),
],
},
confirmedAt: {
type: "string",
label: "Confirmed At",
description: "Filter by confirmed at (ISO 8601 format, e.g., `2024-01-01T00:00:00Z`)",
optional: true,
},
fieldsBooking: {
type: "string[]",
label: "Fields Booking",
description: "Fields to return for the booking",
optional: true,
},
referenceNr: {
type: "string",
label: "Reference Number",
description: "Filter by reference number",
optional: true,
},
},
methods: {
commaSeparatedList(value) {
return Array.isArray(value) && value?.length > 0
? value.join(",")
: value;
},
},
async run({ $ }) {
const {
commaSeparatedList,
administrationId,
ownerId,
administrationChannelId,
reservationIds,
createdAt,
updatedAt,
page,
perPage,
filterId,
customerIds,
bookingNr,
confirmedAt,
fieldsBooking,
referenceNr,
} = this;

const { data } = await this.bookingExperts.listBookings({
$,
administrationId: this.administrationId,
administrationId,
params: {
"filter[owner]": this.ownerId,
"filter[channel]": this.listAdministrationChannels,
"filter[reservations]": this.reservationId,
"filter[created_at]": this.createdAt,
"filter[updated_at]": this.updatedAt,
"page[number]": this.page,
"page[size]": this.perPage,
"filter[owner]": ownerId,
"filter[channel]": administrationChannelId,
"filter[created_at]": createdAt,
"filter[updated_at]": updatedAt,
"page[number]": page,
"page[size]": perPage,
"filter[ID]": filterId,
"filter[reservations]": commaSeparatedList(reservationIds),
"filter[customer]": commaSeparatedList(customerIds),
"filter[booking_nr]": bookingNr,
"filter[confirmed_at]": confirmedAt,
"fields[booking]": commaSeparatedList(fieldsBooking),
"filter[reference_nr]": referenceNr,
},
});
$.export("$summary", `Found ${data.length} bookings`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.4",
version: "0.0.5",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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.2",
version: "0.0.3",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand All @@ -14,7 +14,7 @@
type: "action",
props: {
bookingExperts,
info: {

Check warning on line 17 in components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a description. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 17 in components/booking_experts/actions/list-rentabletype-availabilities/list-rentabletype-availabilities.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a label. See https://pipedream.com/docs/components/guidelines/#props
type: "alert",
alertType: "warning",
content: "**The API will only list channels created through the Booking Experts API.**",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.1",
version: "0.0.2",
type: "action",
annotations: {
destructiveHint: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.4",
version: "0.0.5",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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.2",
version: "0.0.3",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand All @@ -28,7 +28,7 @@
}),
],
},
info: {

Check warning on line 31 in components/booking_experts/actions/update-guest/update-guest.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a description. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 31 in components/booking_experts/actions/update-guest/update-guest.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop info must have a label. See https://pipedream.com/docs/components/guidelines/#props
type: "alert",
alertType: "warning",
content: "**The API will only list guests created through the Booking Experts API.**",
Expand Down
53 changes: 47 additions & 6 deletions components/booking_experts/booking_experts.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,23 @@ export default {
description: "The ID of a booking",
async options({
page, administrationId,
mapper = ({
id, attributes,
}) => ({
label: attributes.booking_nr,
value: id,
}),
}) {
if (!administrationId) {
return [];
}
const { data } = await this.listBookings({
administrationId,
params: {
"page[number]": page + 1,
},
});
return data?.map(({
id, attributes,
}) => ({
label: attributes.booking_nr,
value: id,
})) || [];
return data?.map(mapper) || [];
},
},
channelId: {
Expand Down Expand Up @@ -256,6 +260,35 @@ export default {
max: 100,
optional: true,
},
customerId: {
type: "string",
label: "Customer ID",
description: "The ID of a customer",
optional: true,
async options({
page, administrationId,
}) {
if (!administrationId) {
return [];
}
const { data } = await this.listCustomers({
administrationId,
params: {
"page[number]": page + 1,
},
});
return data?.map(({
id, attributes,
}) => ({
// if first_name and last_name are not empty, show them, otherwise show the email
label: [
attributes.first_name,
attributes.last_name,
].filter(Boolean).join(" ") || attributes.email || id,
value: id,
})) || [];
},
},
},
methods: {
_baseUrl() {
Expand Down Expand Up @@ -443,5 +476,13 @@ export default {
...opts,
});
},
listCustomers({
administrationId, ...opts
}) {
return this._makeRequest({
path: `/administrations/${administrationId}/customers`,
...opts,
});
},
},
};
2 changes: 1 addition & 1 deletion components/booking_experts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/booking_experts",
"version": "0.3.0",
"version": "0.3.1",
"description": "Pipedream Booking Experts Components",
"main": "booking_experts.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
export default {
...common,
key: "booking_experts-booking-updated",
name: "Booking Updated",

Check warning on line 6 in components/booking_experts/sources/booking-updated/booking-updated.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new event for each booking updated. [See the documentation](https://developers.bookingexperts.com/reference/administration-bookings-index)",
version: "0.0.3",
version: "0.0.4",
type: "source",
dedupe: "unique",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
export default {
...common,
key: "booking_experts-inventory-object-updated",
name: "Inventory Object Updated",

Check warning on line 6 in components/booking_experts/sources/inventory-object-updated/inventory-object-updated.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new event when an inventory object is updated. [See the documentation](https://developers.bookingexperts.com/reference/administration-inventoryobjects-index)",
version: "0.0.3",
version: "0.0.4",
type: "source",
dedupe: "unique",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.3",
version: "0.0.4",
type: "source",
dedupe: "unique",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.3",
version: "0.0.4",
type: "source",
dedupe: "unique",
props: {
Expand Down
Loading