@v-office/website-sdk 2.24.1 → 2.26.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.
- package/dist/cli.mjs +89 -2
- package/dist/{client-DC4LG3CP.mjs → client--T_tQSjV.mjs} +237 -70
- package/dist/index.d.mts +22 -5
- package/dist/index.mjs +1 -1
- package/dist/instructions/CHANGELOG.md +2 -0
- package/dist/instructions/MIGRATION.md +2 -0
- package/dist/instructions/README.md +1 -1
- package/dist/instructions/creation.md +5 -0
- package/dist/instructions/rentals.md +75 -0
- package/dist/instructions/search.md +48 -3
- package/dist/instructions/versions/2.25.0/CHANGELOG.md +41 -0
- package/dist/instructions/versions/2.25.0/MIGRATION.md +64 -0
- package/dist/instructions/versions/2.26.0/CHANGELOG.md +33 -0
- package/dist/instructions/versions/2.26.0/MIGRATION.md +31 -0
- package/dist/{to-rental-highlights-C1NF2uuE.mjs → operations-DwURbo0b.mjs} +1 -626
- package/dist/{rentals-eqFhtCdT.mjs → rentals-D4wmqjzL.mjs} +96 -33
- package/dist/{search-CKL-8T8q.mjs → search-DtBtzIGf.mjs} +5 -4
- package/dist/to-rental-highlights-BL5m3Uen.mjs +626 -0
- package/dist/translations/v9/de-DE/core.json +3 -1
- package/dist/translations/v9/en-US/core.json +3 -1
- package/dist/{v9-data-BnYxa2Ek.mjs → v9-data-C3SWtDGs.mjs} +7 -5
- package/instructions/CHANGELOG.md +2 -0
- package/instructions/MIGRATION.md +2 -0
- package/instructions/README.md +1 -1
- package/instructions/creation.md +5 -0
- package/instructions/rentals.md +75 -0
- package/instructions/search.md +48 -3
- package/instructions/versions/2.25.0/CHANGELOG.md +41 -0
- package/instructions/versions/2.25.0/MIGRATION.md +64 -0
- package/instructions/versions/2.25.0/release.json +3 -0
- package/instructions/versions/2.26.0/CHANGELOG.md +33 -0
- package/instructions/versions/2.26.0/MIGRATION.md +31 -0
- package/instructions/versions/2.26.0/release.json +3 -0
- package/package.json +2 -2
package/instructions/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Use this directory as the consumer-facing reference for the package:
|
|
|
10
10
|
- `rentals.md`: `sdk.static.rentals.getRentals`.
|
|
11
11
|
- `filter.md`: `sdk.static.filter.getFilters`.
|
|
12
12
|
- `custom-attributes.md`: custom attribute catalog, configuration, per-backend behaviour, and the v9-to-v10 move.
|
|
13
|
-
- `search.md`: `sdk.live.search.search`.
|
|
13
|
+
- `search.md`: `sdk.live.search.search` and, on v9, `sdk.live.search.searchPages`.
|
|
14
14
|
- `availability.md`: date-picker availability flows.
|
|
15
15
|
- `quote.md`: quote booking-card modifiers, additional services, cancellation policy, and insurance flows.
|
|
16
16
|
- `booking.md`: booking, payment option submission, and
|
package/instructions/creation.md
CHANGED
|
@@ -105,6 +105,7 @@ type WebsiteSDKOptions = {
|
|
|
105
105
|
translationOverrides?: TranslationOverrides;
|
|
106
106
|
customAttributes?: CustomAttributeRegistrySnapshot;
|
|
107
107
|
v9PropertyHighlightSources?: V9PropertyHighlightSourceRegistry;
|
|
108
|
+
v9Reviews?: V9ReviewsOptions;
|
|
108
109
|
customAttributeFilterDefinitions?: readonly CustomAttributeFilterDefinition[];
|
|
109
110
|
rentalHighlightPrioritization?: readonly RentalHighlightPrioritizationKey[];
|
|
110
111
|
rentalPropertyHighlightPrioritization?: readonly RentalPropertyHighlightPrioritizationKey[];
|
|
@@ -114,6 +115,10 @@ type WebsiteSDKOptions = {
|
|
|
114
115
|
};
|
|
115
116
|
```
|
|
116
117
|
|
|
118
|
+
`v9Reviews` configures v9 review criteria, whether a v9 review's author shows the
|
|
119
|
+
guest's city, and which incomplete v9 feedbacks become review items. v10 does not use it, but an invalid value fails SDK creation on
|
|
120
|
+
both backends. See "Legacy v9 Reviews" in `rentals.md`.
|
|
121
|
+
|
|
117
122
|
`searchAllRentalsAtOnce` selects how a site searches, on v9 and v10 alike: every
|
|
118
123
|
result with prices in one call (portfolios of up to 100 rentals), or paged results
|
|
119
124
|
plus `mapSearch`. See `search.md`.
|
package/instructions/rentals.md
CHANGED
|
@@ -344,6 +344,81 @@ For v10, public answers with the same form-response ID are combined into one rev
|
|
|
344
344
|
|
|
345
345
|
`createdAt` is the form response's creation timestamp, not a travel date. A text-only rental can have `reviews.items` without `reviews.summary`, so check the summary independently. The localized `summary.count` describes form responses with valid ratings and does not necessarily equal `items.length`.
|
|
346
346
|
|
|
347
|
+
### Legacy v9 Reviews
|
|
348
|
+
|
|
349
|
+
v9 feedbacks carry an overall `avgRating`, a free `text`, and one field per
|
|
350
|
+
review criterion, `fb_<id>`. The criteria are tenant specific: every agency
|
|
351
|
+
defines its own in vOffice, so their IDs, number and labels differ per site, and
|
|
352
|
+
vOffice provides no labels. Configure them per site with `v9Reviews`:
|
|
353
|
+
|
|
354
|
+
```ts
|
|
355
|
+
const options = {
|
|
356
|
+
v9Reviews: {
|
|
357
|
+
criteria: [
|
|
358
|
+
{ v9: "fb_8748", type: "stars", label: { "de-DE": "Sauberkeit", "en-US": "Cleanliness" } },
|
|
359
|
+
{ v9: "fb_8749", type: "stars", label: { "de-DE": "Lage", "en-US": "Location" } },
|
|
360
|
+
{ v9: "fb_9415", type: "text", label: { "de-DE": "Anmerkung", "en-US": "Note" } },
|
|
361
|
+
],
|
|
362
|
+
showAuthorCity: false,
|
|
363
|
+
includeItemsWithoutText: false,
|
|
364
|
+
includeItemsWithoutRating: false,
|
|
365
|
+
},
|
|
366
|
+
};
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
- A `stars` criterion becomes an entry of `reviews.summary.categories`, in the
|
|
370
|
+
configured order, with the `label` of the requested locale and the mean of its
|
|
371
|
+
ratings from 1 to 5 (`0` means not rated and does not count). A criterion that
|
|
372
|
+
no included feedback of a rental rated is left out, so a rental shows only the
|
|
373
|
+
criteria it has.
|
|
374
|
+
- A `text` criterion is appended to the review item's `text`: the feedback text
|
|
375
|
+
first, then each answered text criterion as its label and the answer on the
|
|
376
|
+
next line, separated by blank lines.
|
|
377
|
+
- Without `criteria`, `summary.categories` stays empty.
|
|
378
|
+
|
|
379
|
+
Every criterion needs a non-empty label for `de-DE` and `en-US`, a positive
|
|
380
|
+
`fb_<id>`, and a `type` of `stars` or `text`. Invalid options fail SDK creation
|
|
381
|
+
with every issue listed.
|
|
382
|
+
|
|
383
|
+
Review criteria are optional. Without them the site keeps the overall rating,
|
|
384
|
+
the review count and the review items. When you work on reviews for a v9 site,
|
|
385
|
+
offer the criteria to the site owner as an option. Do not ask for them as a
|
|
386
|
+
required step, and do not block other work on the answer. If the owner wants
|
|
387
|
+
them, ask which criteria to show and what they are called. To find the IDs, run
|
|
388
|
+
the CLI against the site's v9 config:
|
|
389
|
+
|
|
390
|
+
```sh
|
|
391
|
+
website-sdk --backend v9 review-criteria
|
|
392
|
+
website-sdk --backend v9 review-criteria --rental-ids 212350,212351
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
It reads the `fb_<id>` fields vOffice returns for the five units with the most
|
|
396
|
+
feedbacks, or for the listed units, and prints each ID with its type and the
|
|
397
|
+
units that have it. vOffice returns averages there only for `stars` criteria, so
|
|
398
|
+
a `text` criterion usually does not appear and its ID must come from the site
|
|
399
|
+
owner. Units vOffice cannot load are listed under `skippedRentalIds`.
|
|
400
|
+
|
|
401
|
+
A v9 review item's `author` is the guest's forename only. The SDK does not
|
|
402
|
+
request the surname. Without a forename the author is `reviews.item.guest`
|
|
403
|
+
("Gast", "Guest"). With `showAuthorCity: true` the guest's city follows, through
|
|
404
|
+
`reviews.item.authorWithCity` ("Anna aus Hamburg", "Guest from Hamburg"); a
|
|
405
|
+
feedback without a city keeps the name alone. Both keys can be changed with
|
|
406
|
+
`translationOverrides`.
|
|
407
|
+
|
|
408
|
+
By default a v9 feedback becomes a review item only when it has an `avgRating`
|
|
409
|
+
of at least 1 and text. The two switches include feedbacks that miss one of
|
|
410
|
+
these:
|
|
411
|
+
|
|
412
|
+
| Switch | When `true` |
|
|
413
|
+
| --------------------------- | ------------------------------------------------------------------------ |
|
|
414
|
+
| `includeItemsWithoutText` | a rated feedback without text becomes an item with `rating` only |
|
|
415
|
+
| `includeItemsWithoutRating` | a feedback with text but no `avgRating` becomes an item with `text` only |
|
|
416
|
+
|
|
417
|
+
A feedback with neither rating nor text is never an item. `summary.rating` and
|
|
418
|
+
`summary.count` cover the included items with a rating, and `summary.categories`
|
|
419
|
+
covers the included items. When no included item has a rating, `reviews` has
|
|
420
|
+
`items` and no `summary`. A text answer to a `text` criterion counts as text.
|
|
421
|
+
|
|
347
422
|
## Configuration
|
|
348
423
|
|
|
349
424
|
`v9` config:
|
package/instructions/search.md
CHANGED
|
@@ -207,7 +207,49 @@ Use `rentalIdsIn` to restrict results to specific rental IDs. This option is cur
|
|
|
207
207
|
Use `voucher` to price v10 search results with a voucher code. This option is currently supported by `v10` only.
|
|
208
208
|
For v10, `pets` is a mapped BooleanFilter exposed by `getFilters` and maps to one pet; use `petsCount` for an exact count and do not send both keys in one query.
|
|
209
209
|
|
|
210
|
-
`limit` defaults to `20`. Treat `cursor` as opaque and pass back `pageInfo.nextCursor` unchanged
|
|
210
|
+
`limit` defaults to `20`. Treat `cursor` as opaque and pass back `pageInfo.nextCursor` unchanged,
|
|
211
|
+
with the same `limit` as the call that returned it: the cursor points into pages of that size.
|
|
212
|
+
|
|
213
|
+
### v9: at most 128 priced results per request
|
|
214
|
+
|
|
215
|
+
The v9 hub prices at most the first 128 results of one request. It answers a larger
|
|
216
|
+
`limit` without an error, but every result past position 128 comes back without
|
|
217
|
+
`formattedTotal` and without `discount`. The SDK handles this for you:
|
|
218
|
+
|
|
219
|
+
- `limit` up to 128: one request, as before.
|
|
220
|
+
- `limit` above 128: the SDK splits the call into hub requests of 128 each, up to
|
|
221
|
+
eight of them in parallel. The promise resolves once every request has answered,
|
|
222
|
+
with all results merged and priced. `search({ limit: 1500 })` is one unpriced
|
|
223
|
+
count request plus up to 13 priced requests of 128 (12 for the first page; later
|
|
224
|
+
pages start mid-way into a hub page) and returns up to 1,500 priced results. If a
|
|
225
|
+
booking shifts the results while the requests run, the SDK fetches the call once
|
|
226
|
+
more. `pageInfo` and `nextCursor` behave as for any other `limit`. For the search
|
|
227
|
+
rate limit the whole call counts as one request.
|
|
228
|
+
|
|
229
|
+
To show the first results while the rest still loads, use `searchPages` (v9 only). It
|
|
230
|
+
yields the search page by page, 128 priced results per page, and ends after the last
|
|
231
|
+
page:
|
|
232
|
+
|
|
233
|
+
```ts
|
|
234
|
+
for await (const page of sdk.live.search.searchPages({ locale: "de-DE", query })) {
|
|
235
|
+
renderCards(page.items, page.alternatives);
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
- An SDK whose config can be v9 or v10 has `searchPages` only after
|
|
240
|
+
`if (sdk.backend === "v9")`.
|
|
241
|
+
- The input is the `search` input without `cursor` and `limit`; the SDK pages itself.
|
|
242
|
+
- Every page is one `search` call and counts as one request for the rate limit, so
|
|
243
|
+
the SDK starts at most one page per second.
|
|
244
|
+
- A rental appears on one page only, even when a booking moves it between two pages.
|
|
245
|
+
- Each page carries its own `pageInfo`; `pageInfo.totalCount` is the total over all
|
|
246
|
+
pages.
|
|
247
|
+
- Not available with `searchAllRentalsAtOnce: true`; the loop then rejects with a
|
|
248
|
+
`CoreSDKError` whose `operation` is `search.searchPages`.
|
|
249
|
+
|
|
250
|
+
Use `search` with a large `limit` when the page needs every result before it renders
|
|
251
|
+
(a sorted list, a map with prices). Use `searchPages` when the first cards should
|
|
252
|
+
appear before the last page is priced.
|
|
211
253
|
|
|
212
254
|
## Sorting
|
|
213
255
|
|
|
@@ -486,7 +528,8 @@ if (map.totalCount <= SEARCH_ALL_RENTALS_AT_ONCE_MAX_RESULTS) {
|
|
|
486
528
|
}
|
|
487
529
|
```
|
|
488
530
|
|
|
489
|
-
In this mode a `search` call is one backend request, whatever its `limit
|
|
531
|
+
In this mode a `search` call is one backend request, whatever its `limit`, except on
|
|
532
|
+
v9 above a `limit` of 128 (see [v9: at most 128 priced results per request](#v9-at-most-128-priced-results-per-request)).
|
|
490
533
|
|
|
491
534
|
### How each backend does it
|
|
492
535
|
|
|
@@ -497,7 +540,9 @@ In this mode a `search` call is one backend request, whatever its `limit`.
|
|
|
497
540
|
requested. When a booking between the requests moves rentals across page
|
|
498
541
|
boundaries, the pages disagree with the count; the SDK then asks for all results in
|
|
499
542
|
one request, a consistent snapshot, instead of returning a set with a gap. `mapSearch` selects no prices and loads up to 1,000 matches per request,
|
|
500
|
-
as many requests as the matches need.
|
|
543
|
+
as many requests as the matches need. A paged `search` above a `limit` of 128 counts
|
|
544
|
+
the matches without prices first, then fetches the window as requests of 128, at
|
|
545
|
+
most eight at a time.
|
|
501
546
|
- v10 answers the whole result set in one request. `searchAllRentalsAtOnce` asks for
|
|
502
547
|
101 results and refuses the search when the response total is above 100.
|
|
503
548
|
`mapSearch` is one request without prices that returns only the location, for up
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Changelog: 2.25.0
|
|
2
|
+
|
|
3
|
+
A v9 site can show ratings per review criterion on the rental page (cleanliness, location, …),
|
|
4
|
+
and decide which incomplete v9 feedbacks become review items. Every v9 agency defines its own
|
|
5
|
+
criteria, so their IDs and names differ per site: the site configures them. v9 reviews no
|
|
6
|
+
longer show the guest's surname.
|
|
7
|
+
|
|
8
|
+
## Added
|
|
9
|
+
|
|
10
|
+
- `v9Reviews` option for v9 sites. `criteria` lists the agency's `fb_<id>` criteria in display
|
|
11
|
+
order, each with `type` (`"stars"` or `"text"`) and a label for `de-DE` and `en-US`.
|
|
12
|
+
- A `stars` criterion becomes an entry of `reviews.summary.categories` (`{ label, rating }`):
|
|
13
|
+
the mean of its ratings from 1 to 5 across the rental's included feedbacks. `0` means not
|
|
14
|
+
rated. A criterion no feedback of a rental rated is left out.
|
|
15
|
+
- A `text` criterion is appended to the review item's `text`, as its label and the answer on
|
|
16
|
+
the next line.
|
|
17
|
+
- `showAuthorCity` in `v9Reviews`, `false` by default. When `true`, a v9 review's author reads
|
|
18
|
+
"Anna aus Hamburg" / "Anna from Hamburg" (`reviews.item.authorWithCity`).
|
|
19
|
+
- `includeItemsWithoutText` and `includeItemsWithoutRating` in `v9Reviews`, both `false` by
|
|
20
|
+
default. When `true`, a v9 feedback that has no text or no average rating still becomes a
|
|
21
|
+
review item. `summary.rating` and `summary.count` cover the included items that have a
|
|
22
|
+
rating; when none has one, `reviews` has `items` and no `summary`.
|
|
23
|
+
- `website-sdk --backend v9 review-criteria [--rental-ids <ids>]` lists the `fb_<id>` criteria
|
|
24
|
+
vOffice returns for the five units with the most feedbacks, or for the listed units.
|
|
25
|
+
- Types `V9ReviewsOptions`, `V9ReviewCriterion` and `V9ReviewCriterionDataAttribute`.
|
|
26
|
+
|
|
27
|
+
## Changed
|
|
28
|
+
|
|
29
|
+
- A v9 review's `author` is the guest's forename only ("Anna, verreist im Mai 2025" instead of
|
|
30
|
+
"Anna Beispiel, verreist im Mai 2025"). The SDK no longer requests the surname. A feedback
|
|
31
|
+
without a forename shows `reviews.item.guest` ("Gast", "Guest"); a missing name no longer
|
|
32
|
+
drops a feedback.
|
|
33
|
+
- v9 rentals request only the review criteria a site configures. Earlier versions requested
|
|
34
|
+
three fixed `fb_*` fields that exist for one vOffice account only, and did not use them.
|
|
35
|
+
- `KnownVofficeFeedbackData` no longer lists `fb_1429`, `fb_4905` and `fb_4906`. They are
|
|
36
|
+
account specific like every other `fb_*` field.
|
|
37
|
+
- Invalid `v9Reviews` options fail SDK creation with every issue listed.
|
|
38
|
+
|
|
39
|
+
Without `v9Reviews`, v9 review output is the same as in 2.24.1 apart from the author. v10 does
|
|
40
|
+
not use the option and keeps the full name, but an invalid value fails SDK creation there too. v10 already returns `summary.categories`
|
|
41
|
+
from its feedback forms.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Migration: 2.24.1 to 2.25.0
|
|
2
|
+
|
|
3
|
+
## 1. Upgrade
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @v-office/website-sdk@2.25.0
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
No changes are required. One thing looks different on a v9 site: a review's author is the
|
|
10
|
+
guest's forename only, "Gast" / "Guest" when there is none. The surname is no longer
|
|
11
|
+
available. If the site's own text says "full name" or builds initials from `author`, adjust it.
|
|
12
|
+
To name the guest differently, override `reviews.item.guest` in `translationOverrides`.
|
|
13
|
+
|
|
14
|
+
Everything else in v9 reviews stays as before until the site sets `v9Reviews`.
|
|
15
|
+
|
|
16
|
+
## 2. Optional: ratings per review criterion on a v9 site
|
|
17
|
+
|
|
18
|
+
This is an offer to the site owner, not a required step. The overall rating, the review count
|
|
19
|
+
and the reviews stay either way.
|
|
20
|
+
|
|
21
|
+
1. List the agency's criteria:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
website-sdk --backend v9 review-criteria
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Every entry has the `fb_<id>` and whether it is rated with stars. A `text` criterion usually
|
|
28
|
+
does not appear here; its ID has to come from the site owner.
|
|
29
|
+
|
|
30
|
+
2. Ask the site owner which criteria to show and what they are called, in German and English.
|
|
31
|
+
|
|
32
|
+
3. Set them in the SDK options:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
const options = {
|
|
36
|
+
v9Reviews: {
|
|
37
|
+
criteria: [
|
|
38
|
+
{ v9: "fb_8748", type: "stars", label: { "de-DE": "Sauberkeit", "en-US": "Cleanliness" } },
|
|
39
|
+
{ v9: "fb_8749", type: "stars", label: { "de-DE": "Lage", "en-US": "Location" } },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
4. Render `reviews.summary.categories` if the site does not yet. Each entry is
|
|
46
|
+
`{ label, rating }`, in the configured order; a rental shows only the criteria it has.
|
|
47
|
+
|
|
48
|
+
## 3. Optional: the guest's city on a v9 site
|
|
49
|
+
|
|
50
|
+
Set `showAuthorCity: true` in `v9Reviews` to show "Anna aus Hamburg" instead of "Anna". The
|
|
51
|
+
wording comes from `reviews.item.authorWithCity` and can be overridden. A feedback without a
|
|
52
|
+
city keeps the name alone.
|
|
53
|
+
|
|
54
|
+
## 4. Optional: include incomplete v9 feedbacks
|
|
55
|
+
|
|
56
|
+
By default a v9 feedback needs an average rating and text to become a review item. To show the
|
|
57
|
+
others as well, set `includeItemsWithoutText` or `includeItemsWithoutRating` in `v9Reviews` to
|
|
58
|
+
`true`. Items can then lack `text` or `rating`, as `RentalReview` already allows; render each
|
|
59
|
+
field only when it is present.
|
|
60
|
+
|
|
61
|
+
## 5. If you used `fb_1429`, `fb_4905` or `fb_4906` as known feedback fields
|
|
62
|
+
|
|
63
|
+
They are no longer part of `KnownVofficeFeedbackData`. Where you pass them as feedback data
|
|
64
|
+
attributes, mark them with `customDataAttribute("fb_1429")` instead.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Changelog: 2.26.0
|
|
2
|
+
|
|
3
|
+
A v9 search with a `limit` above 128 now returns every result with its price. The v9 hub
|
|
4
|
+
prices at most the first 128 results of one request and returns the rest without a price and
|
|
5
|
+
without an error, so a search with `limit: 1000` showed prices and discounts for 128 rentals
|
|
6
|
+
only.
|
|
7
|
+
|
|
8
|
+
## Added
|
|
9
|
+
|
|
10
|
+
- `sdk.live.search.searchPages(input)` on v9: an `AsyncIterable` that yields the search page
|
|
11
|
+
by page, 128 priced results per page, so a list can show the first cards while the next
|
|
12
|
+
page loads. The input is the `search` input without `cursor` and `limit`. A rental appears
|
|
13
|
+
on one page only. Every page counts as one request for the search rate limit. Not available
|
|
14
|
+
with `searchAllRentalsAtOnce: true`; the loop then rejects with the `operation`
|
|
15
|
+
`search.searchPages`.
|
|
16
|
+
- Type `V9SearchPagesInput`.
|
|
17
|
+
|
|
18
|
+
## Fixed
|
|
19
|
+
|
|
20
|
+
- v9 `sdk.live.search.search` with a `limit` above 128 prices every result. The SDK fetches
|
|
21
|
+
the results as hub requests of 128, up to eight in parallel, and returns them merged, each
|
|
22
|
+
rental once. If a booking shifts the results while the requests run, the SDK fetches the
|
|
23
|
+
call once more. `pageInfo` and `nextCursor` behave as for any other `limit`: the cursor
|
|
24
|
+
continues with the same `limit`. The call counts as one request for the search rate limit.
|
|
25
|
+
- Errors from the v9 backend code report `source: "v9"`: every error from the hub and the v9
|
|
26
|
+
errors of search, rentals, quote, booking, availability, contact and config. Most of them
|
|
27
|
+
reported `source: "v10"`. Errors from code both backends share, such as payment
|
|
28
|
+
submission, keep `source: "core"`. The two errors for a service the SDK runtime does not
|
|
29
|
+
provide, with the `operation` `booking.getBankTransferDetails` or `search.mapSearch`, now
|
|
30
|
+
report `source: "core"` as well.
|
|
31
|
+
|
|
32
|
+
A v9 search with a `limit` up to 128 is unchanged: one request, the same cursor. Search on v10
|
|
33
|
+
is unchanged.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Migration: 2.25.0 to 2.26.0
|
|
2
|
+
|
|
3
|
+
## 1. Upgrade
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pnpm add @v-office/website-sdk@2.26.0
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
No changes are required, except for code that checks `error.source` on a v9 site (below).
|
|
10
|
+
On a v9 site, a search with a `limit` above 128 now returns prices and discounts for every
|
|
11
|
+
result instead of the first 128. A site that worked around this by paging with a `limit` of
|
|
12
|
+
128 or less can keep doing so.
|
|
13
|
+
|
|
14
|
+
Errors from the v9 backend code, such as every error from the hub, now report `source: "v9"`
|
|
15
|
+
instead of `"v10"`. Code that recognizes them by `error.source === "v10"` checks `"v9"`
|
|
16
|
+
instead. Errors from code both backends share, such as payment submission, still report
|
|
17
|
+
`source: "core"`; leave checks for `"core"` as they are.
|
|
18
|
+
|
|
19
|
+
## 2. Optional: show the first results sooner on a v9 site
|
|
20
|
+
|
|
21
|
+
A search with a large `limit` answers once every result is priced. To render the first cards
|
|
22
|
+
earlier, loop over `searchPages` instead:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
for await (const page of sdk.live.search.searchPages({ locale: "de-DE", query })) {
|
|
26
|
+
renderCards(page.items, page.alternatives);
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Keep `search` with a large `limit` where the page needs every result before it renders, for
|
|
31
|
+
example a list sorted on the client or a map with prices.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-office/website-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.26.0",
|
|
4
4
|
"description": "Website-facing SDK facade backed by @v-office/sdk-core",
|
|
5
5
|
"bin": {
|
|
6
6
|
"website-sdk": "./dist/cli.mjs"
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"test": "pnpm run test:v9:openapi && pnpm run test:v9:properties && pnpm run test:v9:rentals && pnpm run test:v9:graphql && pnpm run test:v9:availability && pnpm run test:v9:search && pnpm run test:v9:booking && pnpm run build && node --test test/*.test.mjs",
|
|
85
85
|
"test:v9:openapi": "node --test codegen/v9/php-record.test.ts src/legacy-v9/openapi/setup-response.test.ts src/legacy-v9/openapi/quote-response.test.ts",
|
|
86
86
|
"test:v9:properties": "node --test codegen/v9/heuristic-generation/generate/property.test.ts src/legacy-v9/property-highlight-sources.test.ts src/legacy-v9/parser/rentals/render-property-attribute.test.ts src/legacy-v9/parser/rentals/to-property.test.ts src/legacy-v9/parser/rentals/to-rooms.test.ts",
|
|
87
|
-
"test:v9:rentals": "node --test src/legacy-v9/static/associate-rentals-with-facilities-by-object-groups.test.ts",
|
|
87
|
+
"test:v9:rentals": "node --test src/legacy-v9/static/associate-rentals-with-facilities-by-object-groups.test.ts src/legacy-v9/parser/rentals/to-reviews.test.ts",
|
|
88
88
|
"test:v9:graphql": "node --test src/legacy-v9/graphql/client.test.ts",
|
|
89
89
|
"test:v9:availability": "node --test src/legacy-v9/parser/availability/to-initial-availability-calendar-days.test.ts",
|
|
90
90
|
"test:v9:search": "node --test src/legacy-v9/parser/search/resolve-exact-match.test.ts",
|