@v-office/website-sdk 2.11.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +6 -1
  2. package/dist/capabilities/search.d.mts +2 -0
  3. package/dist/capabilities/search.mjs +2 -0
  4. package/dist/cli.d.mts +1 -1
  5. package/dist/cli.mjs +2 -2
  6. package/dist/{client-DYAHnU5F.mjs → client-Ma0daa2H.mjs} +140 -68
  7. package/dist/index.d.mts +569 -344
  8. package/dist/index.mjs +1 -1
  9. package/dist/instructions/CHANGELOG.md +2 -0
  10. package/dist/instructions/MIGRATION.md +2 -0
  11. package/dist/instructions/README.md +12 -4
  12. package/dist/instructions/booking.md +56 -40
  13. package/dist/instructions/quote.md +100 -6
  14. package/dist/instructions/search.md +99 -12
  15. package/dist/instructions/versions/2.12.0/CHANGELOG.md +56 -0
  16. package/dist/instructions/versions/2.12.0/MIGRATION.md +194 -0
  17. package/dist/instructions/versions/2.13.0/CHANGELOG.md +87 -0
  18. package/dist/instructions/versions/2.13.0/MIGRATION.md +315 -0
  19. package/dist/instructions/versions/2.5.0/MIGRATION.md +3 -0
  20. package/dist/{quote-Cs6jGoRS.mjs → quote-Qy_affum.mjs} +4 -4
  21. package/dist/{rentals-CFod9H4m.mjs → rentals-BG1diZoo.mjs} +7 -4
  22. package/dist/{search-QlZrI7ue.mjs → search-Byi6XboR.mjs} +39 -19
  23. package/dist/{to-rental-highlights-B6a_fi0j.mjs → to-rental-highlights-BVikT4Iz.mjs} +4 -2
  24. package/dist/translations/shared/de-DE/booking.json +7 -0
  25. package/dist/translations/shared/en-US/booking.json +7 -0
  26. package/instructions/CHANGELOG.md +2 -0
  27. package/instructions/MIGRATION.md +2 -0
  28. package/instructions/README.md +12 -4
  29. package/instructions/booking.md +56 -40
  30. package/instructions/quote.md +100 -6
  31. package/instructions/search.md +99 -12
  32. package/instructions/versions/2.12.0/CHANGELOG.md +56 -0
  33. package/instructions/versions/2.12.0/MIGRATION.md +194 -0
  34. package/instructions/versions/2.13.0/CHANGELOG.md +87 -0
  35. package/instructions/versions/2.13.0/MIGRATION.md +315 -0
  36. package/instructions/versions/2.5.0/MIGRATION.md +3 -0
  37. package/package.json +16 -13
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as ServiceBeonDataSchema, A as ErgoBookRequestSchema, At as quoteEffect, B as OnOfficeUnitSchema, C as DocumentResourceSchema, Ct as clearAdditionalServicesEffect, D as DocumentTypeSchema, Dt as getRentalsEffect, E as DocumentSummarySchema, Et as getInitialAvailabilityEffect, F as ErgoPolicyNumberRequestSchema, Ft as selectInsurancePaymentEffect, G as QuotePricesResponseSchema, H as PaymentScheduleSchema, I as ErgoReadPreContractRequestSchema, It as submitContactEffect, J as RawObjectResponseSchema, K as QuoteSchema, L as ErgoTripAndCustomerRequestSchema, Lt as submitPaymentOption, M as ErgoCreatePreContractRequestSchema, Mt as searchEffect, N as ErgoPersonSchema, Nt as selectCancellationPolicyEffect, O as ErgoAddressSchema, Ot as getStartDateSelectedAvailabilityEffect, P as ErgoPlanSearchRequestSchema, Pt as selectInsuranceEffect, Q as SearchPropertiesResponseSchema, R as FacilityListResponseSchema, Rt as submitPaymentOptionEffect, S as DocumentResourceResponseSchema, St as bookInsuranceEffect, T as DocumentStatusUpdateRequestSchema, Tt as getFiltersEffect, U as QuoteLineSchema, V as PaymentScheduleItemSchema, W as QuotePricesPayloadSchema, X as RegionListResponseSchema, Y as RawVofficeObjectSchema, Z as RoomImageSchema, _ as CalendarDaySchema, _t as V1_OPERATIONS, at as TileCollectionResponseSchema, b as CustomerUnitSummarySchema, bt as addAdditionalServiceEffect, c as V0OpenApiClient, ct as TravelInsuranceBookingSchema, d as makeV0OpenApiClientLive, dt as UnitListItemSchema, et as ServiceImageSchema, f as V1OpenApiClient, ft as UnitListResponseSchema, g as ApiEnvelopeBaseSchema, gt as V1_BASE_URL, h as makeV1OpenApiClientLive, ht as UnitServicePriceSchema, it as SetupResponseSchema, j as ErgoCommonFieldsSchema, jt as removeAdditionalServiceEffect, k as ErgoBankSchema, kt as getTermsAndPrivacyPolicyEffect, l as V0OpenApiClientError, lt as TravelInsuranceBookingStoreRequestSchema, m as makeV1OpenApiClientFetchLive, mt as UnitResponseSchema, nt as ServiceListResponseSchema, ot as TileSchema, p as V1OpenApiClientError, pt as UnitOfferSchema, q as QuoteServiceSchema, rt as SetupDataSchema, st as TileTagSchema, t as createWebsiteSDK, tt as ServiceLimitSchema, u as makeV0OpenApiClientFetchLive, ut as UnitIdsResponseSchema, v as CalendarResponseSchema, vt as VideoResponseSchema, w as DocumentStatusSchema, wt as createInsurancePreContractEffect, x as DocumentCollectionResponseSchema, xt as bookEffect, y as CurrentMemberResponseSchema, yt as decodeV1OperationResponse, z as OnOfficeUnitCollectionResponseSchema, zt as defineWebsiteSDKOptions } from "./client-DYAHnU5F.mjs";
1
+ import { $ as ServiceBeonDataSchema, A as ErgoBookRequestSchema, At as quoteEffect, B as OnOfficeUnitSchema, C as DocumentResourceSchema, Ct as clearAdditionalServicesEffect, D as DocumentTypeSchema, Dt as getRentalsEffect, E as DocumentSummarySchema, Et as getInitialAvailabilityEffect, F as ErgoPolicyNumberRequestSchema, Ft as selectInsurancePaymentEffect, G as QuotePricesResponseSchema, H as PaymentScheduleSchema, I as ErgoReadPreContractRequestSchema, It as submitContactEffect, J as RawObjectResponseSchema, K as QuoteSchema, L as ErgoTripAndCustomerRequestSchema, Lt as submitPaymentOption, M as ErgoCreatePreContractRequestSchema, Mt as searchEffect, N as ErgoPersonSchema, Nt as selectCancellationPolicyEffect, O as ErgoAddressSchema, Ot as getStartDateSelectedAvailabilityEffect, P as ErgoPlanSearchRequestSchema, Pt as selectInsuranceEffect, Q as SearchPropertiesResponseSchema, R as FacilityListResponseSchema, Rt as submitPaymentOptionEffect, S as DocumentResourceResponseSchema, St as bookInsuranceEffect, T as DocumentStatusUpdateRequestSchema, Tt as getFiltersEffect, U as QuoteLineSchema, V as PaymentScheduleItemSchema, W as QuotePricesPayloadSchema, X as RegionListResponseSchema, Y as RawVofficeObjectSchema, Z as RoomImageSchema, _ as CalendarDaySchema, _t as V1_OPERATIONS, at as TileCollectionResponseSchema, b as CustomerUnitSummarySchema, bt as addAdditionalServiceEffect, c as V0OpenApiClient, ct as TravelInsuranceBookingSchema, d as makeV0OpenApiClientLive, dt as UnitListItemSchema, et as ServiceImageSchema, f as V1OpenApiClient, ft as UnitListResponseSchema, g as ApiEnvelopeBaseSchema, gt as V1_BASE_URL, h as makeV1OpenApiClientLive, ht as UnitServicePriceSchema, it as SetupResponseSchema, j as ErgoCommonFieldsSchema, jt as removeAdditionalServiceEffect, k as ErgoBankSchema, kt as getTermsAndPrivacyPolicyEffect, l as V0OpenApiClientError, lt as TravelInsuranceBookingStoreRequestSchema, m as makeV1OpenApiClientFetchLive, mt as UnitResponseSchema, nt as ServiceListResponseSchema, ot as TileSchema, p as V1OpenApiClientError, pt as UnitOfferSchema, q as QuoteServiceSchema, rt as SetupDataSchema, st as TileTagSchema, t as createWebsiteSDK, tt as ServiceLimitSchema, u as makeV0OpenApiClientFetchLive, ut as UnitIdsResponseSchema, v as CalendarResponseSchema, vt as VideoResponseSchema, w as DocumentStatusSchema, wt as createInsurancePreContractEffect, x as DocumentCollectionResponseSchema, xt as bookEffect, y as CurrentMemberResponseSchema, yt as decodeV1OperationResponse, z as OnOfficeUnitCollectionResponseSchema, zt as defineWebsiteSDKOptions } from "./client-Ma0daa2H.mjs";
2
2
  import { AdditionalServiceLimitExceeded, CoreSDKError, CoreSDKError as CMSError, CustomAttributeCatalogSchema, GuestQuoteSchema, InvalidAdditionalServiceQuantity, LocaleSchema, SearchSearchFieldOrderBySchema, SearchSearchFieldSortSchema, SearchSearchInputSchema, SearchSearchOutputSchema, SearchSearchPriceSortSchema, SearchSearchRandomSortSchema, SearchSearchRatingSortSchema, SearchSearchSortSchema, SearchSortDirectionSchema, UnknownAdditionalService, defineCustomAttributes, defineCustomAttributesFromUnknown, fetchCustomAttributeCatalog, parseCustomAttributeCatalog, validateContactSubmitInput } from "@v-office/sdk-core";
