@v-office/website-sdk 2.32.0 → 2.34.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/README.md +17 -6
- package/dist/cli.mjs +12 -2
- package/dist/{client-mC56Qyoy.mjs → client-C1McSXf1.mjs} +73 -14
- package/dist/index.d.mts +123 -4
- package/dist/index.mjs +2 -2
- package/dist/instructions/CHANGELOG.md +2 -0
- package/dist/instructions/MIGRATION.md +2 -0
- package/dist/instructions/README.md +1 -0
- package/dist/instructions/availability.md +1 -1
- package/dist/instructions/booking.md +1 -1
- package/dist/instructions/contact.md +1 -1
- package/dist/instructions/creation.md +11 -0
- package/dist/instructions/quote.md +1 -1
- package/dist/instructions/search.md +2 -2
- package/dist/instructions/versions/2.33.0/CHANGELOG.md +21 -0
- package/dist/instructions/versions/2.33.0/MIGRATION.md +25 -0
- package/dist/instructions/versions/2.34.0/CHANGELOG.md +18 -0
- package/dist/instructions/versions/2.34.0/MIGRATION.md +9 -0
- package/dist/instructions/videos.md +168 -0
- package/dist/{rentals-Ov8pd9qV.mjs → rentals-yMGMrIHJ.mjs} +1 -1
- package/dist/{search-BQgxTBHd.mjs → search-DiEV8NhE.mjs} +1 -1
- package/instructions/CHANGELOG.md +2 -0
- package/instructions/MIGRATION.md +2 -0
- package/instructions/README.md +1 -0
- package/instructions/availability.md +1 -1
- package/instructions/booking.md +1 -1
- package/instructions/contact.md +1 -1
- package/instructions/creation.md +11 -0
- package/instructions/quote.md +1 -1
- package/instructions/search.md +2 -2
- package/instructions/versions/2.33.0/CHANGELOG.md +21 -0
- package/instructions/versions/2.33.0/MIGRATION.md +25 -0
- package/instructions/versions/2.33.0/release.json +3 -0
- package/instructions/versions/2.34.0/CHANGELOG.md +18 -0
- package/instructions/versions/2.34.0/MIGRATION.md +9 -0
- package/instructions/versions/2.34.0/release.json +3 -0
- package/instructions/videos.md +168 -0
- package/package.json +9 -3
|
@@ -123,6 +123,7 @@ type WebsiteSDKOptions = {
|
|
|
123
123
|
rentalScope?: RentalScope;
|
|
124
124
|
shouldAddProposedAdditionalServiceAmount?: boolean;
|
|
125
125
|
searchAllRentalsAtOnce?: boolean;
|
|
126
|
+
rateBudget?: { interval?: Duration.Input; maxQueueSize?: number };
|
|
126
127
|
};
|
|
127
128
|
```
|
|
128
129
|
|
|
@@ -130,6 +131,15 @@ type WebsiteSDKOptions = {
|
|
|
130
131
|
guest's city, and which incomplete v9 feedbacks become review items. v10 does not use it, but an invalid value fails SDK creation on
|
|
131
132
|
both backends. See "Legacy v9 Reviews" in `rentals.md`.
|
|
132
133
|
|
|
134
|
+
`rateBudget` sets how often the SDK may start a PMS request of one kind (search, quote,
|
|
135
|
+
booking, contact, and on v10 availability and feedback) and how many of that kind may be
|
|
136
|
+
running or waiting at once (`maxQueueSize`, the running one included), on v9 and v10 alike. The
|
|
137
|
+
next request past that fails right away. The default, one start a second and five at once, is
|
|
138
|
+
what one visitor's browser needs: **a website keeps it and sets nothing.** Only a server that
|
|
139
|
+
serves many visitors through one SDK widens it, for example
|
|
140
|
+
`{ interval: "250 millis", maxQueueSize: 25 }`. `maxQueueSize` must be at least 1 and `interval`
|
|
141
|
+
a positive duration, or SDK creation fails.
|
|
142
|
+
|
|
133
143
|
`searchAllRentalsAtOnce` selects how a site searches, on v9 and v10 alike: every
|
|
134
144
|
result with prices in one call (portfolios of up to 100 rentals), or paged results
|
|
135
145
|
plus `mapSearch`. See `search.md`.
|
|
@@ -157,6 +167,7 @@ Unset options are normalized by the SDK:
|
|
|
157
167
|
- `rentalScope` defaults to `{}`.
|
|
158
168
|
- `shouldAddProposedAdditionalServiceAmount` defaults to `false`.
|
|
159
169
|
- `searchAllRentalsAtOnce` defaults to `false`.
|
|
170
|
+
- `rateBudget` defaults to `{ interval: "1 second", maxQueueSize: 5 }`.
|
|
160
171
|
- `translationOverrides` is omitted unless provided.
|
|
161
172
|
|
|
162
173
|
### v9 Property Highlight Sources
|
|
@@ -449,7 +449,7 @@ longer used; see `versions/2.13.0/MIGRATION.md`.
|
|
|
449
449
|
|
|
450
450
|
## Configuration
|
|
451
451
|
|
|
452
|
-
|
|
452
|
+
By default, quote requests start at most once a second, with at most five running or waiting at once; `rateBudget` changes both (see `creation.md`). `v9` supports insurance option refresh and insurance actions; `v10` currently returns a no-insurance placeholder and insurance actions resolve as not required.
|
|
453
453
|
|
|
454
454
|
`shouldAddProposedAdditionalServiceAmount` defaults to `false`. When `true`, proposed optional service quantities greater than zero are automatically selected on quote creation. `proposedQuantity` is returned whenever the backend provides a line amount (including `0`), regardless of this setting.
|
|
455
455
|
|
|
@@ -501,7 +501,7 @@ for await (const page of sdk.live.search.searchPages({ locale: "de-DE", query })
|
|
|
501
501
|
`if (sdk.backend === "v9")`.
|
|
502
502
|
- The input is the `search` input without `cursor` and `limit`; the SDK pages itself.
|
|
503
503
|
- Every page is one `search` call and counts as one request for the rate limit, so
|
|
504
|
-
the SDK starts at most one page per second.
|
|
504
|
+
the SDK starts at most one page per second by default (`rateBudget`, see `creation.md`).
|
|
505
505
|
- A rental appears on one page only, even when a booking moves it between two pages.
|
|
506
506
|
- Each page carries its own `pageInfo`; `pageInfo.totalCount` is the total over all
|
|
507
507
|
pages.
|
|
@@ -922,7 +922,7 @@ Use flat `WebsiteSDKConfig` files and optional `WebsiteSDKOptions`.
|
|
|
922
922
|
|
|
923
923
|
For v10, config requires `searchEndpoint` (the full REST search URL) as of 2.5.0. See `creation.md` for `searchEndpoint` and the `customAttributes` option.
|
|
924
924
|
|
|
925
|
-
Custom filter definitions can extend accepted search query keys.
|
|
925
|
+
Custom filter definitions can extend accepted search query keys. By default, search requests start at most once a second, with at most five running or waiting at once; `rateBudget` changes both (see `creation.md`). A `searchAllRentalsAtOnce` search and a `mapSearch` each count as one request, including every backend request they make.
|
|
926
926
|
|
|
927
927
|
## CLI Usage
|
|
928
928
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog: 2.33.0
|
|
2
|
+
|
|
3
|
+
v9 sites can now list the videos an agency uploaded in the be-on! agency portal and play
|
|
4
|
+
them, for example a home page video or a video on a rental page.
|
|
5
|
+
|
|
6
|
+
## Added
|
|
7
|
+
|
|
8
|
+
- `sdk.static.videos.getVideos` on v9 returns the agency's videos, ordered by upload. Each
|
|
9
|
+
video has an `id`, a `placement`, the `rentalIds` it belongs to, an HLS stream URL
|
|
10
|
+
`hlsUrl`, an optional `posterUrl`, `durationSeconds` and the upload's `fileName`.
|
|
11
|
+
- Optional filters `placement` (`frontpage`, `object` or a free slug) and `rentalId`. They
|
|
12
|
+
combine; without them every video is returned.
|
|
13
|
+
- The SDK loads the list once per instance. A failing call rejects, so a build that needs
|
|
14
|
+
videos fails and the previous build stays live.
|
|
15
|
+
- The types `V9Video`, `V9VideosGetVideosInput` and `WebsiteSDKV9Static` are exported.
|
|
16
|
+
- The CLI has a `videos` command for v9 with `--placement` and `--rental-id`.
|
|
17
|
+
- `videos.md` describes the data and shows how to play the HLS stream with `hls.js`.
|
|
18
|
+
|
|
19
|
+
## Changed
|
|
20
|
+
|
|
21
|
+
- Nothing for existing code. v10 is unchanged and has no videos.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Migration: 2.32.0 to 2.33.0
|
|
2
|
+
|
|
3
|
+
No changes required. Existing v9 and v10 code keeps working, and v10 is unchanged. Follow
|
|
4
|
+
steps 2 and 3 only to show videos on a v9 site.
|
|
5
|
+
|
|
6
|
+
## 1. Upgrade
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
pnpm add @v-office/website-sdk@2.33.0
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 2. Load the videos (v9 only)
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
if (sdk.backend === "v9") {
|
|
16
|
+
const videos = await sdk.static.videos.getVideos({ placement: "object", rentalId: rental.id });
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
An empty list is normal. Do not show `fileName` to visitors. See `videos.md` for placements and
|
|
21
|
+
the data shape.
|
|
22
|
+
|
|
23
|
+
## 3. Play the stream
|
|
24
|
+
|
|
25
|
+
Add `hls.js` as an exactly pinned dependency and attach `hlsUrl` as described in `videos.md`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Changelog: 2.34.0
|
|
2
|
+
|
|
3
|
+
A server that serves many visitors through one SDK can widen the SDK's PMS request budget.
|
|
4
|
+
Websites keep the default and change nothing.
|
|
5
|
+
|
|
6
|
+
## Added
|
|
7
|
+
|
|
8
|
+
- The `rateBudget` option (`{ interval, maxQueueSize }`): how often the SDK may start a PMS
|
|
9
|
+
request of one kind, and how many of that kind may be running or waiting at once. It applies on v9 and v10 alike, to search, quote,
|
|
10
|
+
booking and contact, and on v10 also to availability and feedback. The default is unchanged:
|
|
11
|
+
one start a second, five at once. AI Studio's website chat, which shares one SDK per website
|
|
12
|
+
among all its visitors, widens it.
|
|
13
|
+
- An invalid `rateBudget` (a queue below 1, an interval that is not a positive duration) fails SDK
|
|
14
|
+
creation with an error that names it.
|
|
15
|
+
|
|
16
|
+
## Changed
|
|
17
|
+
|
|
18
|
+
- Nothing for existing code. Without `rateBudget`, every limit is what it was.
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# Videos
|
|
2
|
+
|
|
3
|
+
Videos are available on v9 only. Check `sdk.backend === "v9"` before using them. v10 has no
|
|
4
|
+
`sdk.static.videos`.
|
|
5
|
+
|
|
6
|
+
## Service
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
if (sdk.backend === "v9") {
|
|
10
|
+
const all = await sdk.static.videos.getVideos();
|
|
11
|
+
const hero = await sdk.static.videos.getVideos({ placement: "frontpage" });
|
|
12
|
+
const ofRental = await sdk.static.videos.getVideos({ placement: "object", rentalId: "12345" });
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The SDK loads the list once per instance. Filters run locally and combine with AND; without
|
|
17
|
+
input every video is returned.
|
|
18
|
+
|
|
19
|
+
## Input
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
type V9VideosGetVideosInput = {
|
|
23
|
+
placement?: string;
|
|
24
|
+
rentalId?: string;
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Output
|
|
29
|
+
|
|
30
|
+
Returns `Promise<ReadonlyArray<V9Video>>`, ordered by upload (oldest first).
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
type V9Video = {
|
|
34
|
+
id: string;
|
|
35
|
+
placement: string;
|
|
36
|
+
rentalIds: ReadonlyArray<string>;
|
|
37
|
+
hlsUrl: string;
|
|
38
|
+
posterUrl: string | null;
|
|
39
|
+
durationSeconds: number;
|
|
40
|
+
fileName: string;
|
|
41
|
+
};
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Sample item:
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"id": "17",
|
|
49
|
+
"placement": "object",
|
|
50
|
+
"rentalIds": ["12345"],
|
|
51
|
+
"hlsUrl": "https://stream.example/abc/manifest/video.m3u8",
|
|
52
|
+
"posterUrl": "https://stream.example/abc/thumbnails/thumbnail.jpg",
|
|
53
|
+
"durationSeconds": 67.2,
|
|
54
|
+
"fileName": "haus-seeblick-final.mp4"
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- `placement` says where the agency wants the video. `frontpage` is the home page video
|
|
59
|
+
(at most one per agency). `object` videos belong to the rentals in `rentalIds`; one rental
|
|
60
|
+
can have several videos. Any other value is a free slug for a page of the agency's choosing,
|
|
61
|
+
for example a landing page. The agency picks the placement in the be-on! agency portal.
|
|
62
|
+
- `rentalIds` match `rental.id` of the rentals.
|
|
63
|
+
- `fileName` is the name of the uploaded file. Never show it to visitors. Label a video from
|
|
64
|
+
the rental name or the page it sits on.
|
|
65
|
+
- `posterUrl` is `null` when no still image exists.
|
|
66
|
+
|
|
67
|
+
## Behaviour
|
|
68
|
+
|
|
69
|
+
- Call it at build time. A video the agency adds or deletes shows up after the next site
|
|
70
|
+
build.
|
|
71
|
+
- A failing call rejects, which fails the build. The previous build stays live.
|
|
72
|
+
- An empty list is normal. Render nothing, not an empty player.
|
|
73
|
+
|
|
74
|
+
## Playback
|
|
75
|
+
|
|
76
|
+
`hlsUrl` is an HLS stream. Install `hls.js` as an exactly pinned dependency of the site. Safari
|
|
77
|
+
and iOS play HLS natively; other browsers need `hls.js`. Try native playback first, then load
|
|
78
|
+
`hls.js` on demand.
|
|
79
|
+
|
|
80
|
+
This snippet is temporary: a playback helper in `@v-office/website-headless` will replace it.
|
|
81
|
+
|
|
82
|
+
### Rental video
|
|
83
|
+
|
|
84
|
+
```astro
|
|
85
|
+
---
|
|
86
|
+
const [video] = await sdk.static.videos.getVideos({ placement: "object", rentalId: rental.id });
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
{
|
|
90
|
+
video && (
|
|
91
|
+
<video
|
|
92
|
+
data-hls={video.hlsUrl}
|
|
93
|
+
controls
|
|
94
|
+
poster={video.posterUrl ?? undefined}
|
|
95
|
+
preload="none"
|
|
96
|
+
playsinline
|
|
97
|
+
aria-label={`Video: ${rental.nameOrLabel}`}
|
|
98
|
+
/>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
<script>
|
|
103
|
+
const attach = async (video: HTMLVideoElement, src: string) => {
|
|
104
|
+
if (video.canPlayType("application/vnd.apple.mpegurl")) {
|
|
105
|
+
video.src = src;
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const { default: Hls } = await import("hls.js");
|
|
109
|
+
if (!Hls.isSupported()) return;
|
|
110
|
+
const hls = new Hls();
|
|
111
|
+
hls.loadSource(src);
|
|
112
|
+
hls.attachMedia(video);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
document
|
|
116
|
+
.querySelectorAll<HTMLVideoElement>("video[data-hls]")
|
|
117
|
+
.forEach((video) => attach(video, video.dataset.hls!));
|
|
118
|
+
</script>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Hero video
|
|
122
|
+
|
|
123
|
+
The home page video plays silently in the background, so it is muted, loops and carries no
|
|
124
|
+
native controls. Moving content that starts on its own needs a way to stop it, so the hero
|
|
125
|
+
gets a pause button and does not start for visitors who ask for reduced motion.
|
|
126
|
+
|
|
127
|
+
```astro
|
|
128
|
+
---
|
|
129
|
+
const [hero] = await sdk.static.videos.getVideos({ placement: "frontpage" });
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
{
|
|
133
|
+
hero && (
|
|
134
|
+
<div class="hero-video">
|
|
135
|
+
<video
|
|
136
|
+
data-hls={hero.hlsUrl}
|
|
137
|
+
data-hero
|
|
138
|
+
muted
|
|
139
|
+
loop
|
|
140
|
+
playsinline
|
|
141
|
+
poster={hero.posterUrl ?? undefined}
|
|
142
|
+
aria-hidden="true"
|
|
143
|
+
/>
|
|
144
|
+
<button type="button" data-hero-toggle>Pause video</button>
|
|
145
|
+
</div>
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
<script>
|
|
150
|
+
const video = document.querySelector<HTMLVideoElement>("video[data-hero]");
|
|
151
|
+
const toggle = document.querySelector<HTMLButtonElement>("button[data-hero-toggle]");
|
|
152
|
+
if (video && toggle) {
|
|
153
|
+
const sync = () => (toggle.textContent = video.paused ? "Play video" : "Pause video");
|
|
154
|
+
video.addEventListener("play", sync);
|
|
155
|
+
video.addEventListener("pause", sync);
|
|
156
|
+
toggle.addEventListener("click", () => (video.paused ? video.play() : video.pause()));
|
|
157
|
+
// hls.js attaches the source later; autoplay starts the video once it can play.
|
|
158
|
+
video.autoplay = !matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
159
|
+
if (video.autoplay && video.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA) {
|
|
160
|
+
video.play().catch(sync);
|
|
161
|
+
}
|
|
162
|
+
sync();
|
|
163
|
+
}
|
|
164
|
+
</script>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Use the `<script>` from the rental video as well. It attaches every `video[data-hls]` on the
|
|
168
|
+
page.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Qt as V9_FACILITY_ATTRIBUTE_KEYS } from "./client-C1McSXf1.mjs";
|
|
2
2
|
import { _ as parseVofficeFacilityData, b as parseVofficeUnitData, c as rentalsAllByFacilityObjectGroupsWithoutFeedbacksQuery, d as VofficeUnitDataFieldSchemas, f as VofficeUnitDataPropertyCategoryLabelKeys, i as hubFiltersQuery, l as rentalsAllFeedbacksQuery, m as VofficeUnitDataPropertyMetadata, o as rentalFacilitiesForObjectGroupRelationQuery, p as VofficeUnitDataPropertyCategoryValues, s as rentalIdsQuery, u as rentalsAllWithoutFeedbacksQuery, v as parseVofficeFeedbackData } from "./operations-CUWcmNGK.mjs";
|
|
3
3
|
import { a as toFacilityImages, c as toLocalizedString, i as toLocation, o as toImages, r as renderVofficePropertyAttribute, s as toAddress, t as toRentalHighlights } from "./to-rental-highlights-Dbnm6Y4_.mjs";
|
|
4
4
|
import { CoreSDKError, makeTranslate, renderResolvedCustomAttribute, toCustomAttributeList, toResolvedCustomAttributeCategoryTranslationKey } from "@v-office/sdk-core";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as makeV9CustomAttributeFilterCapabilities, c as parseQueryParameters, d as toVoucherCode, l as toQueryString, o as toBasicQueryInputs, s as collectQueryParameters, u as applyVofficeFilterDerivedBasicQueryInputs } from "./client-
|
|
1
|
+
import { a as makeV9CustomAttributeFilterCapabilities, c as parseQueryParameters, d as toVoucherCode, l as toQueryString, o as toBasicQueryInputs, s as collectQueryParameters, u as applyVofficeFilterDerivedBasicQueryInputs } from "./client-C1McSXf1.mjs";
|
|
2
2
|
import { b as parseVofficeUnitData, n as mapSearchQuery, r as searchQuery } from "./operations-CUWcmNGK.mjs";
|
|
3
3
|
import { i as toLocation, n as toV9RentalHighlightKey, o as toImages, s as toAddress, t as toRentalHighlights } from "./to-rental-highlights-Dbnm6Y4_.mjs";
|
|
4
4
|
import { CoreSDKError, STABLE_SEARCH_INPUTS, daysBetweenLocalDates, expandCustomAttributeFilterCompositions, parseChildrenAges, parseOccupancyCount, resolveExpandedCompositions, toFormattedSearchPrice, toIsoDateFromPeriodQueryDate, toStableSearchInputBackendQueryKeys, toStableSearchInputParameterValues, toStableSearchInputQueryKeys, toUnusedFilterKeys } from "@v-office/sdk-core";
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Release notes of `@v-office/website-sdk`, newest first. Each version has its own directory.
|
|
6
6
|
|
|
7
|
+
- `versions/2.34.0/CHANGELOG.md`: release notes for 2.34.0
|
|
8
|
+
- `versions/2.33.0/CHANGELOG.md`: release notes for 2.33.0
|
|
7
9
|
- `versions/2.32.0/CHANGELOG.md`: release notes for 2.32.0
|
|
8
10
|
- `versions/2.31.1/CHANGELOG.md`: release notes for 2.31.1
|
|
9
11
|
- `versions/2.31.0/CHANGELOG.md`: release notes for 2.31.0
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Migration guides of `@v-office/website-sdk`, newest first. Apply them in order when skipping versions.
|
|
6
6
|
|
|
7
|
+
- `versions/2.34.0/MIGRATION.md`: Migration: 2.33.0 to 2.34.0
|
|
8
|
+
- `versions/2.33.0/MIGRATION.md`: Migration: 2.32.0 to 2.33.0
|
|
7
9
|
- `versions/2.32.0/MIGRATION.md`: Migration: 2.31.1 to 2.32.0
|
|
8
10
|
- `versions/2.31.1/MIGRATION.md`: Migration: 2.31.0 to 2.31.1
|
|
9
11
|
- `versions/2.31.0/MIGRATION.md`: Migration: 2.30.2 to 2.31.0
|
package/instructions/README.md
CHANGED
|
@@ -9,6 +9,7 @@ Use this directory as the consumer-facing reference for the package:
|
|
|
9
9
|
- `creation.md`: SDK construction, config, options, and CLI config files.
|
|
10
10
|
- `rentals.md`: `sdk.static.rentals.getRentals` and, on v9, `sdk.live.rentals.getRentalsByIds`.
|
|
11
11
|
- `filter.md`: `sdk.static.filter.getFilters`.
|
|
12
|
+
- `videos.md`: v9 only. `sdk.static.videos.getVideos`, placements, and HLS playback.
|
|
12
13
|
- `custom-attributes.md`: custom attribute catalog, configuration, per-backend behaviour, and the v9-to-v10 move.
|
|
13
14
|
- `search.md`: `sdk.live.search.search`, vouchers, and, on v9, `sdk.live.search.searchPages`, Hub filters, and `sdk.live.voucher.validate`.
|
|
14
15
|
- `availability.md`: date-picker availability flows.
|
|
@@ -195,7 +195,7 @@ Use flat `WebsiteSDKConfig` files.
|
|
|
195
195
|
}
|
|
196
196
|
```
|
|
197
197
|
|
|
198
|
-
Availability uses localized tooltips from the translation service. `v10` availability queries
|
|
198
|
+
Availability uses localized tooltips from the translation service. By default, `v10` availability queries start at most once a second, with at most five running or waiting at once; `rateBudget` changes both (see `creation.md`). They are cached per rental for 30 seconds.
|
|
199
199
|
|
|
200
200
|
## CLI Usage
|
|
201
201
|
|
package/instructions/booking.md
CHANGED
|
@@ -221,7 +221,7 @@ A successful return means the provider sent the browser back, not that the payme
|
|
|
221
221
|
|
|
222
222
|
## Configuration
|
|
223
223
|
|
|
224
|
-
|
|
224
|
+
By default, booking requests start at most once a second, with at most five running or waiting at once; `rateBudget` changes both (see `creation.md`). `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.
|
|
225
225
|
|
|
226
226
|
## CLI Usage
|
|
227
227
|
|
package/instructions/contact.md
CHANGED
|
@@ -86,7 +86,7 @@ Contact input is validated before submitting to either backend. Validation failu
|
|
|
86
86
|
|
|
87
87
|
## Configuration
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
By default, contact requests start at most once a second, with at most five running or waiting at once; `rateBudget` changes both (see `creation.md`).
|
|
90
90
|
|
|
91
91
|
## CLI Usage
|
|
92
92
|
|
package/instructions/creation.md
CHANGED
|
@@ -123,6 +123,7 @@ type WebsiteSDKOptions = {
|
|
|
123
123
|
rentalScope?: RentalScope;
|
|
124
124
|
shouldAddProposedAdditionalServiceAmount?: boolean;
|
|
125
125
|
searchAllRentalsAtOnce?: boolean;
|
|
126
|
+
rateBudget?: { interval?: Duration.Input; maxQueueSize?: number };
|
|
126
127
|
};
|
|
127
128
|
```
|
|
128
129
|
|
|
@@ -130,6 +131,15 @@ type WebsiteSDKOptions = {
|
|
|
130
131
|
guest's city, and which incomplete v9 feedbacks become review items. v10 does not use it, but an invalid value fails SDK creation on
|
|
131
132
|
both backends. See "Legacy v9 Reviews" in `rentals.md`.
|
|
132
133
|
|
|
134
|
+
`rateBudget` sets how often the SDK may start a PMS request of one kind (search, quote,
|
|
135
|
+
booking, contact, and on v10 availability and feedback) and how many of that kind may be
|
|
136
|
+
running or waiting at once (`maxQueueSize`, the running one included), on v9 and v10 alike. The
|
|
137
|
+
next request past that fails right away. The default, one start a second and five at once, is
|
|
138
|
+
what one visitor's browser needs: **a website keeps it and sets nothing.** Only a server that
|
|
139
|
+
serves many visitors through one SDK widens it, for example
|
|
140
|
+
`{ interval: "250 millis", maxQueueSize: 25 }`. `maxQueueSize` must be at least 1 and `interval`
|
|
141
|
+
a positive duration, or SDK creation fails.
|
|
142
|
+
|
|
133
143
|
`searchAllRentalsAtOnce` selects how a site searches, on v9 and v10 alike: every
|
|
134
144
|
result with prices in one call (portfolios of up to 100 rentals), or paged results
|
|
135
145
|
plus `mapSearch`. See `search.md`.
|
|
@@ -157,6 +167,7 @@ Unset options are normalized by the SDK:
|
|
|
157
167
|
- `rentalScope` defaults to `{}`.
|
|
158
168
|
- `shouldAddProposedAdditionalServiceAmount` defaults to `false`.
|
|
159
169
|
- `searchAllRentalsAtOnce` defaults to `false`.
|
|
170
|
+
- `rateBudget` defaults to `{ interval: "1 second", maxQueueSize: 5 }`.
|
|
160
171
|
- `translationOverrides` is omitted unless provided.
|
|
161
172
|
|
|
162
173
|
### v9 Property Highlight Sources
|
package/instructions/quote.md
CHANGED
|
@@ -449,7 +449,7 @@ longer used; see `versions/2.13.0/MIGRATION.md`.
|
|
|
449
449
|
|
|
450
450
|
## Configuration
|
|
451
451
|
|
|
452
|
-
|
|
452
|
+
By default, quote requests start at most once a second, with at most five running or waiting at once; `rateBudget` changes both (see `creation.md`). `v9` supports insurance option refresh and insurance actions; `v10` currently returns a no-insurance placeholder and insurance actions resolve as not required.
|
|
453
453
|
|
|
454
454
|
`shouldAddProposedAdditionalServiceAmount` defaults to `false`. When `true`, proposed optional service quantities greater than zero are automatically selected on quote creation. `proposedQuantity` is returned whenever the backend provides a line amount (including `0`), regardless of this setting.
|
|
455
455
|
|
package/instructions/search.md
CHANGED
|
@@ -501,7 +501,7 @@ for await (const page of sdk.live.search.searchPages({ locale: "de-DE", query })
|
|
|
501
501
|
`if (sdk.backend === "v9")`.
|
|
502
502
|
- The input is the `search` input without `cursor` and `limit`; the SDK pages itself.
|
|
503
503
|
- Every page is one `search` call and counts as one request for the rate limit, so
|
|
504
|
-
the SDK starts at most one page per second.
|
|
504
|
+
the SDK starts at most one page per second by default (`rateBudget`, see `creation.md`).
|
|
505
505
|
- A rental appears on one page only, even when a booking moves it between two pages.
|
|
506
506
|
- Each page carries its own `pageInfo`; `pageInfo.totalCount` is the total over all
|
|
507
507
|
pages.
|
|
@@ -922,7 +922,7 @@ Use flat `WebsiteSDKConfig` files and optional `WebsiteSDKOptions`.
|
|
|
922
922
|
|
|
923
923
|
For v10, config requires `searchEndpoint` (the full REST search URL) as of 2.5.0. See `creation.md` for `searchEndpoint` and the `customAttributes` option.
|
|
924
924
|
|
|
925
|
-
Custom filter definitions can extend accepted search query keys.
|
|
925
|
+
Custom filter definitions can extend accepted search query keys. By default, search requests start at most once a second, with at most five running or waiting at once; `rateBudget` changes both (see `creation.md`). A `searchAllRentalsAtOnce` search and a `mapSearch` each count as one request, including every backend request they make.
|
|
926
926
|
|
|
927
927
|
## CLI Usage
|
|
928
928
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog: 2.33.0
|
|
2
|
+
|
|
3
|
+
v9 sites can now list the videos an agency uploaded in the be-on! agency portal and play
|
|
4
|
+
them, for example a home page video or a video on a rental page.
|
|
5
|
+
|
|
6
|
+
## Added
|
|
7
|
+
|
|
8
|
+
- `sdk.static.videos.getVideos` on v9 returns the agency's videos, ordered by upload. Each
|
|
9
|
+
video has an `id`, a `placement`, the `rentalIds` it belongs to, an HLS stream URL
|
|
10
|
+
`hlsUrl`, an optional `posterUrl`, `durationSeconds` and the upload's `fileName`.
|
|
11
|
+
- Optional filters `placement` (`frontpage`, `object` or a free slug) and `rentalId`. They
|
|
12
|
+
combine; without them every video is returned.
|
|
13
|
+
- The SDK loads the list once per instance. A failing call rejects, so a build that needs
|
|
14
|
+
videos fails and the previous build stays live.
|
|
15
|
+
- The types `V9Video`, `V9VideosGetVideosInput` and `WebsiteSDKV9Static` are exported.
|
|
16
|
+
- The CLI has a `videos` command for v9 with `--placement` and `--rental-id`.
|
|
17
|
+
- `videos.md` describes the data and shows how to play the HLS stream with `hls.js`.
|
|
18
|
+
|
|
19
|
+
## Changed
|
|
20
|
+
|
|
21
|
+
- Nothing for existing code. v10 is unchanged and has no videos.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Migration: 2.32.0 to 2.33.0
|
|
2
|
+
|
|
3
|
+
No changes required. Existing v9 and v10 code keeps working, and v10 is unchanged. Follow
|
|
4
|
+
steps 2 and 3 only to show videos on a v9 site.
|
|
5
|
+
|
|
6
|
+
## 1. Upgrade
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
pnpm add @v-office/website-sdk@2.33.0
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 2. Load the videos (v9 only)
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
if (sdk.backend === "v9") {
|
|
16
|
+
const videos = await sdk.static.videos.getVideos({ placement: "object", rentalId: rental.id });
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
An empty list is normal. Do not show `fileName` to visitors. See `videos.md` for placements and
|
|
21
|
+
the data shape.
|
|
22
|
+
|
|
23
|
+
## 3. Play the stream
|
|
24
|
+
|
|
25
|
+
Add `hls.js` as an exactly pinned dependency and attach `hlsUrl` as described in `videos.md`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Changelog: 2.34.0
|
|
2
|
+
|
|
3
|
+
A server that serves many visitors through one SDK can widen the SDK's PMS request budget.
|
|
4
|
+
Websites keep the default and change nothing.
|
|
5
|
+
|
|
6
|
+
## Added
|
|
7
|
+
|
|
8
|
+
- The `rateBudget` option (`{ interval, maxQueueSize }`): how often the SDK may start a PMS
|
|
9
|
+
request of one kind, and how many of that kind may be running or waiting at once. It applies on v9 and v10 alike, to search, quote,
|
|
10
|
+
booking and contact, and on v10 also to availability and feedback. The default is unchanged:
|
|
11
|
+
one start a second, five at once. AI Studio's website chat, which shares one SDK per website
|
|
12
|
+
among all its visitors, widens it.
|
|
13
|
+
- An invalid `rateBudget` (a queue below 1, an interval that is not a positive duration) fails SDK
|
|
14
|
+
creation with an error that names it.
|
|
15
|
+
|
|
16
|
+
## Changed
|
|
17
|
+
|
|
18
|
+
- Nothing for existing code. Without `rateBudget`, every limit is what it was.
|