3
3
  //#region codegen/v9/heuristic-generation/public-api.ts
4
4
  const customDataAttribute = (name) => name;
@@ -4,6 +4,8 @@ This file is the versioned changelog index for the website SDK instructions.
4
4
 
5
5
  ## Versions
6
6
 
7
+ - `versions/2.13.0/CHANGELOG.md`: `@v-office/website-sdk` 2.13.0 release notes.
8
+ - `versions/2.12.0/CHANGELOG.md`: `@v-office/website-sdk` 2.12.0 release notes.
7
9
  - `versions/2.11.0/CHANGELOG.md`: `@v-office/website-sdk` 2.11.0 release notes.
8
10
  - `versions/2.10.0/CHANGELOG.md`: `@v-office/website-sdk` 2.10.0 release notes.
9
11
  - `versions/2.9.0/CHANGELOG.md`: `@v-office/website-sdk` 2.9.0 release notes.
@@ -4,6 +4,8 @@ This file is the versioned migration index for the website SDK instructions.
4
4
 
5
5
  ## Available Guides
6
6
 
7
+ - `versions/2.13.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.12.0 to 2.13.0.
8
+ - `versions/2.12.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.11.0 to 2.12.0.
7
9
  - `versions/2.11.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.10.0 to 2.11.0.
8
10
  - `versions/2.10.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.9.0 to 2.10.0.
9
11
  - `versions/2.9.0/MIGRATION.md`: migrate from `@v-office/website-sdk` 2.8.0 to 2.9.0.
@@ -1,7 +1,7 @@
1
1
  # Website SDK Instructions
2
2
 
3
3
  These instructions describe the current source targeted for
4
- `@v-office/website-sdk` 2.11.0. Package versions remain unchanged until the release
4
+ `@v-office/website-sdk` 2.13.0. Package versions remain unchanged until the release
5
5
  workflow performs the coordinated core and website bumps.
6
6
 
7
7
  Use this directory as the consumer-facing reference for the package:
@@ -12,12 +12,18 @@ Use this directory as the consumer-facing reference for the package:
12
12
  - `custom-attributes.md`: custom attribute catalog, configuration, per-backend behaviour, and the v9-to-v10 move.
13
13
  - `search.md`: `sdk.live.search.search`.
14
14
  - `availability.md`: date-picker availability flows.
15
- - `quote.md`: quote, additional services, cancellation policy, and insurance flows.
15
+ - `quote.md`: quote booking-card modifiers, additional services, cancellation policy, and insurance flows.
16
16
  - `booking.md`: booking and payment option submission.
17
17
  - `contact.md`: contact submission.
18
18
  - `document-structured-json.md`: `sdk.static.documents.getTermsAndPrivacyPolicy` and structured document JSON rendering rules.
19
19
  - `CHANGELOG.md`: versioned changelog index.
20
20
  - `MIGRATION.md`: versioned migration index.
21
+ - `versions/2.13.0/`: 2.13.0 static search capability discovery, shared v9/v10
22
+ booking-payment output, corrected remaining-payment deadlines, opaque booking
23
+ credentials, and the 2.12.0-to-2.13.0 migration guide.
24
+ - `versions/2.12.0/`: 2.12.0 legacy-v9 search discounts, empty-query browsing,
25
+ and flexible-period rejection; quote booking-card cleanup; and v10 modifier
26
+ guidance, plus the 2.11.0-to-2.12.0 migration guide.
21
27
  - `versions/2.11.0/`: 2.11.0 search-discount release notes and
22
28
  2.10.0-to-2.11.0 migration guide.
23
29
  - `versions/2.10.0/`: 2.10.0 option-booking release notes and 2.9.0-to-2.10.0 migration guide.
@@ -39,7 +45,9 @@ Use this directory as the consumer-facing reference for the package:
39
45
  pnpm add @v-office/website-sdk
40
46
  ```
41
47
 
42
- The package is ESM-only and exports the root SDK facade from `@v-office/website-sdk`.
48
+ The package is ESM-only. It exports the SDK facade from `@v-office/website-sdk`
49
+ and instance-independent search capability helpers from
50
+ `@v-office/website-sdk/capabilities/search`.
43
51
 
44
52
  ## Quick Start
45
53
 
@@ -79,5 +87,5 @@ website-sdk --backend v10 search --locale de-DE --query "adults=2" --sort '{"by"
79
87
  ```
80
88
 
81
89
  Config file examples in these docs use the flat `WebsiteSDKConfig` shape introduced
82
- in 2.0.0 and kept in 2.11.0. v10 config additionally requires `searchEndpoint` as
90
+ in 2.0.0 and kept in 2.13.0. v10 config additionally requires `searchEndpoint` as
83
91
  of 2.5.0.
@@ -78,47 +78,63 @@ Sample:
78
78
  ```json
79
79
  {
80
80
  "bookingNumber": "B-2026-0001",
81
- "guestToken": "guest-token",
82
- "paymentSchedules": [
83
- {
84
- "label": "Deposit",
85
- "dueOn": "2026-06-15",
86
- "lines": [
87
- {
88
- "label": "Deposit",
89
- "amount": "300.00 EUR"
90
- }
91
- ],
92
- "total": "300.00 EUR",
93
- "paymentOptions": [
94
- {
95
- "kind": "bank_transfer",
96
- "label": "Bank transfer",
97
- "holder": "Example GmbH",
98
- "iban": "DE02120300000000202051",
99
- "swiftOrBic": "BYLADEM1001",
100
- "remittanceText": "B-2026-0001"
101
- },
102
- {
103
- "kind": "redirect",
104
- "provider": "adyen",
105
- "label": "Credit card",
106
- "url": "https://checkout.example.com"
107
- },
108
- {
109
- "kind": "stripe_checkout",
110
- "provider": "stripe",
111
- "label": "Credit card",
112
- "sessionId": "cs_live_a1Upmvi1v62AdILeDZl4l",
113
- "accountId": "acct_1MpAB7AFrTg9gw7b"
114
- }
115
- ]
116
- }
117
- ],
118
- "insurancePaymentOptions": []
81
+ "payment": {
82
+ "schedule": [
83
+ {
84
+ "kind": "prepayment",
85
+ "label": "Down payment",
86
+ "amount": "€76.00",
87
+ "dueOn": "Payable until August 19, 2026",
88
+ "paymentOptions": [
89
+ {
90
+ "kind": "bank_transfer",
91
+ "label": "Bank transfer",
92
+ "holder": "Example GmbH",
93
+ "iban": "DE02120300000000202051",
94
+ "swiftOrBic": "BYLADEM1001",
95
+ "remittanceText": "Booking number: B-2026-0001"
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "kind": "remaining_payment",
101
+ "label": "Remaining payment",
102
+ "amount": "€304.00",
103
+ "dueOn": "Payable until February 6, 2027"
104
+ }
105
+ ],
106
+ "alternatives": [
107
+ {
108
+ "kind": "full_amount",
109
+ "label": "Total payment",
110
+ "amount": "€380.00",
111
+ "paymentOptions": [
112
+ {
113
+ "kind": "bank_transfer",
114
+ "label": "Bank transfer",
115
+ "holder": "Example GmbH",
116
+ "iban": "DE02120300000000202051",
117
+ "swiftOrBic": "BYLADEM1001",
118
+ "remittanceText": "Booking number: B-2026-0001"
119
+ }
120
+ ]
121
+ }
122
+ ]
123
+ }
119
124
  }
120
125
  ```
121
126
 
127
+ `payment.schedule` contains the remaining contractual payment steps known to the backend. Its `kind` is one of `prepayment`, `remaining_payment`, `installment`, or `deposit`. `v9` emits named prepayment and remaining-payment steps; `v10` emits its backend-provided installment and deposit steps.
128
+
129
+ `payment.alternatives` contains ways to settle the complete outstanding balance. A `full_amount` alternative has no inferred deadline. `dueOn`, `paymentAt`, labels, amounts, and line amounts are already translated and formatted for the booking locale.
130
+
131
+ `paymentOptions` is present only when the SDK can currently perform that payment. Future or on-site steps remain visible without payment options.
132
+
133
+ An optional `insurancePaymentOptions` array is returned only when post-booking insurance payment is available.
134
+
135
+ Sites upgrading from 2.12.0 must replace the former `paymentSchedules` output. See
136
+ `versions/2.13.0/MIGRATION.md`.
137
+
122
138
  Payment option variants:
123
139
 
124
140
  - `bank_transfer`: display-only payment details.
@@ -153,13 +169,13 @@ try {
153
169
 
154
170
  Online payment providers return the guest to a URL derived from `relativeRedirectUrl`. Stripe returns to that path with `payment=stripe&success=true` after payment and `payment=stripe&cancel=true` after cancellation, so the path must exist in your site and should read those query parameters.
155
171
 
156
- `relativeRedirectUrl` is supplied before the reservation exists, so the return URL cannot carry the booking number or guest token. Persist whatever the return page needs, for example in `sessionStorage`, before submitting a payment option.
172
+ `relativeRedirectUrl` is supplied before the reservation exists, so the return URL cannot carry the booking number. Persist whatever the return page needs, for example in `sessionStorage`, before submitting a payment option.
157
173
 
158
174
  A successful return means the provider sent the browser back, not that the payment has settled. Confirmation reaches vOffice through the provider's webhook.
159
175
 
160
176
  ## Configuration
161
177
 
162
- Booking requests are rate-limited to one backend request per second with a queue size of five. `v9` books through the v0 `book` action and initializes one Stripe Checkout Session per payment schedule option when the property has Stripe enabled. `v10` books through GraphQL and initializes Adyen redirect payment options.
178
+ Booking requests are rate-limited to one backend request per second with a queue size of five. `v9` books through the v0 `book` action and initializes Stripe only for currently payable choices when the property has Stripe enabled. `v10` books through GraphQL, preserves all remaining payment steps for display, and initializes Adyen for the next payable online step and the full-outstanding alternative.
163
179
 
164
180
  ## CLI Usage
165
181
 
@@ -62,13 +62,13 @@ Sample:
62
62
  ```
63
63
 
64
64
  Dates are local dates formatted as `YYYY-MM-DD`. For `v9`, `rentalId` must be a numeric vOffice unit id.
65
- Both backends accept `voucher` on quote and booking flows. `v10` can expose voucher discounts as booking-card modifiers when the backend returns voucher modifiers; `v9` reflects voucher effects in the quoted totals but does not expose a separate voucher modifier line.
65
+ Both backends accept `voucher` on quote and booking flows. On `v10`, applied voucher and non-voucher modifiers can be exposed through the booking-card fields described below. `v9` reflects voucher effects in quoted totals but does not expose booking-card modifier details.
66
66
 
67
67
  ## Output
68
68
 
69
69
  Returns `Promise<GuestQuoteResult>`.
70
70
 
71
- Available sample:
71
+ Available sample without modifiers:
72
72
 
73
73
  ```json
74
74
  {
@@ -139,6 +139,94 @@ Unavailable sample:
139
139
 
140
140
  Selection methods return `{ ok: true, quote }` or `{ ok: false, error }`. Possible selection errors include unknown additional service, additional service limit exceeded, unknown cancellation policy, unavailable cancellation policy quote, and unavailable quote combination.
141
141
 
142
+ ## Booking-Card Breakdown
143
+
144
+ Booking-card sections are returned in display order. On both v9 and v10, the SDK
145
+ omits numeric zero-value lines without subitems from the included, tax, and other
146
+ breakdown sections. If no lines remain in a section, the section is omitted.
147
+ Non-zero lines are unchanged, including when they share an `other` section with a
148
+ filtered zero-value line.
149
+
150
+ A zero-total line with subitems can remain because those subitems carry
151
+ descriptive content. Do not use the absence or presence of a zero-value price row
152
+ as service-selection state; use the quote's explicit service or selection data.
153
+
154
+ ### Modifiers and Pre-Modifier Totals
155
+
156
+ On `v10`, a booking-card item at
157
+ `bookingCardInformation.sections[].lines[].item` can include these optional
158
+ fields:
159
+
160
+ ```ts
161
+ {
162
+ modifiers?: readonly {
163
+ label: string;
164
+ amount: string;
165
+ }[];
166
+ totalBeforeModifiers?: string;
167
+ }
168
+ ```
169
+
170
+ `modifiers` contains localized, formatted adjustments applied to that item. A
171
+ negative amount represents a deduction and a positive amount represents a
172
+ surcharge. The SDK groups backend modifiers with the same label and formats their
173
+ summed amount as one entry. The field is omitted when the item has no modifiers.
174
+
175
+ `item.totalBeforeModifiers` is the formatted item amount before its modifiers. It
176
+ is present when the item has a non-zero net modifier effect and the amount can be
177
+ derived; otherwise it is omitted. `item.appliedCharge` remains the final amount
178
+ after modifiers.
179
+
180
+ The booking card itself can also include
181
+ `bookingCardInformation.totalBeforeModifiers`. It is the formatted whole-card
182
+ total before all backend modifiers and is present when those modifiers have a
183
+ non-zero net effect. It is omitted when there are no modifiers or their amounts
184
+ net to zero. The SDK derives quote pre-modifier totals from the final amounts and
185
+ modifier values.
186
+
187
+ Items in the included, tax, and other sections carry their adjustments in
188
+ `item.modifiers`; do not expect those adjustments to be separate section lines.
189
+ Negative modifiers on backend lines that cannot be mapped to those sections may
190
+ instead appear as dedicated booking-card lines. `v9` quote cards omit
191
+ `modifiers` and both `totalBeforeModifiers` fields.
192
+
193
+ Discounted `v10` example for locale `de-DE`:
194
+
195
+ ```json
196
+ {
197
+ "bookingCardInformation": {
198
+ "sections": [
199
+ {
200
+ "lines": [
201
+ {
202
+ "item": {
203
+ "position": "Inklusivpreis",
204
+ "appliedCharge": "1.554,00 €",
205
+ "modifiers": [
206
+ {
207
+ "label": "Frühbucher/Last-Minute",
208
+ "amount": "-140,00 €"
209
+ }
210
+ ],
211
+ "totalBeforeModifiers": "1.694,00 €"
212
+ }
213
+ }
214
+ ]
215
+ }
216
+ ],
217
+ "total": "1.596,70 €",
218
+ "totalBeforeModifiers": "1.736,70 €"
219
+ }
220
+ }
221
+ ```
222
+
223
+ For a price breakdown that keeps its arithmetic visible, render
224
+ `totalBeforeModifiers` as the pre-modifier amount, show each modifier as an
225
+ adjustment row, and use `appliedCharge` or `total` as the resulting final amount.
226
+ The SDK supplies formatted values but does not decide whether a reference price
227
+ should be displayed or struck through; that presentation and its legal
228
+ requirements remain the consuming site's responsibility.
229
+
142
230
  ## Vouchers
143
231
 
144
232
  When `voucher` is provided in the quote input, an available quote may include `quote.voucher`:
@@ -153,7 +241,11 @@ When `voucher` is provided in the quote input, an available quote may include `q
153
241
 
154
242
  `status` is `"applied"`, `"not_applied"`, or `"unknown"`. `v10` reports `"applied"` when the backend returns a non-zero voucher modifier and `"not_applied"` when no voucher modifier is returned for the requested voucher. `v9` returns `"unknown"` for available voucher quotes because the legacy response does not provide a reliable voucher modifier signal.
155
243
 
156
- Voucher modifiers can appear in `bookingCardInformation.sections`. Sections are returned in display order.
244
+ Do not assume an applied voucher appears as its own section line. On `v10`, a
245
+ voucher adjustment on an included, tax, or other line appears in that line's
246
+ `item.modifiers`; an unmapped negative modifier can appear as a dedicated line.
247
+ Use `quote.voucher.status` for voucher application status and the booking-card
248
+ fields for price presentation.
157
249
 
158
250
  ## Additional Services
159
251
 
@@ -301,16 +393,18 @@ quote = await sdk.live.quote.selectInsurancePayment({
301
393
  });
302
394
  ```
303
395
 
304
- After the rental booking is created, complete insurance booking with the booking number and guest token:
396
+ After the rental booking is created, complete insurance booking with the opaque booking result. Keep the live result object; its private backend credentials are intentionally not serialized:
305
397
 
306
398
  ```ts
307
399
  const insuranceBooking = await sdk.live.quote.bookInsurance({
308
400
  quote,
309
- bookingNumber: booking.bookingNumber,
310
- guestToken: booking.guestToken,
401
+ booking,
311
402
  });
312
403
  ```
313
404
 
405
+ This is a breaking change in 2.13.0. The former public `guestToken` input is no
406
+ longer used; see `versions/2.13.0/MIGRATION.md`.
407
+
314
408
  `v9` supports real insurance option refresh, pre-contract, payment selection, and booking. `v10` currently returns a no-insurance placeholder and insurance actions resolve as not required.
315
409
 
316
410
  ## Configuration
@@ -77,6 +77,28 @@ Common stable query keys:
77
77
  - Occupancy: `adults`, `children`, `childrenAges`, `babies`, `pets`, `petsCount`.
78
78
  - Filters: use `searchParameterQueryKey` values from `sdk.static.filter.getFilters(...)`.
79
79
 
80
+ ### Static Backend Capabilities
81
+
82
+ Search capabilities that only depend on a backend name are available without
83
+ constructing an SDK:
84
+
85
+ ```ts
86
+ import {
87
+ getSupportedPeriodQueryKeys,
88
+ supportsFlexiblePeriodSearch,
89
+ } from "@v-office/website-sdk/capabilities/search";
90
+
91
+ supportsFlexiblePeriodSearch("v9"); // false
92
+ supportsFlexiblePeriodSearch("v10"); // true
93
+
94
+ getSupportedPeriodQueryKeys("v9").has("month"); // false
95
+ getSupportedPeriodQueryKeys("v10").has("month"); // true
96
+ ```
97
+
98
+ The returned read-only set contains the stable period query keys accepted by the
99
+ selected backend, including aliases such as `from` and `till`. Key support does
100
+ not replace validation of complete query combinations.
101
+
80
102
  ## Query Structure
81
103
 
82
104
  The `query` field is a URL query-string style value without a leading `?`.
@@ -87,17 +109,38 @@ Use `&` to combine period, occupancy, and filter parameters:
87
109
  "start=20-06-2026&end=27-06-2026&adults=2&wifi";
88
110
  ```
89
111
 
112
+ ### Empty Queries
113
+
114
+ On v9, an empty query returns the first page of searchable inventory under the
115
+ configured rental scope:
116
+
117
+ ```ts
118
+ await sdk.live.search.search({
119
+ locale: "de-DE",
120
+ query: "",
121
+ });
122
+ ```
123
+
124
+ The v9 facade serializes an empty backend-filter set as GraphQL `data: null`.
125
+ Pagination and the configured `limit` still apply; an undated query does not
126
+ assert availability for a particular stay.
127
+
90
128
  ### Period Queries
91
129
 
92
130
  Use one supported period structure per query.
93
131
 
94
- Exact period search:
132
+ Fixed-period search is supported by both v9 and v10:
95
133
 
96
134
  ```ts
97
135
  "start=20-06-2026&end=27-06-2026";
98
136
  ```
99
137
 
100
- Flexible search by month:
138
+ Flexible-period search is supported by v10 only. Legacy v9 rejects the `month`,
139
+ `dates`, `nights`, and `weekend` keys before transport instead of silently
140
+ returning an unpriced item list. Keep the flexible selector unavailable on v9
141
+ sites and use `start` plus `end` for a fixed-period search.
142
+
143
+ Flexible v10 search by month:
101
144
 
102
145
  ```ts
103
146
  "month=06-2026&nights=7";
@@ -106,7 +149,7 @@ Flexible search by month:
106
149
  "month=06-2026&month=07-2026&weekend";
107
150
  ```
108
151
 
109
- Flexible search by exact date tuples:
152
+ Flexible v10 search by exact date tuples:
110
153
 
111
154
  ```ts
112
155
  "dates=20-06-2026,22-06-2026&nights=2";
@@ -134,6 +177,9 @@ Boolean filters can be provided as presence-only flags when supported:
134
177
 
135
178
  ### Invalid Combinations
136
179
 
180
+ The following flexible-query validation rules apply to v10. Legacy v9 rejects
181
+ every flexible-period key as described above.
182
+
137
183
  Do not mix exact period search with flexible period options:
138
184
 
139
185
  ```ts
@@ -155,7 +201,7 @@ Flexible queries require either `nights` or `weekend`, but not both:
155
201
  "month=06-2026&nights=7&weekend";
156
202
  ```
157
203
 
158
- Dates should use `DD-MM-YYYY`; months should use `MM-YYYY`.
204
+ Flexible date tuples accept `DD-MM-YYYY` and `YYYY-MM-DD`; months use `MM-YYYY`.
159
205
 
160
206
  Use `rentalIdsIn` to restrict results to specific rental IDs. This option is currently supported by `v10` only.
161
207
  Use `voucher` to price v10 search results with a voucher code. This option is currently supported by `v10` only.
@@ -349,17 +395,58 @@ the expanded leaf entries. A UI may collapse those leaves under the composition
349
395
  display, but should keep the returned keys and canonical values when removing direct
350
396
  filters.
351
397
 
352
- ## v10 Backend
398
+ ## Backend Behavior
399
+
400
+ ### v10
353
401
 
354
- v10 search runs against the dedicated REST search backend (`POST` to the configured `searchEndpoint`). Existing calls and the output type remain compatible, while the input additionally supports optional sorting. v10 results reflect the REST projection:
402
+ v10 search runs against the dedicated REST search backend (`POST` to the configured
403
+ `searchEndpoint`). Existing calls and the output type remain compatible, while the
404
+ input additionally supports optional sorting. v10 results reflect the REST
405
+ projection:
355
406
 
356
407
  - At most five images per item, and no image `category`.
357
- - `property` is the minimal `{ id, nameOrLabel }` shape. Hydrate `property.location`, `property.images`, or `property.address` from `sdk.static.rentals.getRentals(...)` when a card needs them.
358
- - Custom-attribute search filters and highlights require the `customAttributes` registry. A definition with no catalog ID cannot be executed, so its query key is left in `unusedFilterKeys`. v9 never executes a custom-attribute filter at all. See `custom-attributes.md`.
359
- - Fixed-period and flexible searches are priced by the REST backend and require occupancy.
360
- - Priced items and alternative periods may include localized `discount` details when the REST backend returns them. Legacy v9 search does not populate this field.
361
- - Search inputs are unchanged. The SDK keeps alternative-cancellation-policy pricing out of search; cancellation-policy selection remains part of the quote and booking flow.
362
- - Pagination uses the backend `from`/`size` window behind the same opaque `cursor`, capped at 1,000 results.
408
+ - `property` is the minimal `{ id, nameOrLabel }` shape. Hydrate
409
+ `property.location`, `property.images`, or `property.address` from
410
+ `sdk.static.rentals.getRentals(...)` when a card needs them.
411
+ - Custom-attribute search filters and highlights require the `customAttributes`
412
+ registry. A definition with no catalog ID cannot be executed, so its query key
413
+ is left in `unusedFilterKeys`. See `custom-attributes.md`.
414
+ - Fixed-period and flexible searches are priced by the REST backend and require
415
+ occupancy.
416
+ - Priced items and alternative periods may include localized `discount` details
417
+ with multiple applied modifiers when the REST backend returns them.
418
+ - The v10 public search input shape is unchanged. The SDK keeps
419
+ alternative-cancellation-policy
420
+ pricing out of search; cancellation-policy selection remains part of the quote
421
+ and booking flow.
422
+ - Pagination uses the backend `from`/`size` window behind the same opaque `cursor`,
423
+ capped at 1,000 results.
424
+
425
+ ### Legacy v9
426
+
427
+ Legacy v9 maps its aggregated search calculation into the shared price and discount
428
+ shape:
429
+
430
+ - Flexible-period keys (`month`, `dates`, `nights`, and `weekend`) are rejected
431
+ before transport. v9 sites must use a fixed `start`/`end` period.
432
+ - Empty basic-filter sets are sent as GraphQL `data: null`, allowing an empty
433
+ query to browse the scoped searchable inventory without a dummy occupancy
434
+ value.
435
+ - `calc.total` becomes `formattedTotal`.
436
+ - `discount` is included only when `calc.oTotal` is greater than `calc.total`.
437
+ - `calc.oTotal` becomes `discount.formattedOriginalTotal`.
438
+ - A non-empty `calc.discountName` becomes the label of the single `applied` entry.
439
+ - The applied amount is the formatted negative difference
440
+ `calc.total - calc.oTotal`.
441
+ - Missing discount names produce an empty `applied` array without discarding the
442
+ formatted original total.
443
+ - The same mapping applies to exact-period items and individual alternative
444
+ periods.
445
+ - v9 never executes a custom-attribute search filter.
446
+
447
+ The field is omitted when v9 returns no final total or when its original total is
448
+ not greater than the final total. v9 exposes at most one aggregated applied entry,
449
+ whereas v10 can expose multiple detailed modifiers.
363
450
 
364
451
  ## Configuration
365
452
 
@@ -0,0 +1,56 @@
1
+ # Changelog: 2.12.0
2
+
3
+ This release extends the optional search discount output introduced in 2.11.0 to
4
+ legacy v9 search results, keeps zero-value lines out of quote booking-card
5
+ breakdowns, and completes v10 card-level pre-modifier totals across all modifier
6
+ presentation paths. It also rejects unsupported v9 flexible-period searches before
7
+ transport and restores empty-query inventory browsing on v9.
8
+
9
+ ## Added
10
+
11
+ - Priced legacy v9 exact-period items may include the shared optional `discount`
12
+ output.
13
+ - Individual legacy v9 alternative periods expose the same optional discount
14
+ shape.
15
+ - v9 maps its aggregated original total and discount name into
16
+ `formattedOriginalTotal` and at most one localized `applied` entry.
17
+
18
+ ## Changed
19
+
20
+ - Legacy v9 search now rejects the unsupported flexible-period query keys
21
+ `month`, `dates`, `nights`, and `weekend` before transport instead of silently
22
+ returning an unpriced item list. Fixed `start`/`end` searches are unchanged.
23
+ - Legacy v9 search serializes an empty backend-filter set as GraphQL `data: null`
24
+ instead of `data: []`. Empty queries can therefore browse searchable inventory
25
+ without seeding a dummy occupancy value.
26
+ - When a v9 discount is present, `formattedTotal` remains the final price and the
27
+ applied amount is the formatted difference from the original total.
28
+ - v10 search discount behavior is unchanged from 2.11.0 and can continue to expose
29
+ multiple applied modifiers.
30
+ - Quote booking cards now omit zero-value lines without subitems from the `other`
31
+ section on both v10 and legacy v9, matching the existing empty-line behavior of
32
+ the included and tax sections.
33
+ - If an `other` section contains both zero-value and non-zero lines, only the
34
+ non-zero lines remain. The section is omitted when no lines remain.
35
+ - v10 derives card-level `totalBeforeModifiers` from all backend modifiers,
36
+ including negative modifiers rendered as dedicated booking-card lines.
37
+ - Booking-card items omit the optional `modifiers` field when no modifier entries
38
+ are present instead of producing `modifiers: []`.
39
+
40
+ ## Migration Impact
41
+
42
+ - Existing supported search calls require no changes because `discount` remains
43
+ optional. v9 sites must keep flexible search unavailable and use `start`/`end`
44
+ period queries.
45
+ - v9 sites that inject `adults=1` only to make an empty query return results
46
+ should remove that workaround. Real occupancy filters remain supported.
47
+ - Search configuration, the public input type, and the discount schema are
48
+ unchanged. Runtime validation is stricter for unsupported v9 flexible-period
49
+ keys.
50
+ - Cross-backend sites can use one discount renderer for v9 and v10, while allowing
51
+ v9 to return at most one applied entry.
52
+ - Quote inputs and booking-card types are unchanged. Consumers may receive fewer
53
+ booking-card lines and may now receive the existing optional card-level
54
+ `totalBeforeModifiers` in additional v10 modifier cases. Do not rely on
55
+ zero-value rows to represent declined services.
56
+ - See `versions/2.12.0/MIGRATION.md`, `../../search.md`, and `../../quote.md`.